diff --git a/buildtoolchain/buildit.sh b/buildtoolchain/buildit.sh index ef85dbc..e279844 100755 --- a/buildtoolchain/buildit.sh +++ b/buildtoolchain/buildit.sh @@ -105,6 +105,8 @@ prepsrc() { extract "$1/src" "$1/var/cache/$BINUTILS_TARBALL" extract "$1/src" "$1/var/cache/$GCC_TARBALL" + patch -d "$1"/src/gcc-* -u -p1 -i $SCRIPTDIR/gcc-11.3.0.patch || die "Error applying GCC patch" + extract "$1/src/$GCC_DIR" "$1/var/cache/$GMP_TARBALL" mv "$1/src/$GCC_DIR/$GMP_DIR" "$1/src/$GCC_DIR/gmp" || die "Error renaming $GMP_DIR -> gmp" extract "$1/src/$GCC_DIR" "$1/var/cache/$MPFR_TARBALL" diff --git a/buildtoolchain/gcc-11.3.0.patch b/buildtoolchain/gcc-11.3.0.patch new file mode 100644 index 0000000..763be06 --- /dev/null +++ b/buildtoolchain/gcc-11.3.0.patch @@ -0,0 +1,20 @@ +https://github.com/richfelker/musl-cross-make/issues/116#issuecomment-823612404 + +diff -Nru gcc-11.3.0/gcc/config/host-darwin.c gcc-11.3.0-patched/gcc/config/host-darwin.c +--- gcc-11.3.0/gcc/config/host-darwin.c 2022-04-21 09:58:52 ++++ gcc-11.3.0-patched/gcc/config/host-darwin.c 2024-01-03 00:34:29 +@@ -22,6 +22,8 @@ + #include "coretypes.h" + #include "diagnostic-core.h" + #include "config/host-darwin.h" ++#include "hosthooks.h" ++#include "hosthooks-def.h" + + /* Yes, this is really supposed to work. */ + /* This allows for a pagesize of 16384, which we have on Darwin20, but should +@@ -79,3 +81,5 @@ + + return ret; + } ++ ++const struct host_hooks host_hooks = HOST_HOOKS_INITIALIZER;