From a91fd063cf87b905a4d3b06387727deb4a7016d0 Mon Sep 17 00:00:00 2001 From: Adam Langley Date: Mon, 20 Apr 2015 12:20:37 -0700 Subject: [PATCH] Don't use .arch in aarch64 asm with Clang. Clang (3.6, at least) doesn't like .arch when its internal as is used. Instead, one has to pass -march=armv8-a+crypto on the command line. Change-Id: Ifc5b57fbebd0eb53658481b0a0c111e808c81d93 Reviewed-on: https://boringssl-review.googlesource.com/4411 Reviewed-by: Adam Langley --- crypto/aes/asm/aesv8-armx.pl | 6 +++++- crypto/modes/asm/ghashv8-armx.pl | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/crypto/aes/asm/aesv8-armx.pl b/crypto/aes/asm/aesv8-armx.pl index 9844ca1a..b0916f66 100644 --- a/crypto/aes/asm/aesv8-armx.pl +++ b/crypto/aes/asm/aesv8-armx.pl @@ -50,7 +50,11 @@ $code=<<___; #if __ARM_MAX_ARCH__>=7 .text ___ -$code.=".arch armv8-a+crypto\n" if ($flavour =~ /64/); +$code.=<<___ if ($flavour =~ /64/); +#if !defined(__clang__) +.arch armv8-a+crypto +#endif +___ $code.=".arch armv7-a\n.fpu neon\n.code 32\n" if ($flavour !~ /64/); #^^^^^^ this is done to simplify adoption by not depending # on latest binutils. diff --git a/crypto/modes/asm/ghashv8-armx.pl b/crypto/modes/asm/ghashv8-armx.pl index 3750d251..686951fd 100644 --- a/crypto/modes/asm/ghashv8-armx.pl +++ b/crypto/modes/asm/ghashv8-armx.pl @@ -58,7 +58,11 @@ $code=<<___; .text ___ -$code.=".arch armv8-a+crypto\n" if ($flavour =~ /64/); +$code.=<<___ if ($flavour =~ /64/); +#if !defined(__clang__) +.arch armv8-a+crypto +#endif +___ $code.=".fpu neon\n.code 32\n" if ($flavour !~ /64/); ################################################################################