summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2018-03-30 12:30:09 +0100
committerSergei Trofimovich <slyfox@gentoo.org>2018-03-30 12:43:08 +0100
commit1b31083fd156425cc687fee7058b74b752be768e (patch)
tree6409d7e4a61cf1ed8244dadabe7250c33d64a68a
parentsys-libs/glibc: log when ebuild overrides CC/CFLAGS (diff)
downloadgentoo-1b31083fd156425cc687fee7058b74b752be768e.tar.gz
gentoo-1b31083fd156425cc687fee7058b74b752be768e.tar.bz2
gentoo-1b31083fd156425cc687fee7058b74b752be768e.zip
toolchain-glibc.eclass: fix glibc-headers bootstrap on non-multilib host
The error is found by wm_ attempting to build a cross-compiler CHOST=powerpc-unknown-linux-gnu CTARGET=mips64-unknown-linux-gnu Boostrap failed on glibc-headers (./configure phase) as: configure:2623: powerpc-unknown-linux-gnu-gcc -mabi=n32 -c -O1 -pipe -U_FORTIFY_SOURCE conftest.c >&5 powerpc-unknown-linux-gnu-gcc: error: unrecognized command line option '-mabi=n32'; did you mean '-mabi=d32'? Note how target's ABI is mexed into host's compiler flags. The error above happens on every host=non-multilib target=multilib combination. I've reproduced it on: CHOST=i686-pc-linux-gnu CTARGET=mips64-unknown-linux-gnu The fix is not to inject target's CFLAGS ABI into CC for USE=headers-only bootstrap step as we don't have cross-compiler yet. Tested by successfully bootstrapping cross-compiler on CHOST=i686-pc-linux-gnu CTARGET=mips64-unknown-linux-gnu Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
-rw-r--r--eclass/toolchain-glibc.eclass8
1 files changed, 8 insertions, 0 deletions
diff --git a/eclass/toolchain-glibc.eclass b/eclass/toolchain-glibc.eclass
index bd10f2cbbe40..d75ca2eefdf5 100644
--- a/eclass/toolchain-glibc.eclass
+++ b/eclass/toolchain-glibc.eclass
@@ -370,6 +370,14 @@ setup_env() {
export ABI=${ABI:-${DEFAULT_ABI:-default}}
+ if use headers-only ; then
+ # Avoid mixing host's CC and target's CFLAGS_${ABI}:
+ # At this bootstrap stage we have only binutils for
+ # target but not compiler yet.
+ einfo "Skip CC ABI injection. We can't use (cross-)compiler yet."
+ return 0
+ fi
+
local VAR=CFLAGS_${ABI}
# We need to export CFLAGS with abi information in them because glibc's
# configure script checks CFLAGS for some targets (like mips). Keep