Gentoo Archives: gentoo-commits

From: Sergei Trofimovich <slyfox@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/glibc/
Date: Fri, 30 Mar 2018 11:43:17
Message-Id: 1522410188.bdb069df283ccbe1e3f5fd39bb2270ec640a67b7.slyfox@gentoo
1 commit: bdb069df283ccbe1e3f5fd39bb2270ec640a67b7
2 Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
3 AuthorDate: Fri Mar 30 11:41:50 2018 +0000
4 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
5 CommitDate: Fri Mar 30 11:43:08 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bdb069df
7
8 sys-libs/glibc: fix glibc-headers bootstrap on non-multilib host
9
10 The error is found by wm_ attempting to build a cross-compiler
11 CHOST=powerpc-unknown-linux-gnu CTARGET=mips64-unknown-linux-gnu
12 Boostrap failed on glibc-headers (./configure phase) as:
13
14 configure:2623: powerpc-unknown-linux-gnu-gcc -mabi=n32 -c \
15 -O1 -pipe -U_FORTIFY_SOURCE conftest.c >&5
16 powerpc-unknown-linux-gnu-gcc: error: \
17 unrecognized command line option '-mabi=n32'; did you mean '-mabi=d32'?
18
19 Note how target's ABI is mexed into host's compiler flags.
20
21 The error above happens on every host=non-multilib target=multilib combination.
22 I've reproduced it on:
23 CHOST=i686-pc-linux-gnu CTARGET=mips64-unknown-linux-gnu
24
25 The fix is not to inject target's CFLAGS ABI into CC for
26 USE=headers-only bootstrap step as we don't have cross-compiler yet.
27
28 Tested by successfully bootstrapping cross-compiler on
29 CHOST=i686-pc-linux-gnu CTARGET=mips64-unknown-linux-gnu
30
31 Package-Manager: Portage-2.3.26, Repoman-2.3.7
32
33 sys-libs/glibc/glibc-2.27-r1.ebuild | 7 +++++++
34 sys-libs/glibc/glibc-9999.ebuild | 7 +++++++
35 2 files changed, 14 insertions(+)
36
37 diff --git a/sys-libs/glibc/glibc-2.27-r1.ebuild b/sys-libs/glibc/glibc-2.27-r1.ebuild
38 index a175b225e18..b281c00fac3 100644
39 --- a/sys-libs/glibc/glibc-2.27-r1.ebuild
40 +++ b/sys-libs/glibc/glibc-2.27-r1.ebuild
41 @@ -457,6 +457,13 @@ setup_env() {
42
43 export ABI=${ABI:-${DEFAULT_ABI:-default}}
44
45 + if use headers-only ; then
46 + # Avoid mixing host's CC and target's CFLAGS_${ABI}:
47 + # At this bootstrap stage we have only binutils for
48 + # target but not compiler yet.
49 + einfo "Skip CC ABI injection. We can't use (cross-)compiler yet."
50 + return 0
51 + fi
52 local VAR=CFLAGS_${ABI}
53 # We need to export CFLAGS with abi information in them because glibc's
54 # configure script checks CFLAGS for some targets (like mips). Keep
55
56 diff --git a/sys-libs/glibc/glibc-9999.ebuild b/sys-libs/glibc/glibc-9999.ebuild
57 index 52fe095e5fd..17f8cdafed5 100644
58 --- a/sys-libs/glibc/glibc-9999.ebuild
59 +++ b/sys-libs/glibc/glibc-9999.ebuild
60 @@ -457,6 +457,13 @@ setup_env() {
61
62 export ABI=${ABI:-${DEFAULT_ABI:-default}}
63
64 + if use headers-only ; then
65 + # Avoid mixing host's CC and target's CFLAGS_${ABI}:
66 + # At this bootstrap stage we have only binutils for
67 + # target but not compiler yet.
68 + einfo "Skip CC ABI injection. We can't use (cross-)compiler yet."
69 + return 0
70 + fi
71 local VAR=CFLAGS_${ABI}
72 # We need to export CFLAGS with abi information in them because glibc's
73 # configure script checks CFLAGS for some targets (like mips). Keep