Skip to content

Commit ae29051

Browse files
committed
scripts/bootstrap-prefix: unbreak arm64-macos bootstrap
Trim down the guessing and more in configure_toolchain. Problem is that configure_toolchain is called in all three stages, and its output is used. Since we need to bootstrap a compiler very early, we need to rely on PATH for a compiler, which means in stage3 we always pick up the stage2 emerged compiler. This changes the output of the function due to a change in env. Avoid this by simply hardwiring the exceptional case, which is already hardwired before already. Signed-off-by: Fabian Groffen <[email protected]>
1 parent a58e5f2 commit ae29051

File tree

1 file changed

+11
-25
lines changed

1 file changed

+11
-25
lines changed

scripts/bootstrap-prefix.sh

+11-25
Original file line numberDiff line numberDiff line change
@@ -180,34 +180,20 @@ configure_toolchain() {
180180
einfo "Triggering Darwin with GCC toolchain"
181181
compiler_stage1+=" sys-apps/darwin-miscutils"
182182
compiler_stage1+=" sys-devel/gcc"
183-
# recent binutils-apple are hard to build (C++11 features,
184-
# and cmake build system) so avoid going there, the system
185-
# ld on machines with compiler that supports C11 is good
186-
# enough to bring us to stage3, after which the @system set
187-
# will take care of the rest
188-
linker="sys-devel/native-cctools"
189183

190-
local ccvers="$(unset CHOST; ${CC} --version 2>/dev/null)"
191-
case "${ccvers}" in
192-
*"(GCC) "[1-9]*|"gcc ("*") "[1-9]*)
193-
local cvers="${ccvers#*)}"; cvers="${cvers%%.*}"
194-
# GCC-5 has C11 see above
195-
if [[ ${cvers} -ge 5 ]] ; then
196-
: # ok! stage1 bootstrapped one, get us a linker too
197-
linker="=sys-devel/binutils-apple-3.2.6*"
198-
else
199-
# FIXME: should probably stage1 bootstrap GCC-5
200-
# or something
201-
eerror "compiler ${ccvers} is too old: ${cvers} < 5"
202-
eerror "you need a C11/C++11 compiler to bootstrap"
203-
fi
204-
;;
205-
*"Apple clang version "*|*"Apple LLVM version "*)
206-
: # ok!
184+
# binutils-apple/xtools doesn't work (yet) on arm64. The
185+
# profiles will mask and keep using native-cctools for that,
186+
# otherwise stage3 and @system will take care of switching
187+
# to binutils-apple.
188+
# one problem: when we have a really old linker, we need
189+
# to use it sooner or else packages like libffi won't
190+
# compile.
191+
case ${CHOST} in
192+
*-darwin[89])
193+
linker="=sys-devel/binutils-apple-3.2.6*"
207194
;;
208195
*)
209-
eerror "unknown compiler: ${ccvers}"
210-
return 1
196+
linker="sys-devel/native-cctools"
211197
;;
212198
esac
213199
;;

0 commit comments

Comments
 (0)