Unpatched libsdl-1.2.7 contains assembly code which isn't entirely compatible with GCC 3.4, ie. GCC will complain the PID register (ebx) is clobbered, and static variables are only referenced directly in inline asm; causing GCC to omit them from object code. The patched library is tested with neverball and UT2004, but no guarantees.
Created attachment 30017 [details, diff]
Make libsdl-1.2.7 compile/link with GCC 3.4
Apply in directory containing SDL-1.2.7
I've also successfully used this patch to play Savage
can somebody on x86 take a look at this? i'm on amd64 and libsdl works perfectly, since we're not hitting this particular bit of assembly.
The patch works perfectly here on x86.
Just to note - this also works perfectly here on x86 too.
What's the procedure? Download patch in distfiles and apply the patch? How? Doesn't that change the md5 signature, how does portage let you continue the install?
SDL-1.2.7/src/audio/SDL_mixer_MMX.c and SDL-1.2.7/src/video/SDL_yuv_mmx.c looks good ... i'll send these upstream
however, SDL-1.2.7/src/cpuinfo/SDL_cpuinfo.c doesnt look so good ...
i notice you remove %ebx from the clobber list yet ebx is still used in the inline asm code ...
The reason for removing ebx from the clobber list is that, unless I'm mistaken, it is restored at the end of the asm block (ie. movl %%ebx, %%edi at the beginning of the block and movl %%edi, %%ebx at the end), so it should equal the recommended pushl/popl combo?
To Srepfler Srgjan:
To make the patch apply, just put the patch in /usr/portage/media-libs/libsdl/files and edit the build to add:
in the src_unpack() function.
yeah, you're right, i missed that bit :)
i'm talking with upstream devs to get it all integrated
ok, i added a patch that is partially yours and partially from upstream to cvs
upstream should have this added for their next release :)