summaryrefslogtreecommitdiffstats
path: root/INSTALL
diff options
context:
space:
mode:
authorRuss Cox <rsc@swtch.com>2022-01-24 13:47:27 -0500
committerRuss Cox <rsc@swtch.com>2022-01-24 13:47:27 -0500
commitbab7b73b85f865d20a5c4f2d78ac9e81b3d39109 (patch)
tree946cb15be31b5d836be5d2ee058823f4998fe72e /INSTALL
parentd0d440860f2000a1560abb3f593cdc325fcead4c (diff)
downloadplan9port-bab7b73b85f865d20a5c4f2d78ac9e81b3d39109.tar.gz
plan9port-bab7b73b85f865d20a5c4f2d78ac9e81b3d39109.zip
INSTALL: build arm64 binaries on arm64 Macs
If there is any x86 binary in the chain of parent processes from the current one, then uname -m prints x86_64 and clang defaults to building x86_64 binaries. Detect arm64 using the kernel version and force building an arm64 toolchain instead of perpetuating x86. This is particularly important when the user shell is rc, which has been built for x86, because then rebuilding under rc continues to use x86.
Diffstat (limited to 'INSTALL')
-rwxr-xr-xINSTALL10
1 files changed, 9 insertions, 1 deletions
diff --git a/INSTALL b/INSTALL
index 79c0745f..92ac1959 100755
--- a/INSTALL
+++ b/INSTALL
@@ -95,7 +95,15 @@ if [ `uname` = Darwin ]; then
echo "See http://swtch.com/go/xcodegcc for details." >&2
exit 1
fi
- echo "CC9='xcrun --sdk macosx clang'" >>$PLAN9/config
+ CC9="xcrun --sdk macosx clang"
+ case "$(uname -a)" in
+ *ARM64*)
+ CC9="$CC9 -arch arm64"
+ echo ' Forcing arm64 binaries with clang.'
+ ;;
+ esac
+
+ echo "CC9='$CC9'" >>$PLAN9/config
rm -f ./a.out
fi