summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2022-08-06 12:52:25 +0200
committerFabian Groffen <grobian@gentoo.org>2022-08-06 12:54:18 +0200
commitef78854564d1927cd8c44099287446049fe7521f (patch)
tree956b9b3346cb127ecd391905792ff813e7c64233
parentdev-python/jsonschema: Keyword 4.9.1 for ~m68k (diff)
downloadgentoo-ef78854564d1927cd8c44099287446049fe7521f.tar.gz
gentoo-ef78854564d1927cd8c44099287446049fe7521f.tar.bz2
gentoo-ef78854564d1927cd8c44099287446049fe7521f.zip
prefix/darwin/macos/arch/arm64: force -O1 where necessary as workaround
The GCC toolchain seems somewhat funky for certain packages, producing objects that the (host) linker doesn't agree with, so for the time being force -O1 as workaround for these few packages. Bug: https://bugs.gentoo.org/778014 Signed-off-by: Fabian Groffen <grobian@gentoo.org>
-rw-r--r--profiles/prefix/darwin/macos/arch/arm64/profile.bashrc26
1 files changed, 18 insertions, 8 deletions
diff --git a/profiles/prefix/darwin/macos/arch/arm64/profile.bashrc b/profiles/prefix/darwin/macos/arch/arm64/profile.bashrc
index 6bfe36915c9d..314c9a7e4f99 100644
--- a/profiles/prefix/darwin/macos/arch/arm64/profile.bashrc
+++ b/profiles/prefix/darwin/macos/arch/arm64/profile.bashrc
@@ -1,4 +1,4 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
pre_src_configure() {
@@ -11,13 +11,23 @@ pre_src_configure() {
# triplets, so patch that for various versions of autoconf
# This bit should be kept in sync with fix_config_sub in
# bootstrap-prefix.sh
- if [[ ${CHOST} == arm64-apple-darwin* ]] ; then
- # Apple Silicon doesn't use aarch64, but arm64
- find . -name "config.sub" | \
- xargs sed -i -e 's/ arm\(-\*\)* / arm\1 | arm64\1 /'
- find . -name "config.sub" | \
- xargs sed -i -e 's/ aarch64 / aarch64 | arm64 /'
- fi
+ # Apple Silicon doesn't use aarch64, but arm64
+ find . -name "config.sub" | \
+ ${XARGS} sed -i -e 's/ arm\(-\*\)* / arm\1 | arm64\1 /'
+ find . -name "config.sub" | \
+ ${XARGS} sed -i -e 's/ aarch64 / aarch64 | arm64 /'
+
+ # currently the toolchain appears to be a bit funky, and generates
+ # code the (host) linker thinks is invalid with -O2 and up:
+ # ld: in section __TEXT,__text reloc 442: symbol index out of range
+ # file 'src/preproc/refer/refer-label.o' for architecture arm64
+ case ${CATEGORY}/${PN} in
+ sys-apps/groff |\
+ app-editors/vim)
+ [[ ${CFLAGS} == *-O[23456789]* ]] && CFLAGS="${CFLAGS} -O1"
+ [[ ${CXXFLAGS} == *-O[23456789]* ]] && CXXFLAGS="${CFLAGS} -O1"
+ ;;
+ esac
popd > /dev/null
}