From 4358f104cf5438bb8c9c4a8070714dd44db94c1e Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Wed, 13 Dec 2017 16:28:25 -0500 Subject: [PATCH] Remove clang assembler .arch workaround. This makes it difficult to build against the NDK's toolchain file. The problem is __clang__ just means Clang is the frontend and implies nothing about which assembler. When using as, it is fine. When using clang-as on Linux, one needs a clang-as from this year. The only places where we case about clang's integrated assembler are iOS (where perlasm strips out .arch anyway) and build environments like Chromium which have a regularly-updated clang. Thus we can remove this now. Bug: 39 Update-Note: Holler if this breaks the build. If it doesn't break the build, you can probably remove any BORINGSSL_CLANG_SUPPORTS_DOT_ARCH or explicit -march armv8-a+crypto lines in your BoringSSL build. Change-Id: I21ce54b14c659830520c2f1d51c7bd13e0980c68 Reviewed-on: https://boringssl-review.googlesource.com/24124 Commit-Queue: Adam Langley Reviewed-by: Adam Langley CQ-Verified: CQ bot account: commit-bot@chromium.org --- BUILDING.md | 12 ------------ crypto/fipsmodule/aes/asm/aesv8-armx.pl | 6 +----- crypto/fipsmodule/modes/asm/ghashv8-armx.pl | 6 +----- 3 files changed, 2 insertions(+), 22 deletions(-) diff --git a/BUILDING.md b/BUILDING.md index eab61e2e..97de4c3d 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -145,18 +145,6 @@ corresponding ARM feature. Note that if a feature is enabled in this way, but not actually supported at run-time, BoringSSL will likely crash. -## Assembling ARMv8 with Clang - -In order to support the ARMv8 crypto instructions, Clang requires that the -architecture be `armv8-a+crypto`. However, setting that as a general build flag -would allow the compiler to assume that crypto instructions are *always* -supported, even without testing for them. - -It's possible to set the architecture in an assembly file using the `.arch` -directive, but only very recent versions of Clang support this. If -`BORINGSSL_CLANG_SUPPORTS_DOT_ARCH` is defined then `.arch` directives will be -used with Clang, otherwise you may need to craft acceptable assembler flags. - # Running tests There are two sets of tests: the C/C++ tests and the blackbox tests. For former diff --git a/crypto/fipsmodule/aes/asm/aesv8-armx.pl b/crypto/fipsmodule/aes/asm/aesv8-armx.pl index ee07a3a7..662814a9 100644 --- a/crypto/fipsmodule/aes/asm/aesv8-armx.pl +++ b/crypto/fipsmodule/aes/asm/aesv8-armx.pl @@ -58,11 +58,7 @@ $code=<<___; #if __ARM_MAX_ARCH__>=7 .text ___ -$code.=<<___ if ($flavour =~ /64/); -#if !defined(__clang__) || defined(BORINGSSL_CLANG_SUPPORTS_DOT_ARCH) -.arch armv8-a+crypto -#endif -___ +$code.=".arch armv8-a+crypto\n" if ($flavour =~ /64/); $code.=<<___ if ($flavour !~ /64/); .arch armv7-a // don't confuse not-so-latest binutils with argv8 :-) .fpu neon diff --git a/crypto/fipsmodule/modes/asm/ghashv8-armx.pl b/crypto/fipsmodule/modes/asm/ghashv8-armx.pl index b1b24810..9bbca104 100644 --- a/crypto/fipsmodule/modes/asm/ghashv8-armx.pl +++ b/crypto/fipsmodule/modes/asm/ghashv8-armx.pl @@ -66,11 +66,7 @@ $code=<<___; .text ___ -$code.=<<___ if ($flavour =~ /64/); -#if !defined(__clang__) || defined(BORINGSSL_CLANG_SUPPORTS_DOT_ARCH) -.arch armv8-a+crypto -#endif -___ +$code.=".arch armv8-a+crypto\n" if ($flavour =~ /64/); $code.=<<___ if ($flavour !~ /64/); .fpu neon .code 32