From 12bfc7b3fc0660d2419131ad512903c2080f999a Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Sat, 24 Jul 2021 03:11:29 +0200 Subject: [PATCH] Toolchain+Ports: Ignore -arch on macOS M1 hosts CMake specifies -arch arm64 for our toolchain. Unfortunately that's an option GCC only understands when built for macOS. This causes the build to fail. I haven't been able to get CMake to not specify that option so this adds a dummy option to GCC. --- Ports/gcc/patches/gcc.patch | 14 +++++++++++++- Toolchain/Patches/gcc.patch | 14 +++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/Ports/gcc/patches/gcc.patch b/Ports/gcc/patches/gcc.patch index f3b7ed7451..4c6151743b 100644 --- a/Ports/gcc/patches/gcc.patch +++ b/Ports/gcc/patches/gcc.patch @@ -6330,4 +6330,16 @@ diff -Naur gcc-11.1.0/gcc/config/host-darwin.c gcc-11.1.0.serenity/gcc/config/ho +const struct host_hooks host_hooks = HOST_HOOKS_INITIALIZER; /* Yes, this is really supposed to work. */ - /* This allows for a pagesize of 16384, which we have on Darwin20, but should \ No newline at end of file + /* This allows for a pagesize of 16384, which we have on Darwin20, but should +diff -Naur gcc-11.1.0/gcc/common.opt gcc-11.1.0.serenity/gcc/common.opt +--- gcc-11.1.0/gcc/common.opt 2021-07-24 02:52:10.000000000 +0200 ++++ gcc-11.1.0.serenity/gcc/common.opt 2021-04-27 12:00:13.000000000 +0200 +@@ -3490,4 +3490,8 @@ + Common Var(flag_ipa_ra) Optimization + Use caller save register across calls if possible. + ++arch ++Driver Ignore Separate ++-arch Generate output for architecture . ++ + ; This comment is to ensure we retain the blank line above. diff --git a/Toolchain/Patches/gcc.patch b/Toolchain/Patches/gcc.patch index f3b7ed7451..4c6151743b 100644 --- a/Toolchain/Patches/gcc.patch +++ b/Toolchain/Patches/gcc.patch @@ -6330,4 +6330,16 @@ diff -Naur gcc-11.1.0/gcc/config/host-darwin.c gcc-11.1.0.serenity/gcc/config/ho +const struct host_hooks host_hooks = HOST_HOOKS_INITIALIZER; /* Yes, this is really supposed to work. */ - /* This allows for a pagesize of 16384, which we have on Darwin20, but should \ No newline at end of file + /* This allows for a pagesize of 16384, which we have on Darwin20, but should +diff -Naur gcc-11.1.0/gcc/common.opt gcc-11.1.0.serenity/gcc/common.opt +--- gcc-11.1.0/gcc/common.opt 2021-07-24 02:52:10.000000000 +0200 ++++ gcc-11.1.0.serenity/gcc/common.opt 2021-04-27 12:00:13.000000000 +0200 +@@ -3490,4 +3490,8 @@ + Common Var(flag_ipa_ra) Optimization + Use caller save register across calls if possible. + ++arch ++Driver Ignore Separate ++-arch Generate output for architecture . ++ + ; This comment is to ensure we retain the blank line above.