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

Panagiotis Issaris takis
Thu Mar 8 19:46:55 CET 2007


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

Hi

Michael Niedermayer schreef:
> Hi
> 
> On Thu, Mar 08, 2007 at 06:16:46PM +0100, Guillaume Poirier wrote:
>> Hi,
>>
>> Panagiotis Issaris wrote:
>>> Hi,
>>>
>>> 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?
>>
>> It's smth I somewhat have very low on my todo list, if case you wanna
>> takle this issue, here's what I think can be done:
>> Make configure set in config.h a define whenever any of these are
>> passed to configure:
>> --enable-gprof, --enable-debug or --disable-opts
>>
>>
>> patch cabac.h as follows (syntax is probably wrong, but you'll get the
>> idea):
>>
>> Index: cabac.h
>> ===================================================================
>> --- cabac.h     (revision 8282)
>> +++ cabac.h     (working copy)
>> @@ -376,7 +376,7 @@
>>  #define BYTE        "16"
>>  #define BYTEEND     "20"
>>  #endif
>> -#if defined(ARCH_X86) && !(defined(PIC) && defined(__GNUC__))
>> +#if defined(ARCH_X86) && !(defined(PIC) && !(CONFIG_GPROF) &&
>> !(CONFIG_NO_OPTS) && !(CONFIG_DEBUG) && defined(__GNUC__))
>>      int bit;
>>
>>  #ifndef BRANCHLESS_CABAC_DECODER
>>
>>
>> This should take care of these recurrent compilation issues.
>> It's not pretty, but it should work.
>>
>>
>> Michael, what do you think about this?
> 
> its conceptually completely wrong, its not that the code cannot work with
> PIC and not with a profiler and not with a debuger and depends on gcc
> its not even true that it cannot work with all future gcc versions and
> PIC ...
> 
> 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).

I've attached a patch which just disables the asm code in case of
- --disable-opts usage, which works for me. Probably not good enough for
SVN, but other people might be happy to be able to use the patch to
debug FFmpeg code.

 configure          |    2 ++
 libavcodec/cabac.h |    4 ++--
 libavcodec/h264.c  |    2 +-
 3 files changed, 5 insertions(+), 3 deletions(-)

With friendly regards,
Takis

- --
vCard: http://www.issaris.org/pi.vcf
Public key: http://www.issaris.org/pi.key
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFF8Fof9kOxLuzz4CkRAsYgAJ4yNIZeqfwv1AaASRNO7rZe9ZEI+QCZAVxS
POR+qA4UgtcXXXrRHgq8WUQ=
=XNJF
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pi-20070308T193638-ffmpeg-disable_opts_fix.diff
Type: text/x-patch
Size: 2271 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070308/d4c1aea8/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pi-20070308T193638-ffmpeg-disable_opts_fix.diff.sig
Type: application/octet-stream
Size: 64 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070308/d4c1aea8/attachment.obj>



More information about the ffmpeg-devel mailing list