[SDL] gcc-3.4.0 / PIC fix
Mike Frysinger
vapier at gentoo.org
Mon May 3 13:42:02 PDT 2004
On Monday 03 May 2004 04:08 pm, Stephane Marchesin wrote:
> >src/video/SDL_yuv_mmx.c
> > this one claims ebx gets clobbered yet the asm saves/restores it ?
> > removing it from the clobber list 'fixes' the problem since in reality it
> > isn't clobbered ...
>
> I don't like push/pops too much, but I see no other way. Using push/pop
> means you have to be sure you can touch the stack which is not always
> the case (for example with inlined functions).
>
> >src/cpuinfo/SDL_cpuinfo.c
> > perhaps remove ebx from the clobber list and push/pop it in the same
> > manner as SDL_yuv_mmx.c ?
>
> We can simply remove ebx from the clobber list, since it's already saved
> and restored.
mmm are we confusing SDL_cpuinfo.c and SDL_yuv_mmx.c ?
the yuv_mmx code pushes/pops ebx so that bit can just trim the edx register
from the clobber list, but the cpuinfo code doesnt ... it just calls cpuid
which clobbers e[abcd]x ... and like you say, there doesnt seem to be any way
around this other than using push/pops :/
after rebuilding 1.2.7, SDL apps get angry with the _MMX_????? stuff:
/usr/lib/libSDL.so: undefined reference to `_MMX_UbluRGB'
/usr/lib/libSDL.so: undefined reference to `_MMX_Vred5x5'
/usr/lib/libSDL.so: undefined reference to `_MMX_VgrnRGB'
/usr/lib/libSDL.so: undefined reference to `_MMX_grn565'
the patch below fixes up the asm code in SDL_yuv_mmx.c ... basically changes
_MMX_VredRGB to %[_MMX_VredRGB] and adds [_MMX_VredRGB] "m" (*_MMX_VredRGB)
definitions at the end ... havent had a chance to test it with gcc-3.3 though
also, i forgot to mention in my original e-mail the original bug report/patch:
bug: http://bugs.gentoo.org/show_bug.cgi?id=48947
patch: http://bugs.gentoo.org/attachment.cgi?id=30017
-mike
More information about the SDL
mailing list