Skip to content

Commit 377f6f4

Browse files
committed
scripts/bootstrap-prefix: fix configure_toolchain for Darwin
Don't get confused by (just) bootstrapped compilers, in fact, drop the detection of host-compilers, because they are insufficient to bootstrap nowadays. Bug: https://bugs.gentoo.org/923617 Signed-off-by: Fabian Groffen <[email protected]>
1 parent 2f78608 commit 377f6f4

File tree

1 file changed

+12
-17
lines changed

1 file changed

+12
-17
lines changed

scripts/bootstrap-prefix.sh

+12-17
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,8 @@ configure_toolchain() {
166166
# introduced in gcc-4.8, but apparently gcc-5 is still buildable
167167
# with Apple's gcc-apple-4.0.1, so that's a good candidate
168168
# The Prefix tree only contains gcc-12 as of this writing.
169+
# The bootstrap Python 3.7 we have in use requires C11, so Apple's
170+
# 4.x line is no longer enough for that.
169171

170172
CC=gcc
171173
CXX=g++
@@ -174,26 +176,19 @@ configure_toolchain() {
174176
*darwin*:1)
175177
einfo "Triggering Darwin with GCC toolchain"
176178
compiler_stage1+=" sys-apps/darwin-miscutils"
177-
# check if we have gcc-4.2 available, else use plain gcc
178-
# Darwin 9 comes with 4.2 but it isn't enabled by default
179-
if [[ -e $(type -P gcc-4.2) ]] ; then
180-
CC=gcc-4.2
181-
CXX=g++-4.2
182-
fi
183179
local ccvers="$(unset CHOST; ${CC} --version 2>/dev/null)"
184180
local isgcc=
185181
case "${ccvers}" in
186-
*"(GCC) 4.2.1 "*)
187-
linker="=sys-devel/binutils-apple-3.2.6"
188-
isgcc=true
189-
;;
190-
*"(GCC) 4.0.1 "*)
191-
linker="=sys-devel/binutils-apple-3.2.6"
192-
# upgrade to 4.2.1 first
193-
compiler_stage1+="
194-
sys-devel/gcc-apple
195-
=sys-devel/binutils-apple-3.2.6"
196-
isgcc=true
182+
*"(GCC) "[1-9]*|"gcc ("*") "[1-9]*)
183+
local cvers="${ccvers#*)}"; cvers="${cvers%%.*}"
184+
# GCC-5 has C11 see above
185+
if [[ ${ccvers} -ge 5 ]] ; then
186+
linker="=sys-devel/binutils-apple-3.2.6"
187+
isgcc=true
188+
else
189+
eerror "compiler ${ccvers} is too old: ${cvers} < 5"
190+
eerror "you need a C11/C++11 compiler to bootstrap"
191+
fi
197192
;;
198193
*"Apple clang version "*|*"Apple LLVM version "*)
199194
# recent binutils-apple are hard to build (C++11

0 commit comments

Comments
 (0)