Opened 11 years ago

Closed 10 years ago

#22754 closed defect (fixed)

libsdl fails to build for x86_64 on 10.5

Reported by: keinstein_junior@… Owned by: jmroot (Joshua Root)
Priority: Normal Milestone:
Component: ports Version: 1.8.1
Keywords: Cc:
Port: libsdl

Description (last modified by skymoo (Adam Mercer))

Hi,

I have configured MacPorts to build binaries for x86_64 on my MacOS X 10.5 platform.

Trying to compile libsdl I get the following error message:

NALP17:bin root# port install libsdl
--->  Computing dependencies for libsdl
--->  Fetching libsdl
--->  Verifying checksum(s) for libsdl
--->  Extracting libsdl
--->  Applying patches to libsdl
--->  Configuring libsdl
--->  Building libsdl
Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_libsdl/work/SDL-1.2.14" && /usr/bin/nice -n 10 /usr/bin/make -j4 all " returned error 2
Command output: libtool: compile:  /usr/bin/gcc-4.0 -pipe -O2 -arch x86_64 -I/opt/local/include -I./include -D_GNU_SOURCE=1 -DTARGET_API_MAC_CARBON -DTARGET_API_MAC_OSX -fvisibility=hidden -I/opt/local/include -DXTHREADS -D_THREAD_SAFE -force_cpusubtype_ALL -fpascal-strings -c ./src/audio/SDL_mixer.c  -fno-common -DPIC -o build/.libs/SDL_mixer.o
/bin/sh ./libtool --mode=compile /usr/bin/gcc-4.0 -pipe -O2 -arch x86_64 -I/opt/local/include -I./include -D_GNU_SOURCE=1 -DTARGET_API_MAC_CARBON -DTARGET_API_MAC_OSX -fvisibility=hidden  -I/opt/local/include -DXTHREADS -D_THREAD_SAFE -force_cpusubtype_ALL -fpascal-strings -c ./src/audio/SDL_mixer_MMX.c  -o build/SDL_mixer_MMX.lo
libtool: compile:  /usr/bin/gcc-4.0 -pipe -O2 -arch x86_64 -I/opt/local/include -I./include -D_GNU_SOURCE=1 -DTARGET_API_MAC_CARBON -DTARGET_API_MAC_OSX -fvisibility=hidden -I/opt/local/include -DXTHREADS -D_THREAD_SAFE -force_cpusubtype_ALL -fpascal-strings -c ./src/audio/SDL_mixer_MMX.c  -fno-common -DPIC -o build/.libs/SDL_mixer_MMX.o
libtool: compile:  /usr/bin/gcc-4.0 -pipe -O2 -arch x86_64 -I/opt/local/include -I./include -D_GNU_SOURCE=1 -DTARGET_API_MAC_CARBON -DTARGET_API_MAC_OSX -fvisibility=hidden -I/opt/local/include -DXTHREADS -D_THREAD_SAFE -force_cpusubtype_ALL -fpascal-strings -c ./src/audio/SDL_mixer.c -o build/SDL_mixer.o >/dev/null 2>&1
libtool: compile:  /usr/bin/gcc-4.0 -pipe -O2 -arch x86_64 -I/opt/local/include -I./include -D_GNU_SOURCE=1 -DTARGET_API_MAC_CARBON -DTARGET_API_MAC_OSX -fvisibility=hidden -I/opt/local/include -DXTHREADS -D_THREAD_SAFE -force_cpusubtype_ALL -fpascal-strings -c ./src/audio/SDL_mixer_MMX.c -o build/SDL_mixer_MMX.o >/dev/null 2>&1
/bin/sh ./libtool --mode=compile /usr/bin/gcc-4.0 -pipe -O2 -arch x86_64 -I/opt/local/include -I./include -D_GNU_SOURCE=1 -DTARGET_API_MAC_CARBON -DTARGET_API_MAC_OSX -fvisibility=hidden  -I/opt/local/include -DXTHREADS -D_THREAD_SAFE -force_cpusubtype_ALL -fpascal-strings -c ./src/audio/SDL_mixer_MMX_VC.c  -o build/SDL_mixer_MMX_VC.lo
/bin/sh ./libtool --mode=compile /usr/bin/gcc-4.0 -pipe -O2 -arch x86_64 -I/opt/local/include -I./include -D_GNU_SOURCE=1 -DTARGET_API_MAC_CARBON -DTARGET_API_MAC_OSX -fvisibility=hidden  -I/opt/local/include -DXTHREADS -D_THREAD_SAFE -force_cpusubtype_ALL -fpascal-strings -c ./src/audio/SDL_mixer_m68k.c  -o build/SDL_mixer_m68k.lo
libtool: compile:  /usr/bin/gcc-4.0 -pipe -O2 -arch x86_64 -I/opt/local/include -I./include -D_GNU_SOURCE=1 -DTARGET_API_MAC_CARBON -DTARGET_API_MAC_OSX -fvisibility=hidden -I/opt/local/include -DXTHREADS -D_THREAD_SAFE -force_cpusubtype_ALL -fpascal-strings -c ./src/audio/SDL_mixer_MMX_VC.c  -fno-common -DPIC -o build/.libs/SDL_mixer_MMX_VC.o
libtool: compile:  /usr/bin/gcc-4.0 -pipe -O2 -arch x86_64 -I/opt/local/include -I./include -D_GNU_SOURCE=1 -DTARGET_API_MAC_CARBON -DTARGET_API_MAC_OSX -fvisibility=hidden -I/opt/local/include -DXTHREADS -D_THREAD_SAFE -force_cpusubtype_ALL -fpascal-strings -c ./src/audio/SDL_mixer_MMX_VC.c -o build/SDL_mixer_MMX_VC.o >/dev/null 2>&1
libtool: compile:  /usr/bin/gcc-4.0 -pipe -O2 -arch x86_64 -I/opt/local/include -I./include -D_GNU_SOURCE=1 -DTARGET_API_MAC_CARBON -DTARGET_API_MAC_OSX -fvisibility=hidden -I/opt/local/include -DXTHREADS -D_THREAD_SAFE -force_cpusubtype_ALL -fpascal-strings -c ./src/audio/SDL_mixer_m68k.c  -fno-common -DPIC -o build/.libs/SDL_mixer_m68k.o
libtool: compile:  /usr/bin/gcc-4.0 -pipe -O2 -arch x86_64 -I/opt/local/include -I./include -D_GNU_SOURCE=1 -DTARGET_API_MAC_CARBON -DTARGET_API_MAC_OSX -fvisibility=hidden -I/opt/local/include -DXTHREADS -D_THREAD_SAFE -force_cpusubtype_ALL -fpascal-strings -c ./src/audio/SDL_mixer_m68k.c -o build/SDL_mixer_m68k.o >/dev/null 2>&1
/bin/sh ./libtool --mode=compile /usr/bin/gcc-4.0 -pipe -O2 -arch x86_64 -I/opt/local/include -I./include -D_GNU_SOURCE=1 -DTARGET_API_MAC_CARBON -DTARGET_API_MAC_OSX -fvisibility=hidden  -I/opt/local/include -DXTHREADS -D_THREAD_SAFE -force_cpusubtype_ALL -fpascal-strings -c ./src/audio/SDL_wave.c  -o build/SDL_wave.lo
/bin/sh ./libtool --mode=compile /usr/bin/gcc-4.0 -pipe -O2 -arch x86_64 -I/opt/local/include -I./include -D_GNU_SOURCE=1 -DTARGET_API_MAC_CARBON -DTARGET_API_MAC_OSX -fvisibility=hidden  -I/opt/local/include -DXTHREADS -D_THREAD_SAFE -force_cpusubtype_ALL -fpascal-strings -c ./src/cdrom/SDL_cdrom.c  -o build/SDL_cdrom.lo
/bin/sh ./libtool --mode=compile /usr/bin/gcc-4.0 -pipe -O2 -arch x86_64 -I/opt/local/include -I./include -D_GNU_SOURCE=1 -DTARGET_API_MAC_CARBON -DTARGET_API_MAC_OSX -fvisibility=hidden  -I/opt/local/include -DXTHREADS -D_THREAD_SAFE -force_cpusubtype_ALL -fpascal-strings -c ./src/cpuinfo/SDL_cpuinfo.c  -o build/SDL_cpuinfo.lo
libtool: compile:  /usr/bin/gcc-4.0 -pipe -O2 -arch x86_64 -I/opt/local/include -I./include -D_GNU_SOURCE=1 -DTARGET_API_MAC_CARBON -DTARGET_API_MAC_OSX -fvisibility=hidden -I/opt/local/include -DXTHREADS -D_THREAD_SAFE -force_cpusubtype_ALL -fpascal-strings -c ./src/cdrom/SDL_cdrom.c  -fno-common -DPIC -o build/.libs/SDL_cdrom.o
libtool: compile:  /usr/bin/gcc-4.0 -pipe -O2 -arch x86_64 -I/opt/local/include -I./include -D_GNU_SOURCE=1 -DTARGET_API_MAC_CARBON -DTARGET_API_MAC_OSX -fvisibility=hidden -I/opt/local/include -DXTHREADS -D_THREAD_SAFE -force_cpusubtype_ALL -fpascal-strings -c ./src/audio/SDL_wave.c  -fno-common -DPIC -o build/.libs/SDL_wave.o
libtool: compile:  /usr/bin/gcc-4.0 -pipe -O2 -arch x86_64 -I/opt/local/include -I./include -D_GNU_SOURCE=1 -DTARGET_API_MAC_CARBON -DTARGET_API_MAC_OSX -fvisibility=hidden -I/opt/local/include -DXTHREADS -D_THREAD_SAFE -force_cpusubtype_ALL -fpascal-strings -c ./src/cpuinfo/SDL_cpuinfo.c  -fno-common -DPIC -o build/.libs/SDL_cpuinfo.o
./src/cpuinfo/SDL_cpuinfo.c: In function 'SDL_GetCPUFeatures':
./src/cpuinfo/SDL_cpuinfo.c:167: error: PIC register '%rbx' clobbered in 'asm'
./src/cpuinfo/SDL_cpuinfo.c:167: error: PIC register '%rbx' clobbered in 'asm'
./src/cpuinfo/SDL_cpuinfo.c:236: error: PIC register '%rbx' clobbered in 'asm'
./src/cpuinfo/SDL_cpuinfo.c:236: error: PIC register '%rbx' clobbered in 'asm'
./src/cpuinfo/SDL_cpuinfo.c:236: error: PIC register '%rbx' clobbered in 'asm'
./src/cpuinfo/SDL_cpuinfo.c:167: error: PIC register '%rbx' clobbered in 'asm'
./src/cpuinfo/SDL_cpuinfo.c:167: error: PIC register '%rbx' clobbered in 'asm'
make: *** [build/SDL_cpuinfo.lo] Error 1
make: *** Waiting for unfinished jobs....
libtool: compile:  /usr/bin/gcc-4.0 -pipe -O2 -arch x86_64 -I/opt/local/include -I./include -D_GNU_SOURCE=1 -DTARGET_API_MAC_CARBON -DTARGET_API_MAC_OSX -fvisibility=hidden -I/opt/local/include -DXTHREADS -D_THREAD_SAFE -force_cpusubtype_ALL -fpascal-strings -c ./src/cdrom/SDL_cdrom.c -o build/SDL_cdrom.o >/dev/null 2>&1
libtool: compile:  /usr/bin/gcc-4.0 -pipe -O2 -arch x86_64 -I/opt/local/include -I./include -D_GNU_SOURCE=1 -DTARGET_API_MAC_CARBON -DTARGET_API_MAC_OSX -fvisibility=hidden -I/opt/local/include -DXTHREADS -D_THREAD_SAFE -force_cpusubtype_ALL -fpascal-strings -c ./src/audio/SDL_wave.c -o build/SDL_wave.o >/dev/null 2>&1
libtool: compile:  /usr/bin/gcc-4.0 -pipe -O2 -arch x86_64 -I/opt/local/include -I./include -D_GNU_SOURCE=1 -DTARGET_API_MAC_CARBON -DTARGET_API_MAC_OSX -fvisibility=hidden -I/opt/local/include -DXTHREADS -D_THREAD_SAFE -force_cpusubtype_ALL -fpascal-strings -c ./src/audio/SDL_audiocvt.c -o build/SDL_audiocvt.o >/dev/null 2>&1

