When you try to build apr-util while cross compiling, we should get the following error : /bin/bash /usr/bin/libtool --silent --mode=compile x86_64-pc-linux-gnu-gcc -pthread -Os -pipe -march=geode -mmmx -m3dnow -fomit-frame-pointer -DHAVE_CONFIG_H -D_REENTRANT -D_GNU_SOURCE -I/var/tmp/i586-alix-linux-gnu/portage/dev-libs/apr-util-1.3.11/work/apr-util-1.3.11/include -I/var/tmp/i586-alix-linux-gnu/portage/dev-libs/apr-util-1.3.11/work/apr-util-1.3.11/include/private -I/usr/include/apr-1 -o buckets/apr_buckets_flush.lo -c buckets/apr_buckets_flush.c && touch buckets/apr_buckets_flush.lo buckets/apr_buckets_alloc.c:1:0: error: CPU you selected does not support x86-64 instruction set buckets/apr_buckets_alloc.c:1:0: error: CPU you selected does not support x86-64 instruction set buckets/apr_buckets_eos.c:1:0: error: CPU you selected does not support x86-64 instruction set buckets/apr_buckets_eos.c:1:0: error: CPU you selected does not support x86-64 instruction set buckets/apr_buckets.c:1:0: error: CPU you selected does not support x86-64 instruction set buckets/apr_buckets.c:1:0: error: CPU you selected does not support x86-64 instruction set buckets/apr_brigade.c:1:0: error: CPU you selected does not support x86-64 instruction set buckets/apr_brigade.c:1:0: error: CPU you selected does not support x86-64 instruction set make[1]: *** [buckets/apr_buckets_alloc.lo] Error 1 This is because BUILD compiler is used. CC and CPP need to be export, as HOST LIBTOOL should be used Reproducible: Always Steps to Reproduce: 1. i586-alix-linux-gnu-emerge -va1 apr-util 2. 3.
Created attachment 288899 [details] apr-util-1.3.11:20111005-185712.log The build log
Created attachment 288901 [details, diff] apr-util-1.3.11.ebuild diff The ebuild fix
ROOT variable shouldn't be used in src_*() phases. See PMS (12.1 Defined Variables).
Comment on attachment 288901 [details, diff] apr-util-1.3.11.ebuild diff this is wrong. src_* should never use $ROOT.
Also, using the system-installed /usr/bin/libtool is wrong because that libtool contains hardcoded paths to gcc library directories which are generated at libtool’s installation time and not updated when the user installs or switches to new versions of gcc.
Created attachment 369104 [details, diff] apr-util cross compile hacks i got it to somewhat work with this. adding external libs (like db) will still break though. basically i point the configure script to the SYSROOT apr-config, then re-insert the SYSROOT prefix into the -I/-L paths. it's terrible.
Commit message: Utilize SYSROOT to locate build-time paths when cross-compiling, and drop redundent -L/-R libdir flags to simplify linking. http://sources.gentoo.org/dev-libs/apr/apr-1.5.0-r2.ebuild?rev=1.1 http://sources.gentoo.org/dev-libs/apr/files/apr-1.5.0-sysroot.patch?rev=1.1
should be all set now in the tree; thanks for the report! Commit message: Utilize SYSROOT to locate build-time paths when cross-compiling, and drop redundent -L/-R libdir flags to simplify linking. Rewrite build/rules.mk to pick up current env settings rather than clobbering at make time. http://sources.gentoo.org/dev-libs/apr-util/apr-util-1.5.3-r1.ebuild?rev=1.1 http://sources.gentoo.org/dev-libs/apr-util/files/apr-util-1.5.3-sysroot.patch?rev=1.1