diff options
author | Fabian Groffen <grobian@gentoo.org> | 2021-12-30 13:27:02 +0100 |
---|---|---|
committer | Fabian Groffen <grobian@gentoo.org> | 2021-12-30 13:29:37 +0100 |
commit | 10324f2bc1807469a6425e308c9564ed8513f2fe (patch) | |
tree | 40c485fd34fd00083dbea8409b9f7139b4a64ef0 | |
parent | scripts/auto-bootstraps/analyse_result: deprecate sparc-solaris (diff) | |
download | prefix-10324f2b.tar.gz prefix-10324f2b.tar.bz2 prefix-10324f2b.zip |
scripts/bootstrap-prefix: darwin-gcc: use gcc-10 with host gcc
GCC-11 needs C++11, which is at earliest in GCC-4.8, but if we bootstrap
from 4.2.1 (gcc-apple) we don't have this, so stick with GCC-10. Avoid
upgrading immediately to 11 afterwards, because we'll recompile
everything lateron again.
Signed-off-by: Fabian Groffen <grobian@gentoo.org>
-rwxr-xr-x | scripts/bootstrap-prefix.sh | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh index 70599da63a..233f606caf 100755 --- a/scripts/bootstrap-prefix.sh +++ b/scripts/bootstrap-prefix.sh @@ -190,9 +190,11 @@ configure_toolchain() { einfo "Triggering Darwin with GCC toolchain" compiler_stage1+=" sys-apps/darwin-miscutils" local ccvers="$(unset CHOST; /usr/bin/gcc --version 2>/dev/null)" + local isgcc= case "${ccvers}" in *"(GCC) 4.2.1 "*) linker="=sys-devel/binutils-apple-3.2.6" + isgcc=true ;; *"(GCC) 4.0.1 "*) linker="=sys-devel/binutils-apple-3.2.6" @@ -200,6 +202,7 @@ configure_toolchain() { compiler_stage1+=" sys-devel/gcc-apple =sys-devel/binutils-apple-3.2.6" + isgcc=true ;; *"Apple clang version "*|*"Apple LLVM version "*) # recent binutils-apple are hard to build (C++11 @@ -214,9 +217,15 @@ configure_toolchain() { return 1 ;; esac - # current compiler (gcc-11 requires C++11, which is - # available since 4.8, so need to bootstrap with <11) - compiler_stage1+=" <sys-devel/gcc-11" + if [[ ${isgcc} == true ]] ; then + # current compiler (gcc-11) requires C++11, which is + # available since 4.8, so need to bootstrap with <11 + compiler_stage1+=" <sys-devel/gcc-11" + compiler="${compiler%sys-devel/gcc} <sys-devel/gcc-11" + else + # assume LLVM/Clang has C++11 support + compiler_stage1+=" sys-devel/gcc" + fi ;; *-darwin*) einfo "Triggering Darwin with LLVM/Clang toolchain" |