Skip to content

Commit 3ecd0fb

Browse files
authored
Merge pull request #62 from andressbarajas/macos_clang_fix
Fix: Support Clang 17+ on macOS by using system zlib
2 parents 13932bb + 80693e6 commit 3ecd0fb

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

scripts/001-binutils.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@ TARGET_ALIAS="ee"
3636
TARG_XTRA_OPTS=""
3737
OSVER=$(uname)
3838

39-
## If using MacOS Apple, set gmp and mpfr paths using TARG_XTRA_OPTS
39+
## If using MacOS Apple, set gmp and mpfr paths using TARG_XTRA_OPTS
4040
## (this is needed for Apple Silicon but we will do it for all MacOS systems)
4141
if [ "$(uname -s)" = "Darwin" ]; then
4242
## Check if using brew
4343
if command -v brew &> /dev/null; then
44-
TARG_XTRA_OPTS="--with-gmp=$(brew --prefix gmp) --with-mpfr=$(brew --prefix mpfr)"
44+
TARG_XTRA_OPTS="--with-system-zlib --with-gmp=$(brew --prefix gmp) --with-mpfr=$(brew --prefix mpfr)"
4545
elif command -v port &> /dev/null; then
46-
## Check if using MacPorts
47-
TARG_XTRA_OPTS="--with-gmp=$(port -q prefix gmp) --with-mpfr=$(port -q prefix mpfr)"
46+
## Check if using MacPorts
47+
TARG_XTRA_OPTS="--with-system-zlib --with-gmp=$(port -q prefix gmp) --with-mpfr=$(port -q prefix mpfr)"
4848
fi
4949
fi
5050

scripts/002-gcc-stage1.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,17 @@ TARG_XTRA_OPTS=""
3737
TARGET_CFLAGS="-O2 -gdwarf-2 -gz"
3838
OSVER=$(uname)
3939

40-
## If using MacOS Apple, set gmp, mpfr and mpc paths using TARG_XTRA_OPTS
40+
## If using MacOS Apple, set gmp, mpfr and mpc paths using TARG_XTRA_OPTS
4141
## (this is needed for Apple Silicon but we will do it for all MacOS systems)
4242
if [ "$(uname -s)" = "Darwin" ]; then
4343
## Check if using brew
4444
if command -v brew &> /dev/null; then
45-
TARG_XTRA_OPTS="--with-gmp=$(brew --prefix gmp) --with-mpfr=$(brew --prefix mpfr) --with-mpc=$(brew --prefix libmpc)"
45+
TARG_XTRA_OPTS="--with-system-zlib --with-gmp=$(brew --prefix gmp) --with-mpfr=$(brew --prefix mpfr) --with-mpc=$(brew --prefix libmpc)"
4646
elif command -v port &> /dev/null; then
4747
## Check if using MacPorts
4848
MACPORT_BASE=$(dirname `port -q contents gmp|grep gmp.h`|sed s#/include##g)
4949
echo Macport base is $MACPORT_BASE
50-
TARG_XTRA_OPTS="--with-gmp=$MACPORT_BASE --with-mpfr=$MACPORT_BASE --with-mpc=$MACPORT_BASE"
50+
TARG_XTRA_OPTS="--with-system-zlib --with-gmp=$MACPORT_BASE --with-mpfr=$MACPORT_BASE --with-mpc=$MACPORT_BASE"
5151
fi
5252
fi
5353

scripts/006-gcc-stage2.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,17 @@ TARG_XTRA_OPTS=""
3737
TARGET_CFLAGS="-O2 -gdwarf-2 -gz"
3838
OSVER=$(uname)
3939

40-
## If using MacOS Apple, set gmp, mpfr and mpc paths using TARG_XTRA_OPTS
40+
## If using MacOS Apple, set gmp, mpfr and mpc paths using TARG_XTRA_OPTS
4141
## (this is needed for Apple Silicon but we will do it for all MacOS systems)
4242
if [ "$(uname -s)" = "Darwin" ]; then
4343
## Check if using brew
4444
if command -v brew &> /dev/null; then
45-
TARG_XTRA_OPTS="--with-gmp=$(brew --prefix gmp) --with-mpfr=$(brew --prefix mpfr) --with-mpc=$(brew --prefix libmpc)"
45+
TARG_XTRA_OPTS="--with-system-zlib --with-gmp=$(brew --prefix gmp) --with-mpfr=$(brew --prefix mpfr) --with-mpc=$(brew --prefix libmpc)"
4646
elif command -v port &> /dev/null; then
4747
## Check if using MacPorts
4848
MACPORT_BASE=$(dirname `port -q contents gmp|grep gmp.h`|sed s#/include##g)
4949
echo Macport base is $MACPORT_BASE
50-
TARG_XTRA_OPTS="--with-gmp=$MACPORT_BASE --with-mpfr=$MACPORT_BASE --with-mpc=$MACPORT_BASE"
50+
TARG_XTRA_OPTS="--with-system-zlib --with-gmp=$MACPORT_BASE --with-mpfr=$MACPORT_BASE --with-mpc=$MACPORT_BASE"
5151
fi
5252
fi
5353

0 commit comments

Comments
 (0)