aboutsummaryrefslogtreecommitdiffstats
path: root/toolchain/gcc/patches/12.1.0/970-macos_arm64-building-fix.patch
diff options
context:
space:
mode:
authorRui Salvaterra <rsalvaterra@gmail.com>2022-05-06 15:42:06 +0100
committerPaul Spooren <mail@aparcar.org>2022-06-01 14:59:49 +0200
commitc4bd303086012afe2aebd213c892363512138bb7 (patch)
treeb8d78ba52ead2356d7af766d802f1524a73d0c08 /toolchain/gcc/patches/12.1.0/970-macos_arm64-building-fix.patch
parent8885cf88279fd131c163d0ac34aeeef0bbff0ceb (diff)
downloadupstream-c4bd303086012afe2aebd213c892363512138bb7.tar.gz
upstream-c4bd303086012afe2aebd213c892363512138bb7.tar.bz2
upstream-c4bd303086012afe2aebd213c892363512138bb7.zip
toolchain: add support for GCC 12
GCC 12.1 is out. Add support for it. Deleted (upstreamed): 011-v12-configure-define-TARGET_LIBC_GNUSTACK-on-musl.patch 931-libffi-fix-MIPS-softfloat-build-issue.patch Deleted (unneeded?) 970-macos_arm64-building-fix.patch Other patches manually rebased due to C++ conversion and consequent file name changing (.c to .cc). Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
Diffstat (limited to 'toolchain/gcc/patches/12.1.0/970-macos_arm64-building-fix.patch')
-rw-r--r--toolchain/gcc/patches/12.1.0/970-macos_arm64-building-fix.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/toolchain/gcc/patches/12.1.0/970-macos_arm64-building-fix.patch b/toolchain/gcc/patches/12.1.0/970-macos_arm64-building-fix.patch
new file mode 100644
index 0000000000..d164d70e88
--- /dev/null
+++ b/toolchain/gcc/patches/12.1.0/970-macos_arm64-building-fix.patch
@@ -0,0 +1,45 @@
+commit 9c6e71079b46ad5433165feaa2001450f2017b56
+Author: Przemysław Buczkowski <prem@prem.moe>
+Date: Mon Aug 16 13:16:21 2021 +0100
+
+ GCC: Patch for Apple Silicon compatibility
+
+ This patch fixes a linker error occuring when compiling
+ the cross-compiler on macOS and ARM64 architecture.
+
+ Adapted from:
+ https://github.com/richfelker/musl-cross-make/issues/116#issuecomment-823612404
+
+ Change-Id: Ia3ee98a163bbb62689f42e2da83a5ef36beb0913
+ Reviewed-on: https://review.haiku-os.org/c/buildtools/+/4329
+ Reviewed-by: John Scipione <jscipione@gmail.com>
+ Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
+
+--- a/gcc/config/aarch64/aarch64.h
++++ b/gcc/config/aarch64/aarch64.h
+@@ -1236,7 +1236,7 @@ extern const char *aarch64_rewrite_mcpu
+ #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 \
+--- a/gcc/config/host-darwin.cc
++++ b/gcc/config/host-darwin.cc
+@@ -22,6 +22,8 @@
+ #include "coretypes.h"
+ #include "diagnostic-core.h"
+ #include "config/host-darwin.h"
++#include "hosthooks.h"
++#include "hosthooks-def.h"
+ #include <errno.h>
+
+ /* For Darwin (macOS only) platforms, without ASLR (PIE) enabled on the
+@@ -79,3 +81,5 @@ darwin_gt_pch_use_address (void *addr, s
+
+ return ret;
+ }
++
++const struct host_hooks host_hooks = HOST_HOOKS_INITIALIZER;