Summary: | media-sound/fluidsynth-1.0.8 won't cross-compile (libtool confused by presence of *.la files in SYSROOT) | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Rupert Mazzucco <rmaz> |
Component: | Current packages | Assignee: | Gentoo Sound Team <sound> |
Status: | RESOLVED CANTFIX | ||
Severity: | normal | CC: | aballier |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | x86 | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | /var/tmp/portage/media-sound/fluidsynth-1.0.8/temp/build.log |
Description
Rupert Mazzucco
2008-09-05 23:21:30 UTC
Created attachment 164664 [details]
/var/tmp/portage/media-sound/fluidsynth-1.0.8/temp/build.log
/bin/sh ../libtool --tag=CC --mode=link i486-pc-linux-uclibc-gcc -march=c3 -mmmx -m3dnow -O3 -fomit-frame-pointer -ffast-math -DNDEBUG -pipe -Wall -O2 -fomit-frame-pointer -funroll-all-loops -finline-functions -Wall -W -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wstrict-prototypes -Wno-unused -Winline -version-info 2:2:1 -export-dynamic -Wl,-O1 -o libfluidsynth.la -rpath /usr/lib libfluidsynth_la-fluid_alsa.lo libfluidsynth_la-fluid_jack.lo libfluidsynth_la-fluid_adriver.lo libfluidsynth_la-fluid_chan.lo libfluidsynth_la-fluid_chorus.lo libfluidsynth_la-fluid_cmd.lo libfluidsynth_la-fluid_conv.lo libfluidsynth_la-fluid_defsfont.lo libfluidsynth_la-fluid_dsp_float.lo libfluidsynth_la-fluid_event.lo libfluidsynth_la-fluid_gen.lo libfluidsynth_la-fluid_hash.lo libfluidsynth_la-fluid_io.lo libfluidsynth_la-fluid_ladspa.lo libfluidsynth_la-fluid_list.lo libfluidsynth_la-fluid_mdriver.lo libfluidsynth_la-fluid_midi.lo libfluidsynth_la-fluid_midi_router.lo libfluidsynth_la-fluid_midishare.lo libfluidsynth_la-fluid_mod.lo libfluidsynth_la-fluid_ramsfont.lo libfluidsynth_la-fluid_rev.lo libfluidsynth_la-fluid_seqbind.lo libfluidsynth_la-fluid_seq.lo libfluidsynth_la-fluid_settings.lo libfluidsynth_la-fluid_synth.lo libfluidsynth_la-fluid_sys.lo libfluidsynth_la-fluid_tuning.lo libfluidsynth_la-fluid_voice.lo libfluidsynth_la-fluid_aufile.lo -lm -lreadline -lncurses -ljack -lpthread -lasound -lpthread i486-pc-linux-uclibc-gcc -shared .libs/libfluidsynth_la-fluid_alsa.o .libs/libfluidsynth_la-fluid_jack.o .libs/libfluidsynth_la-fluid_adriver.o .libs/libfluidsynth_la-fluid_chan.o .libs/libfluidsynth_la-fluid_chorus.o .libs/libfluidsynth_la-fluid_cmd.o .libs/libfluidsynth_la-fluid_conv.o .libs/libfluidsynth_la-fluid_defsfont.o .libs/libfluidsynth_la-fluid_dsp_float.o .libs/libfluidsynth_la-fluid_event.o .libs/libfluidsynth_la-fluid_gen.o .libs/libfluidsynth_la-fluid_hash.o .libs/libfluidsynth_la-fluid_io.o .libs/libfluidsynth_la-fluid_ladspa.o .libs/libfluidsynth_la-fluid_list.o .libs/libfluidsynth_la-fluid_mdriver.o .libs/libfluidsynth_la-fluid_midi.o .libs/libfluidsynth_la-fluid_midi_router.o .libs/libfluidsynth_la-fluid_midishare.o .libs/libfluidsynth_la-fluid_mod.o .libs/libfluidsynth_la-fluid_ramsfont.o .libs/libfluidsynth_la-fluid_rev.o .libs/libfluidsynth_la-fluid_seqbind.o .libs/libfluidsynth_la-fluid_seq.o .libs/libfluidsynth_la-fluid_settings.o .libs/libfluidsynth_la-fluid_synth.o .libs/libfluidsynth_la-fluid_sys.o .libs/libfluidsynth_la-fluid_tuning.o .libs/libfluidsynth_la-fluid_voice.o .libs/libfluidsynth_la-fluid_aufile.o -lm -lreadline -lncurses /usr/lib/libjack.so /usr/lib/libasound.so -lpthread -march=c3 -mmmx -m3dnow -Wl,-O1 -Wl,-soname -Wl,libfluidsynth.so.1 -o .libs/libfluidsynth.so.1.1.2 These are libfluidynth link lines. I see no -L/prefix or something. Also your setup doesn't seem exactly the same as the one in '5.e. Helper: pkg-config' of the handbook, and fluidsynth uses pkgconfig to discover alsa libs. Here it seems to link to your system libs instead. @embedded/solar: why removing yourself from cc there? this *really* seems more a misconfiguration than an ebuild/build system problem. > ... > -lreadline -lncurses /usr/lib/libjack.so /usr/lib/libasound.so -lpthread I should have noticed that yesterday, but I think that might the problem right there. There should be "-ljack -lasound", but for some reason it has a hardcoded path to the system libs. Where does that come from? PKG_CONFIG says "-ljack -lpthread" and "-lasound". > I see no -L/prefix or something. Also your No need, crossdev builds the cross compiler/linker with --with-sysroot, so it knows where to find the libraries: $ i486-pc-linux-uclibc-gcc -v Using built-in specs. Target: i486-pc-linux-uclibc Configured with: ... --with-sysroot=/usr/i486-pc-linux-uclibc --disable-bootstrap --disable-libgomp --disable-__cxa_atexit --enable-target-optspace --enable-clocale=uclibc Thread model: posix gcc version 4.2.4 (Gentoo 4.2.4 p1.0) > setup doesn't seem exactly the same as the one in '5.e. Helper: pkg-config' of > the handbook, and fluidsynth uses pkgconfig to discover alsa libs. No, I modified it a bit to work around some other problem with some other package I can't remember right now, but here it does the same thing as long as SYSROOT is also the prefix of *-pkg-config, as in my case. And it wouldn't matter anyway because also the system alsa.pc tells to use -lasound. $ pkg-config --libs alsa -lasound $ /root/i486-pc-linux-uclibc-pkg-config --libs alsa -lasound I have a hunch that pkgconfig output is not really used to make up the one line above, although it should. (In reply to comment #3) > > ... > > -lreadline -lncurses /usr/lib/libjack.so /usr/lib/libasound.so -lpthread > > I should have noticed that yesterday, but I think that might the problem right > there. There should be "-ljack -lasound", but for some reason it has a > hardcoded path to the system libs. Where does that come from? PKG_CONFIG says > "-ljack -lpthread" and "-lasound". libtool tends to expand the -lfoo to what it thinks better when there is libfoo.la afaik (In reply to comment #4) > libtool tends to expand the -lfoo to what it thinks better when there is > libfoo.la afaik I'm sorry, it turns out you are right. Went back and tried with the original *-pkg-config as per the embedded handbook and it works. So apparently ebuild unsets SYSROOT somewhere along the way, then the wrong pkg-config gets called, and then libtool looks at /usr/lib/libasound.la and decides to put in the full path because this is now a non-standard path for *-ld. Got it. (Have to figure out now what this other package was and what went wrong there.) Thanks for your help and time. (In reply to comment #5) > and it works. Well, kind of. It didn't find ALSA and JACK anymore and compiled without. But now I found the root problem and this can actually be seen as a minor bug in the Embedded Handbook, section 5.e.: "... so in those cases you will need to export the PKG_CONFIG variable to the wrapper script." If PKG_CONFIG is set to some path, however - as I do - then the script in listing 5.1 won't work as advertised because CTARGET=${0%-pkg-config} still contains the full path, and SYSROOT will be invalid and things go down from there. THis is a bit annoying as it will just silently not find things and build without support for components you thought you had installed. Needs something like SCRIPTNAME=$(basename $0) CTARGET=${SCRIPTNAME%-pkg-config} ... I reopen this bug with severity "trivial" and suggest to reassign it to the Embedded people. Maybe someone wants to make this script idiot-proof. (In reply to comment #6) > I reopen this bug with severity "trivial" and suggest to reassign it to the > Embedded people. Maybe someone wants to make this script idiot-proof. maybe you want to rename the bug summary to something that matches this then ;) Arrgh! Now it doesn't build anymore, same problem as above, back to base one. It is just wrong to use the path from libasound.la, because the tree is not installed in its final location yet. It needs to use -lasound and -ljack and rely on the linker to figure out where to find the libraries. I hate libtool. Wasn't this thing supposed to SOLVE linking problems? Or, if libtool is right, then this whole approach of the Embedded Handbook, > 5.b. Filesystem Setup > > Cross-compiling a system generally involves two directory trees. The first is > where all development files are normally installed. This is your sysroot. The > other tree is where only your runtime files are installed. You emerge all of > your fun packages into your sysroot (without trimming down any files), and > then either install via binary packages or copying files by hand all the stuff > you need in your runtime tree. doesn't work. (In reply to comment #3) > > ... > > -lreadline -lncurses /usr/lib/libjack.so /usr/lib/libasound.so -lpthread > > I should have noticed that yesterday, but I think that might the problem right > there. There should be "-ljack -lasound", Just to confirm that if I issue this command manually with the paths replaced by -lasound -ljack, the build continues just fine and produces a fluidsynth binary which appears to be linked correctly. Thus a temporary workaround: Remove lib{asound,jack}.la from $ROOT/usr/lib prior to building. I'm leaving this open because I don't think this is a real fix. There appears to be something fundamentally wrong with the Embedded Handbook idea of emerging stuff into a ROOT directory and then using this ROOT as a SYSROOT for future builds; because the *.la files will be off unless $ROOT="/". Although it seems to work surprisingly well in many cases. this really should not be assigned to embedded@. But... Rupert, Chances are newer versions of crossdev will include pkg-config wrappers which fix up the *.la files in ROOT. You will find the same problems in many of packages. (In reply to comment #11) > this really should not be assigned to embedded@. But... and even less to sound@ ... > Chances are newer versions of crossdev will include pkg-config wrappers which > fix up the *.la files in ROOT. You will find the same problems in many of > packages. Then what's the point of re-assigning this back to sound ? As I have better things to do than playing the reassigning game forever, I'm closing as cantfix then, fluidsynth does not seem at fault here -> nothing I can do. Rupert, if you want this fixed, please file a new bug asking for .la files fixups when compiling under SYSROOT/ROOT. |