Hi Lorenz,
I see. I think for now I will add a macro declaration to the transform
line in Setup.in. When present Pygame will build with MMX disabled for
64 bit intels (the default). To enable MMX/SSE remove the declaration.
I have included a patch that makes the proposed changes to Pygame Rev
2452. config.py must be run first to reconfigure the build, and
transform.c touched to get it to recompile. After rebuilding,
pgyame.transform.get_smoothscale_backend() should return "GENERIC" (no
MMX/SSE). Deleting "-D_NO_MMX_FOR_X86_64" from the "Setup" file and
rebuilding transform.c should enable MMX again.
Lenard
Lorenz Quack wrote:
Hi,
I believe __x86_64__ is correct, but it is not only SDL_HasSSE but
also SDL_HasMMX that is causing trouble
because both (amongst others) internally call the SDL function
CPU_getCPUIDFeatures which is the culprit.
//Lorenz
Lenard Lindstrom wrote:
Didn't work? Then what C macro should be check to determine a 64 bit
build. I used __x86_64__ elsewhere, but it is apparently wrong.
Lenard
Lorenz Quack wrote:
Hi,
unfortunately Lenards patch didn't help. pygame would still crash.
But on the upside the RedHat patch did the trick. With the patched
libsdl the unpatched pygame trunk
it installs and imports without problems! Open source for the win :)
I also reported this bug to the gentoo bugtracker:
http://bugs.gentoo.org/show_bug.cgi?id=276092
Thanks again for the help guys.
//Lorenz
René Dudfield wrote:
Hi,
Looks like SDL_HasSSE is indeed buggy on SDL 64bit systems.
Seems redhat has a patch for it:
https://bugzilla.redhat.com/show_bug.cgi?id=487720
A patch is here:
http://cvs.fedoraproject.org/viewvc/rpms/SDL/devel/SDL-1.2.13-rh487720.patch?revision=1.1&view=markup
Also there is a patch in SDL 1.3 svn... which is no use to us since
we're still on SDL 1.2.x. Sam isn't doing another SDL 1.2.x release
for at least another few months.
I've added a bug with link to patch at the SDL bugzilla:
http://bugzilla.libsdl.org/show_bug.cgi?id=760
I think disabling it for now on 64bit systems, with a comment about
this problem is a good idea. Or perhaps putting an ifdef SDL version
1.2.13 would be ok too.
Index: src/scale.h
===================================================================
--- src/scale.h (revision 2452)
+++ src/scale.h (working copy)
@@ -29,7 +29,7 @@
#if !defined(SCALE_HEADER)
#define SCALE_HEADER
-#if (defined(__GNUC__) && (defined(__x86_64__) || defined(__i386__))) || defined(MS_WIN32)
+#if (defined(__GNUC__) && ((defined(__x86_64__) && !defined(_NO_MMX_FOR_X86_64)) || defined(__i386__))) || defined(MS_WIN32)
#define SCALE_MMX_SUPPORT
/* These functions implement an area-averaging shrinking filter in the X-dimension.
Index: Setup.in
===================================================================
--- Setup.in (revision 2452)
+++ Setup.in (working copy)
@@ -64,7 +64,7 @@
draw src/draw.c $(SDL) $(DEBUG)
image src/image.c $(SDL) $(DEBUG)
overlay src/overlay.c $(SDL) $(DEBUG)
-transform src/transform.c src/rotozoom.c src/scale2x.c src/scale_mmx.c $(SDL) $(DEBUG)
+transform src/transform.c src/rotozoom.c src/scale2x.c src/scale_mmx.c $(SDL) $(DEBUG) -D_NO_MMX_FOR_X86_64
mask src/mask.c src/bitmask.c $(SDL) $(DEBUG)
bufferproxy src/bufferproxy.c $(SDL) $(DEBUG)
pixelarray src/pixelarray.c $(SDL) $(DEBUG)