diff options
author | Marek Habersack <grendel@twistedcode.net> | 2019-01-04 11:26:17 +0300 |
---|---|---|
committer | Marek Habersack <grendel@twistedcode.net> | 2019-01-04 11:32:01 +0300 |
commit | 6ca625c797c7beb121d4c5a22d7e97840c9ae027 (patch) | |
tree | 6bf93d94f58c27e83ee9c96d6da2de97277f0b17 /crypto | |
parent | d637462848e93e1f23399af5d8ace0686373eabb (diff) |
[Android] Fixing the previous clang fix
Turns out that `+neon` architecture extension is required (and accepted) only by
the (buggy) clang 3.x in NDK r14 while both gcc and clang > 3 error out when
they see `+neon`... So, the magic incantation contained in this commit *appears*
to work for all of them. Tested manually with clang 3.x, clang 7.x, gcc
7.x (aarch64 cross-compiler on Linux) and gcc 8.x (aarch64 cross-compiler on
Linux)
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/aes/asm/aesv8-armx.pl | 10 | ||||
-rw-r--r-- | crypto/modes/asm/ghashv8-armx.pl | 10 |
2 files changed, 16 insertions, 4 deletions
diff --git a/crypto/aes/asm/aesv8-armx.pl b/crypto/aes/asm/aesv8-armx.pl index 2e06ee33..89e6f874 100644 --- a/crypto/aes/asm/aesv8-armx.pl +++ b/crypto/aes/asm/aesv8-armx.pl @@ -51,8 +51,14 @@ $code=<<___; .text ___ $code.=<<___ if ($flavour =~ /64/); -#if defined(ANDROID) || !defined(__clang__) -.arch armv8-a+crypto,+neon +#if !defined(__clang__) +.arch armv8-a+crypto +#elif defined(ANDROID) && defined(__clang__) +#if __clang_major__ > 3 +.arch armv8-a+crypto +#else +.arch armv8-a+crypto,+neon +#endif #endif ___ $code.=".arch armv7-a\n.fpu neon\n.code 32\n" if ($flavour !~ /64/); diff --git a/crypto/modes/asm/ghashv8-armx.pl b/crypto/modes/asm/ghashv8-armx.pl index abc2dd3f..73421405 100644 --- a/crypto/modes/asm/ghashv8-armx.pl +++ b/crypto/modes/asm/ghashv8-armx.pl @@ -59,8 +59,14 @@ $code=<<___; .text ___ $code.=<<___ if ($flavour =~ /64/); -#if defined(ANDROID) || !defined(__clang__) -.arch armv8-a+crypto,+neon +#if !defined(__clang__) +.arch armv8-a+crypto +#elif defined(ANDROID) && defined(__clang__) +#if __clang_major__ > 3 +.arch armv8-a+crypto +#else +.arch armv8-a+crypto,+neon +#endif #endif ___ $code.=".fpu neon\n.code 32\n" if ($flavour !~ /64/); |