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

Panagiotis Issaris takis.issaris
Wed Mar 14 16:34:26 CET 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi

Michael Niedermayer schreef:
> On Wed, Mar 14, 2007 at 01:56:09PM +0100, Panagiotis Issaris wrote:
>> Michael Niedermayer schreef:
>>> On Thu, Mar 08, 2007 at 09:46:33PM +0100, Panagiotis Issaris wrote:
>>>> Michael Niedermayer schreef:
>>>>> On Thu, Mar 08, 2007 at 07:46:55PM +0100, Panagiotis Issaris wrote:
>>>>>> Michael Niedermayer schreef:
>>>>>>> On Thu, Mar 08, 2007 at 06:16:46PM +0100, Guillaume Poirier wrote:
>>>>>>>> Panagiotis Issaris wrote:
>>>>>>>>> When configuring FFmpeg revision 8295 (most recent SVN) to disable
>>>>>>>>> optimizations (for easier debugging), the cabac.c file fails to compile:
>>>>>>>>> "can't find a register in class ???GENERAL_REGS??? while reloading ???asm???"
>>>>>>>>>
>>>>>>>>> I've tried using several versions of GCC. Any tips on how to fix this?
>>>>>>>> [...]
>>>>>>> what would be correct is:
>>>>>>> #if defined(ARCH_X86) && defined(CONFIG_EBP) && defined(CONFIG_EBX)
>>>>>> What would CONFIG_EBP mean? Looking at the naming of the other CONFIG_*
>>>>>> options, I'd say it means the "EBP" and "EBX" "features" would be
>>>>>> enabled :) although it is quite unlikely EBP and EBX have other meanings
>>>>>> than the obvious (register names).
>>>>> yes CONFIG_EBP means that the EBP register is available
>>>>> with gcc this is the case if and only if -fomit-frame-pointer is used
>>>> This indeed fails to compile if -fomit-frame-pointer isn't used _if_
>>>> optimization is turned on:
>>>>
>>>> int main() { asm volatile ("" ::: "ebp"); }
>>>>
>>>> With -O0 or without -Ox flag (which is what is used when --enable-opts
>>>> is passed to configure) the testapp compiles fine in either case.
>>>>
>>>> So, with the flags used for the compilation of cabac.c, the testapp
>>>> compiles fine.
>>> compiles yes, works no
>>>
>>> try
>>> int main() {
>>>     volatile int i=0;
>>>     asm volatile (
>>>         "xorl %%ebp, %%ebp"
>>>     ::: "%ebp");
>>>     return i;
>>> }
>>>
>>> this will crash with -O0 and without -fomit-frame-pointer
>> Hmm. Yes, but this would mean I'd have to add a testcase which checks if
>> the above code crashes...
> 
> doesnt a simple check_exec or whatever it was in configure work
You are right, it already existed.

The attached patch defines CONFIG_EBP in config.h if EBP is available.

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

With friendly regards,
Takis
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFF+BYB9kOxLuzz4CkRAgUbAJ4xPABg1L1f+Wfd157hiZxTA1+CWwCfcfWZ
Dct1Ez51eqSigmQv/OvgUbE=
=20+4
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pi-20070314T162807-ffmpeg-ebp_available.diff
Type: text/x-patch
Size: 790 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070314/d6303ebd/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pi-20070314T162807-ffmpeg-ebp_available.diff.sig
Type: application/octet-stream
Size: 65 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070314/d6303ebd/attachment.obj>



More information about the ffmpeg-devel mailing list