Undefined reference to _MMX_~ in libSDL.so

Greetings,

When I try to compile test programs I get the following list of undefined
references:
/usr/local/sdl/sdl-1.2.7/lib/libSDL.so: undefined reference to
_MMX_UbluRGB' /usr/local/sdl/sdl-1.2.7/lib/libSDL.so: undefined reference to_MMX_Vred5x5’
/usr/local/sdl/sdl-1.2.7/lib/libSDL.so: undefined reference to
_MMX_VgrnRGB' /usr/local/sdl/sdl-1.2.7/lib/libSDL.so: undefined reference to_MMX_grn565’
/usr/local/sdl/sdl-1.2.7/lib/libSDL.so: undefined reference to
_MMX_VredRGB' /usr/local/sdl/sdl-1.2.7/lib/libSDL.so: undefined reference to_MMX_Vgrn565’
/usr/local/sdl/sdl-1.2.7/lib/libSDL.so: undefined reference to _MMX_FF00w' /usr/local/sdl/sdl-1.2.7/lib/libSDL.so: undefined reference to_MMX_Ugrn565’
/usr/local/sdl/sdl-1.2.7/lib/libSDL.so: undefined reference to _MMX_Ycoeff' /usr/local/sdl/sdl-1.2.7/lib/libSDL.so: undefined reference to_MMX_UgrnRGB’
/usr/local/sdl/sdl-1.2.7/lib/libSDL.so: undefined reference to _MMX_00FFw' /usr/local/sdl/sdl-1.2.7/lib/libSDL.so: undefined reference to_MMX_red565’
/usr/local/sdl/sdl-1.2.7/lib/libSDL.so: undefined reference to _MMX_0080w' /usr/local/sdl/sdl-1.2.7/lib/libSDL.so: undefined reference to_MMX_Ublu5x5’
collect2: ld returned 1 exit status

What might be the cause of this?
Best regards,
ChasW

Some background:
I am attempting to build SDL-1.2.7 for linux.
I am running kernel-2.6.6 and gcc-3.4.0.

In order to get sdl to successfully build with gcc-3.4.0, I had to apply
this patch…
Submitted By: Jeremy Utley (jeremy at linuxfromscratch.org)
Initial Package Version: 1.2.7
Upstream Status: Not submitted
Origin: jbit from LFS-IRC’s custom hacks
Description: fixes inline asm code for gcc 3.4 compilation