Error: Status 1 encountered during processing.
NALP17:bin root#

Change History (7)

comment:1 Changed 11 years ago by skymoo (Adam Mercer)

Description: modified (diff)
Owner: changed from macports-tickets@… to nox@…
Priority: HighNormal

comment:2 Changed 11 years ago by jmroot (Joshua Root)

Have you selfupdated recently? What's the version shown by port info libsdl?

comment:3 Changed 11 years ago by nox@…

Resolution: worksforme
Status: newclosed

I think you ports tree is outdated, run sudo port selfupdate and try again

comment:4 Changed 10 years ago by tingfan@…

libsdl @1.2.14, Revision 9 (devel, multimedia) Compiling with +universal, latest ports

Solution is to use gcc4.2 rather than gcc4.0 (system default)

port install libsdl configure.compiler=gcc-4.2

comment:5 Changed 10 years ago by daniel.hornung@…

Resolution: worksforme
Status: closedreopened

I don't think that this is fixed yet, even with a completely selfupdated tree. As with the OP, this bug occured for me when changing to +universal with universal_archs set to "i386 x86_64" (on OS X 10.5 here).

I found that apart from setting the compiler to gcc-4.2, applying the patch from here

http://www.mail-archive.com/fink-users@lists.sourceforge.net/msg31222.html

made it compile again. This patch from Fink's repo may also work:

http://fink.cvs.sourceforge.net/viewvc/fink/dists/10.4/unstable/main/finkinfo/games/sdl.patch?revision=1.12&view=markup

comment:6 Changed 10 years ago by jmroot (Joshua Root)

Owner: changed from nox@… to jmr@…
Status: reopenednew
Summary: libsdl fails to buildlibsdl fails to build for x86_64 on 10.5

comment:7 Changed 10 years ago by jmroot (Joshua Root)

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.