From f0df2e6a641582b1f3885f287be38a9612d558ac Mon Sep 17 00:00:00 2001 From: Martin Probst Date: Fri, 29 Apr 2022 13:20:07 +0200 Subject: [PATCH] Make sure to build x86_64 binaries on Mac. On the new ARM64 Macs, the default target architecture is ARM64. However ARM64 binaries only run on those new Macs, whereas the x86_64 run on both newer and older Macs. The longer term fix might be to have both an x86_64 and a darwin_arm64 binary. --- build.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index dbad708..69dec3a 100755 --- a/build.sh +++ b/build.sh @@ -15,7 +15,13 @@ mkdir -p ~/src/llvm-project/build.release pushd ~/src/llvm-project/build.release echo === Building based on r$(git log -n 1 --pretty=format:"%h") ... -cmake -G Ninja -DCMAKE_BUILD_TYPE=MinSizeRel -DLLVM_ENABLE_PROJECTS=clang ../llvm +cmake -G Ninja \ + -DCMAKE_BUILD_TYPE=MinSizeRel \ + -DLLVM_ENABLE_PROJECTS=clang \ + -DLLVM_TARGET_ARCH=x86_64 \ + -DLLVM_DEFAULT_TARGET_TRIPLE=x86_64-apple-darwin \ + -DCMAKE_OSX_ARCHITECTURES=x86_64 \ + ../llvm ninja clang-format popd