[Ffmpeg-devel] [BUG] Compilation failure when using --disable-opts
Thu Mar 8 20:18:57 CET 2007
On Thu, Mar 08, 2007 at 07:46:55PM +0100, Panagiotis Issaris wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 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).
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
CONFIG_EBX means that the EBX register is available
with gcc this is the case if and only if PIC is not used
simply trying to compile a dummy volatile asm(:::"%ebx"); / ebp
in configure can be used to set them
> 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.
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
The educated differ from the uneducated as much as the living from the
dead. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: not available
More information about the ffmpeg-devel