bazel_5: Build xcode-locator as a universal binary only on "aarch64-darwin"

This commit is contained in:
r2r-dev
2022-01-25 01:51:29 +01:00
parent 6cd1a18620
commit 04500fd3a2
2 changed files with 5 additions and 2 deletions
@@ -175,7 +175,10 @@ stdenv.mkDerivation rec {
# This patch removes using the -fobjc-arc compiler option and makes the code
# compile without automatic reference counting. Caveat: this leaks memory, but
# we accept this fact because xcode_locator is only a short-lived process used during the build.
./no-arc.patch
(substituteAll {
src = ./no-arc.patch;
multiBinPatch = if stdenv.hostPlatform.system == "aarch64-darwin" then "-arch arm64 -Wl,-no_adhoc_codesign" else "";
})
# --experimental_strict_action_env (which may one day become the default
# see bazelbuild/bazel#2574) hardcodes the default
@@ -9,7 +9,7 @@ index 990afe3e8c..cd5b7b1b7a 100644
- /usr/bin/xcrun --sdk macosx clang -mmacosx-version-min=10.9 -fobjc-arc -framework CoreServices \
- -framework Foundation -arch arm64 -arch x86_64 -Wl,-no_adhoc_codesign -Wl,-no_uuid -o $@ $< && \
+ /usr/bin/xcrun --sdk macosx clang -mmacosx-version-min=10.9 -framework CoreServices \
+ -framework Foundation -arch x86_64 -Wl,-no_uuid -o $@ $< && \
+ -framework Foundation -arch x86_64 @multiBinPatch@ -Wl,-no_uuid -o $@ $< && \
env -i codesign --identifier $@ --force --sign - $@
"""