-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump gcc to 11.4 for macOS M1 support
Recent M1 SoC can be supported by bumping gcc to a recent version with macOS arm support. Tweak the Makefile and compile flags to build succesfully for this new architecture. Ref dciabrin/homebrew-ngdevkit#4
- Loading branch information
Showing
2 changed files
with
80 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
From 9c6e71079b46ad5433165feaa2001450f2017b56 Mon Sep 17 00:00:00 2001 | ||
From: =?UTF-8?q?Przemys=C5=82aw=20Buczkowski?= <[email protected]> | ||
Date: Mon, 16 Aug 2021 13:16:21 +0100 | ||
Subject: [PATCH] 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 <[email protected]> | ||
Reviewed-by: Adrien Destugues <[email protected]> | ||
--- | ||
gcc/config/aarch64/aarch64.h | 2 +- | ||
gcc/config/host-darwin.c | 4 ++++ | ||
2 files changed, 5 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h | ||
index 976f9afae5..736b83ff0b 100644 | ||
--- a/gcc/config/aarch64/aarch64.h | ||
+++ b/gcc/config/aarch64/aarch64.h | ||
@@ -1000,7 +1000,7 @@ extern const char *aarch64_rewrite_mcpu (int argc, const char **argv); | ||
#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 \ | ||
diff --git a/gcc/config/host-darwin.c b/gcc/config/host-darwin.c | ||
index 8f700eec85..b737abc006 100644 | ||
--- a/gcc/config/host-darwin.c | ||
+++ b/gcc/config/host-darwin.c | ||
@@ -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 @@ darwin_gt_pch_use_address (void *addr, size_t sz, int fd, size_t off) | ||
|
||
return ret; | ||
} | ||
+ | ||
+const struct host_hooks host_hooks = HOST_HOOKS_INITIALIZER; | ||
-- | ||
2.39.2 | ||
|