1 commit 9c6e71079b46ad5433165feaa2001450f2017b56
2 Author: Przemysław Buczkowski <prem@prem.moe>
3 Date: Mon Aug 16 13:16:21 2021 +0100
5 GCC: Patch for Apple Silicon compatibility
7 This patch fixes a linker error occuring when compiling
8 the cross-compiler on macOS and ARM64 architecture.
11 https://github.com/richfelker/musl-cross-make/issues/116#issuecomment-823612404
13 Change-Id: Ia3ee98a163bbb62689f42e2da83a5ef36beb0913
14 Reviewed-on: https://review.haiku-os.org/c/buildtools/+/4329
15 Reviewed-by: John Scipione <jscipione@gmail.com>
16 Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
18 --- a/gcc/config/aarch64/aarch64.h
19 +++ b/gcc/config/aarch64/aarch64.h
20 @@ -1290,7 +1290,7 @@ extern const char *aarch64_rewrite_mcpu
21 #define MCPU_TO_MARCH_SPEC_FUNCTIONS \
22 { "rewrite_mcpu", aarch64_rewrite_mcpu },
24 -#if defined(__aarch64__)
25 +#if defined(__aarch64__) && ! defined(__APPLE__)
26 extern const char *host_detect_local_cpu (int argc, const char **argv);
27 #define HAVE_LOCAL_CPU_DETECT
28 # define EXTRA_SPEC_FUNCTIONS \
29 --- a/gcc/config/host-darwin.cc
30 +++ b/gcc/config/host-darwin.cc
33 #include "diagnostic-core.h"
34 #include "config/host-darwin.h"
35 +#include "hosthooks.h"
36 +#include "hosthooks-def.h"
39 /* For Darwin (macOS only) platforms, without ASLR (PIE) enabled on the
40 @@ -181,3 +183,5 @@ darwin_gt_pch_use_address (void *&addr,
45 +const struct host_hooks host_hooks = HOST_HOOKS_INITIALIZER;