Libtool pulls in host's /usr/lib during the relink process. The following patch does fix this using the $ROOT prefix. To do so, I introduce a cross patchdir for the libtool eclass. The libtool patch that will follow needs to be put there. I successfully compiled both a native amd64 system and a cross-compiled armv4tl-softfloat-gnueabi base system with this patch without errors. Reproducible: Always Steps to Reproduce: 1. Make sure your target make.conf does not contain LDFLAGS=-L$ROOT/usr/lib or similar. 2. Try to cross emerge e.g. gmp Actual Results: gmp fails during make install because libtool's relink trys to pull in /usr/lib/libm.so Expected Results: gmp compiles and links against the target's libm.so
Created attachment 184614 [details, diff] Add cross-compile patch category Add a "cross" patch category to the $ECLASSDIR/ELT-patches directory. WE NEED TO ALSO CREATE THAT DIR!
*** Bug 260794 has been marked as a duplicate of this bug. ***
Created attachment 184616 [details, diff] Actual fix to libtool/ltmain.sh This fixes relink in ltmain.sh. A separate bugreport for libtool-2.2.6a will follow.
Comment on attachment 184616 [details, diff] Actual fix to libtool/ltmain.sh This fix needs to be put into $${ECLASSDIR}/ELT-patches/cross.
Reassigning to base-system herd.
Whoops, fixing component as well...
seems like a sane idea in general ... but the cross patches should only be applied when tc-is-cross-compiler returns true
Created attachment 184723 [details, diff] Reworked libtool patch Reworked patch to use the toolchain functions instead of playing funny games with variables. Thanks for pointing this out!
your patch had whitespace damage, so i fixed that up and applied. thanks! http://sources.gentoo.org/eclass/libtool.eclass?r1=1.81&r2=1.82 http://sources.gentoo.org/eclass/ELT-patches/cross/link-ROOT?rev=1.1
Hi, could you explain a thing about the problem? As i see, many packages have their own ltmain.sh and their ebuilds don't call elibtoolize. For example, i've cross-compiled gmp successfully, but caught an errors during xmerging of libgcrypt and gstreamer. Seems, that their ebuilds don't call elibtoolize at all. So, my question: Is there a way to build libtool'ed packages without fixing them manually, or the only way - is to cross-compile minimal environment and use qemu to compile the rest as usual? thanks