Gentoo Archives: gentoo-commits

From: Fabian Groffen <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/prefix:master commit in: scripts/
Date: Thu, 30 Dec 2021 12:29:45
Message-Id: 1640867377.10324f2bc1807469a6425e308c9564ed8513f2fe.grobian@gentoo
1 commit: 10324f2bc1807469a6425e308c9564ed8513f2fe
2 Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
3 AuthorDate: Thu Dec 30 12:27:02 2021 +0000
4 Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
5 CommitDate: Thu Dec 30 12:29:37 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=10324f2b
7
8 scripts/bootstrap-prefix: darwin-gcc: use gcc-10 with host gcc
9
10 GCC-11 needs C++11, which is at earliest in GCC-4.8, but if we bootstrap
11 from 4.2.1 (gcc-apple) we don't have this, so stick with GCC-10. Avoid
12 upgrading immediately to 11 afterwards, because we'll recompile
13 everything lateron again.
14
15 Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>
16
17 scripts/bootstrap-prefix.sh | 15 ++++++++++++---
18 1 file changed, 12 insertions(+), 3 deletions(-)
19
20 diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
21 index 70599da63a..233f606caf 100755
22 --- a/scripts/bootstrap-prefix.sh
23 +++ b/scripts/bootstrap-prefix.sh
24 @@ -190,9 +190,11 @@ configure_toolchain() {
25 einfo "Triggering Darwin with GCC toolchain"
26 compiler_stage1+=" sys-apps/darwin-miscutils"
27 local ccvers="$(unset CHOST; /usr/bin/gcc --version 2>/dev/null)"
28 + local isgcc=
29 case "${ccvers}" in
30 *"(GCC) 4.2.1 "*)
31 linker="=sys-devel/binutils-apple-3.2.6"
32 + isgcc=true
33 ;;
34 *"(GCC) 4.0.1 "*)
35 linker="=sys-devel/binutils-apple-3.2.6"
36 @@ -200,6 +202,7 @@ configure_toolchain() {
37 compiler_stage1+="
38 sys-devel/gcc-apple
39 =sys-devel/binutils-apple-3.2.6"
40 + isgcc=true
41 ;;
42 *"Apple clang version "*|*"Apple LLVM version "*)
43 # recent binutils-apple are hard to build (C++11
44 @@ -214,9 +217,15 @@ configure_toolchain() {
45 return 1
46 ;;
47 esac
48 - # current compiler (gcc-11 requires C++11, which is
49 - # available since 4.8, so need to bootstrap with <11)
50 - compiler_stage1+=" <sys-devel/gcc-11"
51 + if [[ ${isgcc} == true ]] ; then
52 + # current compiler (gcc-11) requires C++11, which is
53 + # available since 4.8, so need to bootstrap with <11
54 + compiler_stage1+=" <sys-devel/gcc-11"
55 + compiler="${compiler%sys-devel/gcc} <sys-devel/gcc-11"
56 + else
57 + # assume LLVM/Clang has C++11 support
58 + compiler_stage1+=" sys-devel/gcc"
59 + fi
60 ;;
61 *-darwin*)
62 einfo "Triggering Darwin with LLVM/Clang toolchain"