Distinguish AppleClang from LLVM on ARM64

This commit is contained in:
Martin Kroeker
2026-01-13 20:48:02 +01:00
committed by GitHub
parent 10ba0e6044
commit 770ad6883d

View File

@@ -335,7 +335,14 @@ if [ "$architecture" = "arm64" ]; then
fi
no_sme=0
is_appleclang=0
if [ "$architecture" = "arm64" ]; then
if [ "$compiler" = "CLANG" ]; then
data=`$compiler_name --version`
case "$data" in Apple*)
is_appleclang=1
esac
fi
tmpd=$(mktemp -d 2>/dev/null || mktemp -d -t 'OBC')
tmpf="$tmpd/a.S"
printf ".text \n.global sme_test\n\nsme_test:\nsmstart\nsmstop\nret\n">> "$tmpf"
@@ -469,6 +476,7 @@ done
[ "$no_avx512bf" -eq 1 ] && printf "NO_AVX512BF16=1\n"
[ "$no_avx2" -eq 1 ] && printf "NO_AVX2=1\n"
[ "$oldgcc" -eq 1 ] && printf "OLDGCC=1\n"
[ "$is_appleclang" -eq 1 ] && printf "APPLECLANG=1\n"
exit 0
}
@@ -499,6 +507,7 @@ done
[ "$no_avx512bf" -eq 1 ] && printf "NO_AVX512BF16=1\n"
[ "$no_avx2" -eq 1 ] && printf "NO_AVX2=1\n"
[ "$oldgcc" -eq 1 ] && printf "OLDGCC=1\n"
[ "$is_appleclang" -eq 1 ] && printf "APPLECLANG=1\n"
[ "$no_lsx" -eq 1 ] && printf "NO_LSX=1\n"
[ "$no_lasx" -eq 1 ] && printf "NO_LASX=1\n"
} >> "$makefile"