crypto/bn/asm/x86_64-mont*.pl: add missing clang detection.
[openssl.git] / crypto / bn / asm / x86_64-mont5.pl
index fa22c30b1fdd60c75926b61decf87a72cc6edcb6..69e81bf4dd6ff1940da9a1026f94c031d113ebd1 100755 (executable)
@@ -53,6 +53,11 @@ if (!$addx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) &&
        $addx = ($1>=12);
 }
 
+if (!$addx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9])\.([0-9]+)/) {
+       my $ver = $2 + $3/100.0;        # 3.1->3.01, 3.10->3.10
+       $addx = ($ver>=3.03);
+}
+
 # int bn_mul_mont_gather5(
 $rp="%rdi";    # BN_ULONG *rp,
 $ap="%rsi";    # const BN_ULONG *ap,