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: Sat, 20 Apr 2019 23:20:43
Message-Id: 1555659338.15fbfc075d699e498d73701b6f2a3f62d7dcabba.slyfox@gentoo
1 commit: 15fbfc075d699e498d73701b6f2a3f62d7dcabba
2 Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
3 AuthorDate: Fri Apr 19 07:32:12 2019 +0000
4 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
5 CommitDate: Fri Apr 19 07:35:38 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=15fbfc07
7
8 sys-libs/glibc: disable c++ detection for cross-case, bug #683074
9
10 https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=561b0bec4448f0302cb4915bf67c919bde4a1c57
11 in unstream glibc repo added optional dependency on CXX compiler.
12
13 Unfortunately ./configure tries hard to pass some g++ as CXX:
14 either ${CTARGET}-g++ (ok) or ${CBUILD}+g++ (bad).
15
16 During toolchain bootstrap ${CTARGET}-g++ does not yet exist
17 as we only have stage1-gcc without c++ (or libc) support.
18
19 To restore toolchain bootstrap we force-disable c++ detection
20 by setting cache variable:
21 libc_cv_cxx_link_ok=no
22
23 c++ is force disables only for cross-compilation case
24 (CHOST != CTARGET). Cross-building case (CHOST = CTRAGET)
25 is unchanged as we should already have c++ capable toolchain
26 by then.
27
28 Reported-by: hanetzer <AT> startmail.com
29 Reported-by: rhn
30 Closes: https://bugs.gentoo.org/683074
31 Package-Manager: Portage-2.3.63, Repoman-2.3.12
32 Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
33
34 sys-libs/glibc/glibc-2.29-r2.ebuild | 11 +++++++++++
35 sys-libs/glibc/glibc-9999.ebuild | 11 +++++++++++
36 2 files changed, 22 insertions(+)
37
38 diff --git a/sys-libs/glibc/glibc-2.29-r2.ebuild b/sys-libs/glibc/glibc-2.29-r2.ebuild
39 index 093ffc207eb..8f920eb85ac 100644
40 --- a/sys-libs/glibc/glibc-2.29-r2.ebuild
41 +++ b/sys-libs/glibc/glibc-2.29-r2.ebuild
42 @@ -799,6 +799,17 @@ glibc_do_configure() {
43
44 # Some of the tests are written in C++, so we need to force our multlib abis in, bug 623548
45 export CXX="$(tc-getCXX ${CTARGET}) $(get_abi_CFLAGS) ${CFLAGS}"
46 +
47 + if is_crosscompile; then
48 + # Assume worst-case bootstrap: glibc is buil first time
49 + # when ${CTARGET}-g++ is not available yet. We avoid
50 + # building auxiliary programs that require C++: bug #683074
51 + # It should not affect final result.
52 + export libc_cv_cxx_link_ok=no
53 + # The line above has the same effect. We set CXX explicitly
54 + # to make build logs less confusing.
55 + export CXX=
56 + fi
57 einfo " $(printf '%15s' 'Manual CXX:') ${CXX}"
58
59 echo
60
61 diff --git a/sys-libs/glibc/glibc-9999.ebuild b/sys-libs/glibc/glibc-9999.ebuild
62 index 142153734f9..b01dc823635 100644
63 --- a/sys-libs/glibc/glibc-9999.ebuild
64 +++ b/sys-libs/glibc/glibc-9999.ebuild
65 @@ -800,6 +800,17 @@ glibc_do_configure() {
66
67 # Some of the tests are written in C++, so we need to force our multlib abis in, bug 623548
68 export CXX="$(tc-getCXX ${CTARGET}) $(get_abi_CFLAGS) ${CFLAGS}"
69 +
70 + if is_crosscompile; then
71 + # Assume worst-case bootstrap: glibc is buil first time
72 + # when ${CTARGET}-g++ is not available yet. We avoid
73 + # building auxiliary programs that require C++: bug #683074
74 + # It should not affect final result.
75 + export libc_cv_cxx_link_ok=no
76 + # The line above has the same effect. We set CXX explicitly
77 + # to make build logs less confusing.
78 + export CXX=
79 + fi
80 einfo " $(printf '%15s' 'Manual CXX:') ${CXX}"
81
82 echo