diff options
author | Tomas Mraz <tomas@openssl.org> | 2023-03-15 16:49:24 +0100 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2023-03-17 11:25:25 +0100 |
commit | 2dbddfab08ed5464f9408f6f870c727c89835e5a (patch) | |
tree | 7356349b006a07bd84c2d2e7c81683a6b566fbef /crypto | |
parent | 6dfa998f7ea150f9c6d4e4727cf6d5c82a68a8da (diff) | |
download | openssl-new-2dbddfab08ed5464f9408f6f870c727c89835e5a.tar.gz |
aes-gcm-avx512.pl: Fix the clang version detection on Apple Oses
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20519)
(cherry picked from commit 110dac578358014c29b86cf18d9a4bfe5561e3bc)
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/modes/asm/aes-gcm-avx512.pl | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/crypto/modes/asm/aes-gcm-avx512.pl b/crypto/modes/asm/aes-gcm-avx512.pl index 122183b4ff..41d91ef710 100644 --- a/crypto/modes/asm/aes-gcm-avx512.pl +++ b/crypto/modes/asm/aes-gcm-avx512.pl @@ -59,8 +59,17 @@ if (!$avx512vaes $avx512vaes = ($1 == 2.13 && $2 >= 3) + ($1 >= 2.14); } -if (!$avx512vaes && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on LLVM) ([0-9]+\.[0-9]+)/) { - $avx512vaes = ($2 >= 7.0); +if (!$avx512vaes && `$ENV{CC} -v 2>&1` + =~ /(Apple)?\s*((?:clang|LLVM) version|.*based on LLVM) ([0-9]+)\.([0-9]+)\.([0-9]+)?/) { + my $ver = $3 + $4/100.0 + $5/10000.0; # 3.1.0->3.01, 3.10.1->3.1001 + if ($1) { + # Apple conditions, they use a different version series, see + # https://en.wikipedia.org/wiki/Xcode#Xcode_7.0_-_10.x_(since_Free_On-Device_Development)_2 + # clang 7.0.0 is Apple clang 10.0.1 + $avx512vaes = ($ver>=10.0001) + } else { + $avx512vaes = ($ver>=7.0); + } } open OUT, "| \"$^X\" \"$xlate\" $flavour \"$output\"" |