[SDL] gcc-3.4.0 / PIC fix

Stephane Marchesin stephane.marchesin at wanadoo.fr
Mon May 3 13:11:21 PDT 2004


Mike Frysinger wrote:

>when building with -fPIC and gcc-3.4.0, a few files fail to compile
>
>src/audio/SDL_mixer_MMX.c
> this one is easy to fix ... find patch attached
>
Your patch is fine, but I added some x86_64 support that I had lying in 
my SDL tree (and it makes the code shorter and cleaner anyway).

>
>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.

A modified patch is attached, tested with gcc 3.3.1 and 2.96. Could you 
report if this works with 3.4.0 please (it seems it's not yet packaged 
by my distro) ?

Stephane

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: gcc-3.4-pic2.patch
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20040503/8ccdc1b3/attachment.asc>


More information about the SDL mailing list