Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 48947 - Patch to make libsdl-1.2.7 compile and link with GCC 3.4
Summary: Patch to make libsdl-1.2.7 compile and link with GCC 3.4
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: x86 All
: High minor (vote)
Assignee: Please assign to toolchain
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 48528
  Show dependency tree
 
Reported: 2004-04-25 09:20 UTC by Arve Knudsen
Modified: 2004-05-15 23:16 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Make libsdl-1.2.7 compile/link with GCC 3.4 (gcc-3.4.patch,5.68 KB, patch)
2004-04-25 09:22 UTC, Arve Knudsen
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Arve Knudsen 2004-04-25 09:20:41 UTC
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.
Comment 1 Arve Knudsen 2004-04-25 09:22:40 UTC
Created attachment 30017 [details, diff]
Make libsdl-1.2.7 compile/link with GCC 3.4

Apply in directory containing SDL-1.2.7
Comment 2 Andrew Sayman 2004-04-28 03:59:03 UTC
I've also successfully used this patch to play Savage
Comment 3 Travis Tilley (RETIRED) gentoo-dev 2004-04-28 13:30:37 UTC
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.
Comment 4 JoWilly 2004-04-28 14:14:00 UTC
The patch works perfectly here on x86.
Comment 5 Robert Moss (RETIRED) gentoo-dev 2004-04-30 18:16:16 UTC
Just to note - this also works perfectly here on x86 too.
Comment 6 Srepfler Srgjan 2004-05-03 09:03:20 UTC
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?
Comment 7 SpanKY gentoo-dev 2004-05-03 10:25:55 UTC
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 ...
Comment 8 Arve Knudsen 2004-05-03 15:32:50 UTC
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?
Comment 9 Nicolas Laplante 2004-05-04 14:47:47 UTC
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:

epatch ${FILESDIR}/the_file.patch 

in the src_unpack() function.
Comment 10 SpanKY gentoo-dev 2004-05-05 17:50:01 UTC
yeah, you're right, i missed that bit :)

i'm talking with upstream devs to get it all integrated
Comment 11 SpanKY gentoo-dev 2004-05-15 23:16:59 UTC
ok, i added a patch that is partially yours and partially from upstream to cvs

upstream should have this added for their next release :)