Skip to content

Commit a114199

Browse files
committed
scripts/bootstrap-prefix: be selective on where to use GCC-5 in stage1
GCC-5 doesn't compile on ARM64, newer versions of macOS might also prove to be capable of compiling GCC-14. Signed-off-by: Fabian Groffen <[email protected]>
1 parent 636a653 commit a114199

File tree

1 file changed

+21
-9
lines changed

1 file changed

+21
-9
lines changed

scripts/bootstrap-prefix.sh

+21-9
Original file line numberDiff line numberDiff line change
@@ -391,10 +391,10 @@ bootstrap_profile() {
391391
profile="prefix/darwin/macos/10.$((rev - 4))/x64"
392392
;;
393393
*64-apple-darwin2[0123456789])
394-
# Big Sur is 11.0
395-
# Monterey is 12.0
396-
# Ventura is 13.0
397-
# Sanoma is 14.0
394+
# Big Sur is 11.0 darwin20
395+
# Monterey is 12.0 darwin21
396+
# Ventura is 13.0 darwin22
397+
# Sanoma is 14.0 darwin23
398398
rev=${CHOST##*darwin}
399399
case ${CHOST%%-*} in
400400
x86_64) arch=x64 ;;
@@ -1483,11 +1483,9 @@ bootstrap_stage1() {
14831483
configure_toolchain
14841484
export CC CXX
14851485

1486-
# GCC 14 cannot be compiled by versions of Clang at least on
1487-
# Darwin17, so go the safe route and get GCC-5 which is sufficient
1488-
# and the last one we can compile without C11. This also compiles
1489-
# on Darwin 8 and 9.
1490-
# see also configure_toolchain
1486+
# default: empty = NO
1487+
local USEGCC5=
1488+
14911489
if [[ ${CHOST} == *-darwin* ]] ; then
14921490
# setup MacOSX.sdk symlink for GCC, this should probably be
14931491
# managed using an eselect module in the future
@@ -1525,11 +1523,25 @@ bootstrap_stage1() {
15251523
( cd "${ROOT}" && ln -s "${SDKPATH}" MacOSX.sdk )
15261524
einfo "using system sources from ${SDKPATH}"
15271525

1526+
# GCC 14 cannot be compiled by versions of Clang at least on
1527+
# Darwin17, so go the safe route and get GCC-5 which is sufficient
1528+
# and the last one we can compile without C11. This also compiles
1529+
# on Darwin 8 and 9.
1530+
# see also configure_toolchain
1531+
case ${CHOST} in
1532+
*-darwin[89]) USEGCC5=yes ;;
1533+
*86*-darwin*) USEGCC5=yes ;;
1534+
# arm64/M1 isn't supported by old GCC-5!
1535+
esac
1536+
fi
1537+
1538+
if [[ -n ${USEGCC5} ]] ; then
15281539
# benefit from 4.2 if it's present
15291540
if [[ -e /usr/bin/gcc-4.2 ]] ; then
15301541
export CC=gcc-4.2
15311542
export CXX=g++-4.2
15321543
fi
1544+
15331545
[[ -e ${ROOT}/tmp/usr/include/gmp.h ]] \
15341546
|| (bootstrap_gmp) || return 1
15351547
[[ -e ${ROOT}/tmp/usr/include/mpfr.h ]] \

0 commit comments

Comments
 (0)