diff -aur SDL-1.2.7/src/audio/SDL_mixer_MMX.c
SDL-1.2.7-new/src/audio/SDL_mixer_MMX.c
— SDL-1.2.7/src/audio/SDL_mixer_MMX.c 2002-11-08 22:13:28.000000000 -0800
+++ SDL-1.2.7-new/src/audio/SDL_mixer_MMX.c 2004-04-11
06:27:06.765672328 -0700
@@ -14,7 +14,7 @@
void SDL_MixAudio_MMX_S16(char* dst,char* src,unsigned int size,int volume)
{
asm volatile (Date: 2004-04-11

+" pushl %%ebx\n" //XXX: Jbit hack
" movl %0,%%edi\n" // edi = dst
" movl %1,%%esi\n" // esi = src
" movl %3,%%eax\n" // eax = volume
@@ -102,10 +102,11 @@
" emms\n"
".endS16:\n"
+" popl %%ebx\n" //XXX: Jbit hack
:
: “m” (dst), “m”(src),“m”(size),
“m”(volume)

  • : “eax”,“ebx”, “esi”, “edi”,“memory”
  • : “eax”,“esi”, “edi”,“memory”
    );
    }
    @@ -119,6 +120,7 @@
    {
    asm volatile (
    +" pushl %%ebx\n" //XXX: Jbit hack
    " movl %0,%%edi\n" // edi = dst
    " movl %1,%%esi\n" // esi = src
    " movl %3,%%eax\n" // eax = volume
    @@ -175,10 +177,11 @@
    ".endS8:\n"
    " emms\n"
    +" popl %%ebx\n" //XXX: Jbit hack
    :
    : “m” (dst), “m”(src),“m”(size),
    “m”(volume)
  • : “eax”,“ebx”, “esi”, “edi”,“memory”
  • : “eax”,“esi”, “edi”,“memory”
    );
    }
    #endif
    diff -aur SDL-1.2.7/src/cpuinfo/SDL_cpuinfo.c
    SDL-1.2.7-new/src/cpuinfo/SDL_cpuinfo.c
    — SDL-1.2.7/src/cpuinfo/SDL_cpuinfo.c 2004-02-10 07:31:35.000000000 -0800
    +++ SDL-1.2.7-new/src/cpuinfo/SDL_cpuinfo.c 2004-04-11
    06:27:06.761672450 -0700
    @@ -105,6 +105,7 @@
    int features = 0;
    #if defined(GNUC) && defined(i386)
    asm (
    +" pushl %%ebx\n" //XXX: Jbit Hack
    " movl %%ebx,%%edi\n"
    " xorl %%eax,%%eax # Set up for CPUID instruction \n"
    " cpuid # Get and save vendor ID \n"
    @@ -116,9 +117,10 @@
    " movl %%edx,%0 \n"
    “1: \n”
    " movl %%edi,%%ebx\n"
    +" popl %%ebx\n" //XXX: Jbit Hack
    : “=m” (features)
    :
  • : “%eax”, “%ebx”, “%ecx”, “%edx”, “%edi”
  • : “%eax”, “%ecx”, “%edx”, “%edi”
    );
    #elif defined(_MSC_VER)
    __asm {
    @@ -141,6 +143,7 @@
    int features = 0;
    #if defined(GNUC) && defined(i386)
    asm (
    +" pushl %%ebx\n" //XXX: Jbit Hack
    " movl %%ebx,%%edi\n"
    " movl $0x80000000,%%eax # Query for extended functions \n"
    " cpuid # Get extended function limit \n"
    @@ -151,9 +154,10 @@
    " movl %%edx,%0 \n"
    “1: \n”
    " movl %%edi,%%ebx\n"
    +" popl %%ebx\n" //XXX: Jbit Hack
    : “=m” (features)
    :
  • : “%eax”, “%ebx”, “%ecx”, “%edx”, “%edi”
  • : “%eax”, “%ecx”, “%edx”, “%edi”
    );
    #elif defined(_MSC_VER)
    __asm {
    diff -aur SDL-1.2.7/src/video/SDL_yuv_mmx.c
    SDL-1.2.7-new/src/video/SDL_yuv_mmx.c
    — SDL-1.2.7/src/video/SDL_yuv_mmx.c 2004-02-18 09:22:04.000000000 -0800
    +++ SDL-1.2.7-new/src/video/SDL_yuv_mmx.c 2004-04-11
    06:27:06.763672389 -0700
    @@ -238,9 +238,7 @@
    “popl %%ebx\n”
    :
    : “m” (cr), “r”(cb),“r”(lum),
  • “r”(row1),“r”(cols),“r”(row2),“m”(x),“m”(y),“m”(mod)
  • : “%ebx”
  • );
  • “r”(row1),“r”(cols),“r”(row2),“m”(x),“m”(y),“m”(mod) );
    }
    void Color565DitherYV12MMX1X( int *colortab, Uint32 *rgb_2_pix,
    @@ -413,9 +411,7 @@
    “popl %%ebx\n”
    :
    :“m” (cr), “r”(cb),“r”(lum),
  • “r”(row1),“r”(cols),“r”(row2),“m”(x),“m”(y),“m”(mod)
  • : “%ebx”
  • );
  • “r”(row1),“r”(cols),“r”(row2),“m”(x),“m”(y),“m”(mod) );
    }
    #endif /* GCC i386 inline assembly */

2boxers wrote:

Greetings,

