Skip to content

Commit

Permalink
buildtoolchain: add patch to build modern GCC on ARM64 Apple devices
Browse files Browse the repository at this point in the history
  • Loading branch information
shizmob committed Jan 3, 2024
1 parent 31724a5 commit cdbc093
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions buildtoolchain/buildit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
20 changes: 20 additions & 0 deletions buildtoolchain/gcc-11.3.0.patch
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit cdbc093

Please sign in to comment.