jedisct1 / libsodium

A modern, portable, easy to use crypto library.

Home Page:https://libsodium.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

clang: error: invalid version number in '-target arm64-apple-ios13.0-macabi'

ghazel opened this issue · comments

apple-cxframcework.sh makes reference to ABIs arm64-apple-ios13.0-macabi/x86_64-apple-ios13.0-macabi specifically:

export CFLAGS="-O2 -arch arm64 -target arm64-apple-ios13.0-macabi -isysroot ${SDK}"

However on modern clang this gives the error clang: error: invalid version number in '-target arm64-apple-ios13.0-macabi'.

Apple clang version 13.1.6 (clang-1316.0.21.2)
Target: x86_64-apple-darwin21.4.0

It is sufficient to remove the 13 from the abi to successfully build the xcframework.

diff --git a/dist-build/apple-xcframework.sh b/dist-build/apple-xcframework.sh
index cf86e088..7f1b1217 100755
--- a/dist-build/apple-xcframework.sh
+++ b/dist-build/apple-xcframework.sh
@@ -256,8 +256,8 @@ build_catalyst() {
 
   ## arm64 catalyst
   if [ "$APPLE_SILICON_SUPPORTED" = "true" ]; then
-    export CFLAGS="-O2 -arch arm64 -target arm64-apple-ios13.0-macabi -isysroot ${SDK}"
-    export LDFLAGS="-arch arm64 -target arm64-apple-ios13.0-macabi -isysroot ${SDK}"
+    export CFLAGS="-O2 -arch arm64 -target arm64-apple-ios-macabi -isysroot ${SDK}"
+    export LDFLAGS="-arch arm64 -target arm64-apple-ios-macabi -isysroot ${SDK}"
 
     make distclean >/dev/null 2>&1
     ./configure --host=arm-apple-ios --prefix="$CATALYST_ARM64_PREFIX" \
@@ -266,8 +266,8 @@ build_catalyst() {
   fi
 
   ## x86_64 catalyst
-  export CFLAGS="-O2 -arch x86_64 -target x86_64-apple-ios13.0-macabi -isysroot ${SDK}"
-  export LDFLAGS="-arch x86_64 -target x86_64-apple-ios13.0-macabi -isysroot ${SDK}"
+  export CFLAGS="-O2 -arch x86_64 -target x86_64-apple-ios-macabi -isysroot ${SDK}"
+  export LDFLAGS="-arch x86_64 -target x86_64-apple-ios-macabi -isysroot ${SDK}"
 
   make distclean >/dev/null 2>&1
   ./configure --host=x86_64-apple-ios --prefix="$CATALYST_X86_64_PREFIX" \

Thank you!