Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 107815 - media-libs/sdl-mixer doesn't compile on Mac OS X
Summary: media-libs/sdl-mixer doesn't compile on Mac OS X
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: PPC OS X
: High normal (vote)
Assignee: Gentoo non-Linux Team
URL:
Whiteboard:
Keywords:
Depends on: 214565
Blocks: 107643 107873 107883 117802
  Show dependency tree
 
Reported: 2005-10-01 13:12 UTC by Fabian Groffen
Modified: 2009-03-15 19:24 UTC (History)
3 users (show)

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


Attachments
add the needed configure swithes to make it compile (sdl-mixer-1.2.6.ebuild.patch,410 bytes, patch)
2005-10-01 14:18 UTC, Dirk Schoenberger
Details | Diff
avoid missing symbols (libtool-macosx.patch,1.08 KB, patch)
2005-10-11 12:49 UTC, Dirk Schoenberger
Details | Diff
avoid missing symbols (2) (configure.patch,1.43 KB, patch)
2005-10-12 12:19 UTC, Dirk Schoenberger
Details | Diff
allow undefined symbols (sdl-mixer-1.2.6-r1.ebuild.patch,509 bytes, patch)
2005-10-12 13:40 UTC, Dirk Schoenberger
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fabian Groffen gentoo-dev 2005-10-01 13:12:14 UTC
media-libs/sdl-mixer-1.2.6 does not compile on OSX

sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < .libs/libSDL_mixer.exp >
.libs/libSDL_mixer-symbols.expsym
gcc -dynamiclib  -o .libs/libSDL_mixer-1.2.0.2.4.dylib  .libs/load_aiff.o
.libs/load_voc.o .libs/load_ogg.o .libs/mixer.o .libs/music.o .libs/music_cmd.o
.libs/music_ogg.o .libs/wavestream.o .libs/effect_position.o
.libs/effect_stereoreverse.o .libs/effects_internal.o 
.libs/libSDL_mixer.lax/libtimidity.a/common.o
.libs/libSDL_mixer.lax/libtimidity.a/controls.o
.libs/libSDL_mixer.lax/libtimidity.a/filter.o
.libs/libSDL_mixer.lax/libtimidity.a/instrum.o
.libs/libSDL_mixer.lax/libtimidity.a/mix.o
.libs/libSDL_mixer.lax/libtimidity.a/output.o
.libs/libSDL_mixer.lax/libtimidity.a/playmidi.o
.libs/libSDL_mixer.lax/libtimidity.a/readmidi.o
.libs/libSDL_mixer.lax/libtimidity.a/resample.o
.libs/libSDL_mixer.lax/libtimidity.a/sdl_a.o
.libs/libSDL_mixer.lax/libtimidity.a/sdl_c.o
.libs/libSDL_mixer.lax/libtimidity.a/tables.o
.libs/libSDL_mixer.lax/libtimidity.a/timidity.o 
.libs/libSDL_mixer.lax/libnativemidi.a/native_midi_common.o
.libs/libSDL_mixer.lax/libnativemidi.a/native_midi_mac.o
.libs/libSDL_mixer.lax/libnativemidi.a/native_midi_win32.o 
.libs/libSDL_mixer.lax/libsmpeg.a/bitwindow.o
.libs/libSDL_mixer.lax/libsmpeg.a/decoders.o
.libs/libSDL_mixer.lax/libsmpeg.a/filter.o
.libs/libSDL_mixer.lax/libsmpeg.a/filter_2.o
.libs/libSDL_mixer.lax/libsmpeg.a/floatdct.o
.libs/libSDL_mixer.lax/libsmpeg.a/gdith.o
.libs/libSDL_mixer.lax/libsmpeg.a/huffmantable.o
.libs/libSDL_mixer.lax/libsmpeg.a/jrevdct.o
.libs/libSDL_mixer.lax/libsmpeg.a/mmxflags_asm.o
.libs/libSDL_mixer.lax/libsmpeg.a/mmxidct_asm.o
.libs/libSDL_mixer.lax/libsmpeg.a/motionvector.o
.libs/libSDL_mixer.lax/libsmpeg.a/MPEG.o
.libs/libSDL_mixer.lax/libsmpeg.a/MPEGaudio.o
.libs/libSDL_mixer.lax/libsmpeg.a/MPEGfilter.o
.libs/libSDL_mixer.lax/libsmpeg.a/mpeglayer1.o
.libs/libSDL_mixer.lax/libsmpeg.a/mpeglayer2.o
.libs/libSDL_mixer.lax/libsmpeg.a/mpeglayer3.o
.libs/libSDL_mixer.lax/libsmpeg.a/MPEGlist.o
.libs/libSDL_mixer.lax/libsmpeg.a/MPEGring.o
.libs/libSDL_mixer.lax/libsmpeg.a/MPEGstream.o
.libs/libSDL_mixer.lax/libsmpeg.a/MPEGsystem.o
.libs/libSDL_mixer.lax/libsmpeg.a/mpegtable.o
.libs/libSDL_mixer.lax/libsmpeg.a/mpegtoraw.o
.libs/libSDL_mixer.lax/libsmpeg.a/MPEGvideo.o
.libs/libSDL_mixer.lax/libsmpeg.a/parseblock.o
.libs/libSDL_mixer.lax/libsmpeg.a/readfile.o
.libs/libSDL_mixer.lax/libsmpeg.a/smpeg.o
.libs/libSDL_mixer.lax/libsmpeg.a/util.o
.libs/libSDL_mixer.lax/libsmpeg.a/vhar128.o
.libs/libSDL_mixer.lax/libsmpeg.a/video.o   -framework QuickTime
/usr/lib/libvorbisfile.dylib /usr/lib/libm.dylib /usr/lib/libvorbis.dylib
/usr/lib/libogg.dylib -framework Cocoa -framework OpenGL -lSDLmain
/usr/lib/libSDL.dylib  -install_name  /usr/lib/libSDL_mixer-1.2.0.dylib
-Wl,-compatibility_version -Wl,3 -Wl,-current_version -Wl,3.4
ld: Undefined symbols:
__ZdaPv
__ZdlPv
__Znam
__Znwm
___cxa_pure_virtual
/usr/bin/libtool: internal link edit command failed
make[1]: *** [libSDL_mixer.la] Error 1
make: *** [all-recursive] Error 1

Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 Dirk Schoenberger 2005-10-01 14:17:01 UTC
A solution would be to ./configure with --enable-shared CFLAGS="-L/usr/lib/gcc/powerpc-apple-
darwin8/4.0.0/", like in the attached ebuild.patch
Comment 2 Dirk Schoenberger 2005-10-01 14:18:25 UTC
Created attachment 69658 [details, diff]
add the needed configure swithes to make it compile
Comment 3 SpanKY gentoo-dev 2005-10-09 12:16:05 UTC
Comment on attachment 69658 [details, diff]
add the needed configure swithes to make it compile

patch isnt acceptable
Comment 4 Dirk Schoenberger 2005-10-09 13:47:54 UTC
> (From update of attachment 69658 [details, diff] [edit])
> patch isnt acceptable

What's the problem?
Comment 5 Fabian Groffen gentoo-dev 2005-10-11 10:38:02 UTC
you'd at least need a conditional, because all other platforms wouldn't like the
include.  But then again, if the compiler gets an upgrade this doesn't work
anymore, so another solution needs to be found.
Comment 6 Dirk Schoenberger 2005-10-11 11:45:32 UTC
> you'd at least need a conditional, because all other platforms wouldn't like the
> include.  But then again, if the compiler gets an upgrade this doesn't work
> anymore, so another solution needs to be found.

Ok, the problematic part seems to be 
CFLAGS="-L/usr/lib/gcc/powerpc-apple-darwin8/4.0.0/"

Can this be extracted by some clever script from information given by gcc --version? This returns

powerpc-apple-darwin8-gcc-4.0.0 (GCC) 4.0.0 (Apple Computer, Inc. build 5026)
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


