From 4ece271da5195468a60dd394895b0a5915c8be4c Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Tue, 15 Jun 2021 17:16:51 +0000 Subject: [PATCH] Fix aarch64 targeting and print an error if its disabled --- genbindings.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/genbindings.sh b/genbindings.sh index 812819d..fd1b785 100755 --- a/genbindings.sh +++ b/genbindings.sh @@ -156,11 +156,13 @@ BASE_CFLAGS="$BASE_CFLAGS -frandom-seed=42" LOCAL_CFLAGS="-Wall -Wno-nullability-completeness -pthread -Iinclude/" if [ "$HOST_PLATFORM" = "host: x86_64-apple-darwin" ]; then - LOCAL_CFLAGS="$LOCAL_CFLAGS -isysroot$(xcrun --show-sdk-path)" - BASE_CFLAGS="$BASE_CFLAGS -isysroot$(xcrun --show-sdk-path)" + export MACOSX_DEPLOYMENT_TARGET=10.9 + LOCAL_CFLAGS="$LOCAL_CFLAGS -isysroot$(xcrun --show-sdk-path) -mmacosx-version-min=10.9" + BASE_CFLAGS="$BASE_CFLAGS -isysroot$(xcrun --show-sdk-path) -mmacosx-version-min=10.9" # Targeting aarch64 appears to be supported only starting with Big Sur, so check it before use - clang -o /dev/null -target=aarch64-apple-darwin -mcpu=apple-a14 genbindings_path_map_test_file.c > /dev/null 2>&1 && - export CFLAGS_aarch64_apple_darwin="$BASE_CFLAGS -target=aarch64-apple-darwin -mcpu=apple-a14" + clang -o /dev/null $BASE_CFLAGS --target=aarch64-apple-darwin -mcpu=apple-a14 genbindings_path_map_test_file.c && + export CFLAGS_aarch64_apple_darwin="$BASE_CFLAGS --target=aarch64-apple-darwin -mcpu=apple-a14" || + echo "WARNING: Can not build targeting aarch64-apple-darin. Upgrade to Big Sur or try upstream clang" fi rm genbindings_path_map_test_file.c -- 2.39.5