Skip to content

Commit ebbffee

Browse files
committed
buildtoolchain: add patch to build modern GCC on ARM64 Apple devices
1 parent d286edb commit ebbffee

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

buildtoolchain/buildit.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ prepsrc() {
105105

106106
extract "$1/src" "$1/var/cache/$BINUTILS_TARBALL"
107107
extract "$1/src" "$1/var/cache/$GCC_TARBALL"
108+
patch -d "$1"/src/gcc-* -u -p1 -i $SCRIPTDIR/gcc-11.3.0.patch || die "Error applying GCC patch"
109+
108110
extract "$1/src/$GCC_DIR" "$1/var/cache/$GMP_TARBALL"
109111
mv "$1/src/$GCC_DIR/$GMP_DIR" "$1/src/$GCC_DIR/gmp" || die "Error renaming $GMP_DIR -> gmp"
110112
extract "$1/src/$GCC_DIR" "$1/var/cache/$MPFR_TARBALL"

buildtoolchain/gcc-11.3.0.patch

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
https://github.com/richfelker/musl-cross-make/issues/116#issuecomment-823612404
2+
3+
diff -Nru gcc-11.3.0/gcc/config/host-darwin.c gcc-11.3.0-patched/gcc/config/host-darwin.c
4+
--- gcc-11.3.0/gcc/config/host-darwin.c 2022-04-21 09:58:52
5+
+++ gcc-11.3.0-patched/gcc/config/host-darwin.c 2024-01-03 00:34:29
6+
@@ -22,6 +22,8 @@
7+
#include "coretypes.h"
8+
#include "diagnostic-core.h"
9+
#include "config/host-darwin.h"
10+
+#include "hosthooks.h"
11+
+#include "hosthooks-def.h"
12+
13+
/* Yes, this is really supposed to work. */
14+
/* This allows for a pagesize of 16384, which we have on Darwin20, but should
15+
@@ -79,3 +81,5 @@
16+
17+
return ret;
18+
}
19+
+
20+
+const struct host_hooks host_hooks = HOST_HOOKS_INITIALIZER;

0 commit comments

Comments
 (0)