[Ffmpeg-devel] Re: [PATCH] Fix compilation when using --disable-opts

Uoti Urpala uoti.urpala
Sun Apr 1 00:47:32 CEST 2007


On Sun, 2007-04-01 at 00:28 +0200, Alexis Ballier wrote:
> > Yes 7 registers are assumed on AMD64. And there will be 7 registers
> > available because there are more registers than on 32-bit so it doesn't
> > matter even if one is reserved.

> but :
> -#if defined(ARCH_X86_64) || (defined(ARCH_X86_32) &&
> defined(CONFIG_EBX_AVAILABLE) && defined(CONFIG_EBP_AVAILABLE))
> +#if (defined(ARCH_X86_64) || (defined(ARCH_X86_32) &&
> defined(CONFIG_EBX_AVAILABLE) && defined(CONFIG_EBP_AVAILABLE))) &&
> !defined(PIC)
>  #  define CONFIG_7REGS 1
>  #endif
> 
> compiles fine on x86_64 and also in my 32 bits chroot.

It might compile but that's because it ends up disabling the asm. That
does not mean the problem which prevented it from compiling before was
lack of free registers.

It would also compile if you replaced the whole program with "int
main(int argc, char *argv[]) {return 0;}" but that doesn't mean the
problem is failure to change the program to that.

> A possible fix would be to readd the hack that wouldnt use ebx with
> pic and __GNUC__ defined, but I dunno if this is wanted.

The problem that occurs on AMD64 is _not_ use of ebx with PIC.

> As I see I haven't answered to your first question about how we build
> pic libs on x86_32 :
>     # Make it use pic always since we don't need textrels
>     sed -i -e "s:LIBOBJFLAGS=\"\":LIBOBJFLAGS=\'\$\(PIC\)\':" configure

I think the problem on 32-bit is that configure ignores LIBOBJFLAGS when
testing register availability.

Btw that comment seems wrong/weird - other systems do not "need"
textrels any more than Gentoo, they use them because the PIC version is
slow on x86 (and PIC does cause the same slowdown on Gentoo too, so you
don't "need" them only if you don't need performance).





More information about the ffmpeg-devel mailing list