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

Panagiotis Issaris takis
Wed Mar 14 21:32:51 CET 2007


Hi M?ns,

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.
>>
>>  configure |   16 ++++++++++++++++
>>  1 file changed, 16 insertions(+)
>>
>> With friendly regards,
>> Takis
>> Index: configure
>> ===================================================================
>> --- configure	(revision 8405)
>> +++ configure	(working copy)
>> @@ -1390,6 +1390,18 @@
>>      die "C compiler test failed."
>>  fi
>>  
>> +# check whether EBP is available
>> +ebp_available=no
>> +check_exec <<EOF && ebp_available=yes
> 
> check_exec <<EOF && enable ebp_available
Done.

>> +int main(){
>> +    volatile int i=0;
>> +    asm volatile (
>> +        "xorl %%ebp, %%ebp"
>> +    ::: "%ebp");
>> +    return i;
>> +}
>> +EOF
> 
> All of the above should be conditional on x86 target.  
Done.

> 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.

>> @@ -1960,6 +1972,10 @@
>>    echo "#define CONFIG_SMALL 1" >> $TMPH
>>  fi
>>  
>> +if enabled ebp_available; then
>> +  echo "#define CONFIG_EBP 1" >> $TMPH
>> +fi
> 
> Add ebp_available to CONFIG_LIST instead.
Done.

Updated patch attached.

 configure |   15 +++++++++++++++
 1 file changed, 15 insertions(+)


-- 
With friendly regards,
Takis

vCard: http://www.issaris.org/pi.vcf
Public key: http://www.issaris.org/pi.key
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pi-20070314T212230-ffmpeg-ebp_available2.diff
Type: text/x-patch
Size: 679 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070314/1c7e4c62/attachment.bin>



More information about the ffmpeg-devel mailing list