[MPlayer-dev-eng] [PATCH] -fPIC support for libswscale

Jason Tackaberry tack at urandom.ca
Sat Aug 12 19:18:02 CEST 2006


On Sat, 2006-08-12 at 18:43 +0200, Michael Niedermayer wrote:
> "m" are accessed via esp (the stack pointer) if -fomit-frame-pointer
> is used, push/pop put and remove stuff from the stack, to do that they
> increase and decrease esp ...

I see.  I worked around this by using a separate memory operand to save
ebx.  I suppose it's a big ugly, but if there's a better way, please let
me know.

> > Will you accept a patch that builds with -fno-PIC or -fPIC
> > -fomit-frame-pointer but not -fPIC (without -fomit-frame-pointer)?  The
> > problem is with -fPIC and not -fomit-frame-pointer we have too few free
> > registers and would require far more mutilation of libswscale than
> > anyone would be willing to accept.
> 
> ok

Ok, attached is a new patch.

I've tested this with gcc 2.95, 3.2.3, and 4.0.2, with -fPIC
-fomit-frame-pointer, -fno-PIC, and -fno-PIC -fomit-frame-pointer on x86
and x86_64.  Using -vo png, the md5sums of the resulting PNGs are the
same with or without this patch.

Where I wasn't able to use a different register and had to save ebx, I
enclosed that code with #if defined(PIC), so in the case of -fno-PIC
things will be roughly the same as they are without the patch.

Cheers,
Jason.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libswscale-fpic.patch
Type: text/x-patch
Size: 20766 bytes
Desc: 
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20060812/43188488/attachment.bin>


More information about the MPlayer-dev-eng mailing list