When I try to compile test programs I get the following list of undefined
references:
/usr/local/sdl/sdl-1.2.7/lib/libSDL.so: undefined reference to
_MMX_UbluRGB' /usr/local/sdl/sdl-1.2.7/lib/libSDL.so: undefined reference to_MMX_Vred5x5’
/usr/local/sdl/sdl-1.2.7/lib/libSDL.so: undefined reference to
_MMX_VgrnRGB' /usr/local/sdl/sdl-1.2.7/lib/libSDL.so: undefined reference to_MMX_grn565’
/usr/local/sdl/sdl-1.2.7/lib/libSDL.so: undefined reference to
_MMX_VredRGB' /usr/local/sdl/sdl-1.2.7/lib/libSDL.so: undefined reference to_MMX_Vgrn565’
/usr/local/sdl/sdl-1.2.7/lib/libSDL.so: undefined reference to _MMX_FF00w' /usr/local/sdl/sdl-1.2.7/lib/libSDL.so: undefined reference to_MMX_Ugrn565’
/usr/local/sdl/sdl-1.2.7/lib/libSDL.so: undefined reference to _MMX_Ycoeff' /usr/local/sdl/sdl-1.2.7/lib/libSDL.so: undefined reference to_MMX_UgrnRGB’
/usr/local/sdl/sdl-1.2.7/lib/libSDL.so: undefined reference to _MMX_00FFw' /usr/local/sdl/sdl-1.2.7/lib/libSDL.so: undefined reference to_MMX_red565’
/usr/local/sdl/sdl-1.2.7/lib/libSDL.so: undefined reference to _MMX_0080w' /usr/local/sdl/sdl-1.2.7/lib/libSDL.so: undefined reference to_MMX_Ublu5x5’
collect2: ld returned 1 exit status

What might be the cause of this?

Did you try SDL from cvs ? That should be fixed.

Stephane

2boxers wrote:

What might be the cause of this?

gcc-3.4.0

Did you try SDL from cvs ? That should be fixed.

yeah, cvs worked for me
-mikeOn Monday 24 May 2004 04:23 pm, Stephane Marchesin wrote:

2boxers wrote:

Greetings,

When I try to compile test programs I get the following list of undefined
references:
/usr/local/sdl/sdl-1.2.7/lib/libSDL.so: undefined reference to
_MMX_UbluRGB' /usr/local/sdl/sdl-1.2.7/lib/libSDL.so: undefined reference to_MMX_Vred5x5’
/usr/local/sdl/sdl-1.2.7/lib/libSDL.so: undefined reference to
_MMX_VgrnRGB' /usr/local/sdl/sdl-1.2.7/lib/libSDL.so: undefined reference to_MMX_grn565’
/usr/local/sdl/sdl-1.2.7/lib/libSDL.so: undefined reference to
_MMX_VredRGB' /usr/local/sdl/sdl-1.2.7/lib/libSDL.so: undefined reference to_MMX_Vgrn565’
/usr/local/sdl/sdl-1.2.7/lib/libSDL.so: undefined reference to _MMX_FF00w' /usr/local/sdl/sdl-1.2.7/lib/libSDL.so: undefined reference to_MMX_Ugrn565’
/usr/local/sdl/sdl-1.2.7/lib/libSDL.so: undefined reference to _MMX_Ycoeff' /usr/local/sdl/sdl-1.2.7/lib/libSDL.so: undefined reference to_MMX_UgrnRGB’
/usr/local/sdl/sdl-1.2.7/lib/libSDL.so: undefined reference to _MMX_00FFw' /usr/local/sdl/sdl-1.2.7/lib/libSDL.so: undefined reference to_MMX_red565’
/usr/local/sdl/sdl-1.2.7/lib/libSDL.so: undefined reference to _MMX_0080w' /usr/local/sdl/sdl-1.2.7/lib/libSDL.so: undefined reference to_MMX_Ublu5x5’
collect2: ld returned 1 exit status

What might be the cause of this?
Best regards,
ChasW

Dump my previous comment, cvs will probably fail too.
Could you try the attached patch (or even better, the attached patch on
top of the current cvs, if you can get it) ?

Stephane

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed…
Name: patch
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20040525/cce7d4b9/attachment.txt