Skip to content

Commit 770ad68

Browse files
authored
Distinguish AppleClang from LLVM on ARM64
1 parent 10ba0e6 commit 770ad68

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

c_check

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,14 @@ if [ "$architecture" = "arm64" ]; then
335335
fi
336336

337337
no_sme=0
338+
is_appleclang=0
338339
if [ "$architecture" = "arm64" ]; then
340+
if [ "$compiler" = "CLANG" ]; then
341+
data=`$compiler_name --version`
342+
case "$data" in Apple*)
343+
is_appleclang=1
344+
esac
345+
fi
339346
tmpd=$(mktemp -d 2>/dev/null || mktemp -d -t 'OBC')
340347
tmpf="$tmpd/a.S"
341348
printf ".text \n.global sme_test\n\nsme_test:\nsmstart\nsmstop\nret\n">> "$tmpf"
@@ -469,6 +476,7 @@ done
469476
[ "$no_avx512bf" -eq 1 ] && printf "NO_AVX512BF16=1\n"
470477
[ "$no_avx2" -eq 1 ] && printf "NO_AVX2=1\n"
471478
[ "$oldgcc" -eq 1 ] && printf "OLDGCC=1\n"
479+
[ "$is_appleclang" -eq 1 ] && printf "APPLECLANG=1\n"
472480
exit 0
473481
}
474482

@@ -499,6 +507,7 @@ done
499507
[ "$no_avx512bf" -eq 1 ] && printf "NO_AVX512BF16=1\n"
500508
[ "$no_avx2" -eq 1 ] && printf "NO_AVX2=1\n"
501509
[ "$oldgcc" -eq 1 ] && printf "OLDGCC=1\n"
510+
[ "$is_appleclang" -eq 1 ] && printf "APPLECLANG=1\n"
502511
[ "$no_lsx" -eq 1 ] && printf "NO_LSX=1\n"
503512
[ "$no_lasx" -eq 1 ] && printf "NO_LASX=1\n"
504513
} >> "$makefile"

0 commit comments

Comments
 (0)