diff --git a/toolchain/gcc/patches/8.4.0/999-fix-apple-silicon-support.patch b/toolchain/gcc/patches/8.4.0/999-fix-apple-silicon-support.patch new file mode 100644 index 000000000..5e8d84f36 --- /dev/null +++ b/toolchain/gcc/patches/8.4.0/999-fix-apple-silicon-support.patch @@ -0,0 +1,30 @@ +diff -ru a/gcc/config/host-darwin.c b/gcc/config/host-darwin.c +--- a/gcc/config/host-darwin.c 2021-05-14 10:42:08.000000000 +0200 ++++ b/gcc/config/host-darwin.c 2021-08-07 22:51:11.000000000 +0200 +@@ -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. */ + static char pch_address_space[1024*1024*1024] __attribute__((aligned (4096))); +@@ -75,3 +77,5 @@ + + return ret; + } ++ ++const struct host_hooks host_hooks = HOST_HOOKS_INITIALIZER; +diff -ru a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h +--- a/gcc/config/aarch64/aarch64.h 2021-05-14 10:42:08.000000000 +0200 ++++ b/gcc/config/aarch64/aarch64.h 2021-08-10 00:54:13.000000000 +0200 +@@ -1013,7 +1013,7 @@ + #define MCPU_TO_MARCH_SPEC_FUNCTIONS \ + { "rewrite_mcpu", aarch64_rewrite_mcpu }, + +-#if defined(__aarch64__) ++#if defined(__aarch64__) && ! defined(__APPLE__) + extern const char *host_detect_local_cpu (int argc, const char **argv); + #define HAVE_LOCAL_CPU_DETECT + # define EXTRA_SPEC_FUNCTIONS \ \ No newline at end of file