The basic problem seem to be that the linker needs to link against libgcc_s. On Tiger, somehow, exists 
a cross-compiling system, where multiple versions of this lib seem to exist. gcc seems to pickup the 
wrong (intel x86) version of the lib

locate libgcc_s.dylib returns  

/usr/lib/gcc/i686-apple-darwin8/4.0.0/libgcc_s.dylib
/usr/lib/gcc/powerpc-apple-darwin8/4.0.0/libgcc_s.dylib

on my system.
Comment 7 Kito (RETIRED) gentoo-dev 2005-10-11 11:55:43 UTC
LDFLAGS="-undefined dynamic_lookup" might be appropriate in this case....give it a try and see if it can 
find the symbols.
Comment 8 Fabian Groffen gentoo-dev 2005-10-11 12:26:23 UTC
your suggestion at least didn't work for me.

Considering the configure script, I'd also get the impression this is already
set for Tiger systems.
Comment 9 Dirk Schoenberger 2005-10-11 12:39:44 UTC
> your suggestion at least didn't work for me.

> Considering the configure script, I'd also get the impression this is already
> set for Tiger systems.

The flag somehow vanishes while building.
It kind of works if you explicitly add it somewhere in the shell script ./libtool.
If you do this, there are still some problem about an environment variable 
MACOSX_DEPLOYMENT_TARGET,
which is apparently set to 10.4. After manually set it to 10.4 I could at least compile it.

But I still don't really like the idea to patch around in the ./libtool script.
Comment 10 Fabian Groffen gentoo-dev 2005-10-11 12:43:43 UTC
portage sets the MACOSX_DEPLOYMENT_TARGET to 10.4 so that should be handled.
Comment 11 Dirk Schoenberger 2005-10-11 12:49:07 UTC
Created attachment 70400 [details, diff]
avoid missing symbols
Comment 12 Dirk Schoenberger 2005-10-11 12:50:52 UTC
> portage sets the MACOSX_DEPLOYMENT_TARGET to 10.4 so that should be handled.

I am not quite sure about howto correctly patch to make it useful for the ebuild.
Could you please check the "avoid missing symbols" patch?
Comment 13 SpanKY gentoo-dev 2005-10-11 16:37:54 UTC
Comment on attachment 70400 [details, diff]
avoid missing symbols 

libtool is generated by running `./configure`, it isnt in the tarball ...
Comment 14 Dirk Schoenberger 2005-10-12 12:18:54 UTC
> (From update of attachment 70400 [details, diff] [edit])
> libtool is generated by running `./configure`, it isnt in the tarball ...

So you have to patch configure, as in the attached patch (avoid missing symbols 2)
Comment 15 Dirk Schoenberger 2005-10-12 12:19:25 UTC
Created attachment 70482 [details, diff]
avoid missing symbols (2)
Comment 16 SpanKY gentoo-dev 2005-10-12 12:35:29 UTC
Comment on attachment 70482 [details, diff]
avoid missing symbols (2)

still doesnt make any sense

read the libtool code above your patch and you'll see that there's no reason to
hack in that flag ... there's logic already to conditionally add it, your
system is just not satisfying that condition and you should figure out why
Comment 17 Dirk Schoenberger 2005-10-12 13:39:26 UTC
> read the libtool code above your patch and you'll see that there's no reason to
> hack in that flag ... there's logic already to conditionally add it, your
> system is just not satisfying that condition and you should figure out why

looks like the problem is the -no-undefined flags in the Makefile.
If this is replaced by -allow-undefined, the ebuild works.
There is a deprecation warning, that this flag is the default (probably on Linux) and will be removed in the 
future.

I attach the needed patch to the ebuild file. Possibly you only need to change one of the Makefile.*, and 
possibly this should be made conditionally.
Comment 18 Dirk Schoenberger 2005-10-12 13:40:24 UTC
Created attachment 70491 [details, diff]
allow undefined symbols
Comment 19 Fabian Groffen gentoo-dev 2009-03-15 19:24:35 UTC
1.2.8 works and is keyworded