1 |
commit: ef78854564d1927cd8c44099287446049fe7521f |
2 |
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Aug 6 10:52:25 2022 +0000 |
4 |
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Aug 6 10:54:18 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ef788545 |
7 |
|
8 |
prefix/darwin/macos/arch/arm64: force -O1 where necessary as workaround |
9 |
|
10 |
The GCC toolchain seems somewhat funky for certain packages, producing |
11 |
objects that the (host) linker doesn't agree with, so for the time being |
12 |
force -O1 as workaround for these few packages. |
13 |
|
14 |
Bug: https://bugs.gentoo.org/778014 |
15 |
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org> |
16 |
|
17 |
.../prefix/darwin/macos/arch/arm64/profile.bashrc | 26 +++++++++++++++------- |
18 |
1 file changed, 18 insertions(+), 8 deletions(-) |
19 |
|
20 |
diff --git a/profiles/prefix/darwin/macos/arch/arm64/profile.bashrc b/profiles/prefix/darwin/macos/arch/arm64/profile.bashrc |
21 |
index 6bfe36915c9d..314c9a7e4f99 100644 |
22 |
--- a/profiles/prefix/darwin/macos/arch/arm64/profile.bashrc |
23 |
+++ b/profiles/prefix/darwin/macos/arch/arm64/profile.bashrc |
24 |
@@ -1,4 +1,4 @@ |
25 |
-# Copyright 1999-2020 Gentoo Authors |
26 |
+# Copyright 1999-2022 Gentoo Authors |
27 |
# Distributed under the terms of the GNU General Public License v2 |
28 |
|
29 |
pre_src_configure() { |
30 |
@@ -11,13 +11,23 @@ pre_src_configure() { |
31 |
# triplets, so patch that for various versions of autoconf |
32 |
# This bit should be kept in sync with fix_config_sub in |
33 |
# bootstrap-prefix.sh |
34 |
- if [[ ${CHOST} == arm64-apple-darwin* ]] ; then |
35 |
- # Apple Silicon doesn't use aarch64, but arm64 |
36 |
- find . -name "config.sub" | \ |
37 |
- xargs sed -i -e 's/ arm\(-\*\)* / arm\1 | arm64\1 /' |
38 |
- find . -name "config.sub" | \ |
39 |
- xargs sed -i -e 's/ aarch64 / aarch64 | arm64 /' |
40 |
- fi |
41 |
+ # Apple Silicon doesn't use aarch64, but arm64 |
42 |
+ find . -name "config.sub" | \ |
43 |
+ ${XARGS} sed -i -e 's/ arm\(-\*\)* / arm\1 | arm64\1 /' |
44 |
+ find . -name "config.sub" | \ |
45 |
+ ${XARGS} sed -i -e 's/ aarch64 / aarch64 | arm64 /' |
46 |
+ |
47 |
+ # currently the toolchain appears to be a bit funky, and generates |
48 |
+ # code the (host) linker thinks is invalid with -O2 and up: |
49 |
+ # ld: in section __TEXT,__text reloc 442: symbol index out of range |
50 |
+ # file 'src/preproc/refer/refer-label.o' for architecture arm64 |
51 |
+ case ${CATEGORY}/${PN} in |
52 |
+ sys-apps/groff |\ |
53 |
+ app-editors/vim) |
54 |
+ [[ ${CFLAGS} == *-O[23456789]* ]] && CFLAGS="${CFLAGS} -O1" |
55 |
+ [[ ${CXXFLAGS} == *-O[23456789]* ]] && CXXFLAGS="${CFLAGS} -O1" |
56 |
+ ;; |
57 |
+ esac |
58 |
|
59 |
popd > /dev/null |
60 |
} |