Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 385775 - dev-libs/apr-util does not cross compile
Summary: dev-libs/apr-util does not cross compile
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Lars Wendler (Polynomial-C) (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-05 19:49 UTC by Bertrand Jacquin
Modified: 2014-01-31 08:12 UTC (History)
2 users (show)

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


Attachments
apr-util-1.3.11:20111005-185712.log (dev-libs:apr-util-1.3.11:20111005-185712.log,21.28 KB, text/plain)
2011-10-05 19:49 UTC, Bertrand Jacquin
Details
apr-util-1.3.11.ebuild diff (apr-util-1.3.11-BJA-cross.diff,625 bytes, patch)
2011-10-05 19:50 UTC, Bertrand Jacquin
Details | Diff
apr-util cross compile hacks (apr-util-cross.patch,1.25 KB, patch)
2014-01-30 06:49 UTC, SpanKY
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bertrand Jacquin 2011-10-05 19:49:16 UTC
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.
Comment 1 Bertrand Jacquin 2011-10-05 19:49:55 UTC
Created attachment 288899 [details]
apr-util-1.3.11:20111005-185712.log

The build log
Comment 2 Bertrand Jacquin 2011-10-05 19:50:27 UTC
Created attachment 288901 [details, diff]
apr-util-1.3.11.ebuild diff

The ebuild fix
Comment 3 Arfrever Frehtes Taifersar Arahesis 2011-10-08 04:02:56 UTC
ROOT variable shouldn't be used in src_*() phases. See PMS (12.1 Defined Variables).
Comment 4 SpanKY gentoo-dev 2012-06-23 01:48:58 UTC
Comment on attachment 288901 [details, diff]
apr-util-1.3.11.ebuild diff

this is wrong.  src_* should never use $ROOT.
Comment 5 Nathan Phillip Brink (binki) (RETIRED) gentoo-dev 2012-11-17 18:52:12 UTC
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.
Comment 6 SpanKY gentoo-dev 2014-01-30 06:49:12 UTC
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.
Comment 7 SpanKY gentoo-dev 2014-01-31 08:01:18 UTC
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
Comment 8 SpanKY gentoo-dev 2014-01-31 08:12:08 UTC
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