[Ffmpeg-devel] [BUG] Compilation failure when using --disable-opts

Panagiotis Issaris takis
Wed Mar 14 22:50:53 CET 2007


Hi M?ns,

M?ns Rullg?rd schreef:
> Panagiotis Issaris <takis at issaris.org> writes:
>> M?ns Rullg?rd schreef:
>>> Panagiotis Issaris <takis.issaris at uhasselt.be> writes:
>>>
>>>> The attached patch defines CONFIG_EBP in config.h if EBP is available.
[...]
>>> And what's the "int i" good for?
>> The 'i' is set at the beginning of the program, and so base pointer will
>> be used to initialize it (it is on the stack). At the end of the program
>> the the contents of 'i' is the returnvalue of the program and so the
>> base pointer will again be used to get at the value of 'i'. As it is set
>> to zero by the inline assembly code, a 0+offset pointer will be
>> dereferenced caused a segfault. Without the 'i' or with
>> -fomit-frame-pointer this won't happen.
> 
> Makes sense.  I figured there was some reason for it, but as Diego
> said, a comment would be nice.
Yep, I replied to Diego's e-mail regarding this.

[...]
>> +# check whether EBP is available on x86
>> +if test $arch = "x86_32" -o $arch = "x86_64"; then
>> +ebp_available=no
>> +check_exec <<EOF && enable ebp_available
>> +int main(){
>> +    volatile int i=0;
>> +    asm volatile (
>> +        "xorl %%ebp, %%ebp"
>> +    ::: "%ebp");
>> +    return i;
>> +}
>> +EOF
>> +fi
> 
> Isn't there already some x86 section this could be added to?  
I could add it here... but that doesn't look good to me for some
reason... it seems a bit ugly to do these tests while output is already
being generated.

1793 echo "big-endian                $bigendian"
1794 if test $arch = "x86_32" -o $arch = "x86_64"; then
1795     echo "MMX enabled               $mmx"
1796     echo "CMOV enabled              $cmov"
1797     echo "CMOV is fast              $fast_cmov"
1798 fi
1799 if test $arch = "armv4l"; then

And there's this spot, but that is even further near the end...
1909 # special cases
1910 case "$arch" in
1911     x86_32|x86_64)
1912         echo "TARGET_ARCH_X86=yes" >> config.mak
1913         echo "#define ARCH_X86 1" >> $TMPH
1914         ;;
1915     powerpc)

But if you prefer to have the tests in one of those, I'll change the patch.

> And are you certain that this is correct for x86_64?  Is the check even needed
> there, what with all the extra registers?
Actually, I do not really know... I figured that because x86_64 is
backwards compatible
the registers are still there and the tests should still work. In the
worst case the tests would be unnecessary ofcourse... Prefer to remove
it and only add it when someone figures out how this works on x86_64?


-- 
With friendly regards,
Takis

vCard: http://www.issaris.org/pi.vcf
Public key: http://www.issaris.org/pi.key




More information about the ffmpeg-devel mailing list