[Ffmpeg-devel] Compiler error in latest CVS

Rich Felker dalias
Fri Mar 24 20:09:19 CET 2006


On Fri, Mar 24, 2006 at 01:53:48PM -0500, Isaac Richards wrote:
> On Friday 24 March 2006 13:27, Rich Felker wrote:
> > On Fri, Mar 24, 2006 at 12:10:00PM -0500, Isaac Richards wrote:
> > > On Friday 24 March 2006 11:11, Guillaume POIRIER wrote:
> > > > Hi,
> > > >
> > > > On 3/24/06, Kevin Kuphal <kuphal at dls.net> wrote:
> > > > > After the latest snow optimizations, I get this compiler error:
> > > > >
> > > > > i386/snowdsp_mmx.c: In function ?ff_snow_vertical_compose97i_sse2?:
> > > > > i386/snowdsp_mmx.c:490: error: PIC register ?%ebx? clobbered in ?asm?
> > > > > i386/snowdsp_mmx.c: In function ?ff_snow_vertical_compose97i_mmx?:
> > > > > i386/snowdsp_mmx.c:597: error: PIC register ?%ebx? clobbered in ?asm?
> > > > > make[2]: *** [snowdsp_mmx.o] Error 1
> > > > > make[2]: Leaving directory `/root/mythtv-svn/mythtv/libs/libavcodec'
> > > > > make[1]: *** [sub-libavcodec] Error 2
> > > > > make[1]: Leaving directory `/root/mythtv-svn/mythtv/libs'
> > > > > make: *** [sub-libs] Error 2
> > > > >
> > > > > gcc 4.0.1 on FC4.  It doesn't error on my gcc 3.2.2 system on RH9
> > > >
> > > > Looks like libavcodec can't be compiled as dynamic library with these
> > > > optimizations. Do you have a way to have MythTV user static version of
> > > > lavc?
> > >
> > > It's not the optimizations.  As the error message says, the code's
> > > clobbering ebx - everything else in libavcodec plays nice and doesn't.
> >
> > Clobbering ebx is completely valid, but gcc does not allow it when
> > compiling with -fPIC. Disable PIC and it will work fine. Better yet,
> > send a bug report to the gcc developers telling them they should just
> > reload ebx with the GOT address after asm if it happened to get
> > clobbered.
> 
> So, every other bit of asm code in ffmpeg is wrong, then, because it's either 
> been changed to explicitly not use ebx, or saves it before using it?

Do what I said and you'll see that it works. The other code has been
slowed down to accommodate PIC. Compiling lavc with PIC _WILL_ always
make it measurably slowe anyway, so you should not do this!

Rich





More information about the ffmpeg-devel mailing list