Fix building with clang on ARM64/FreeBSD
authorJussi Kivilinna <jussi.kivilinna@iki.fi>
Sun, 26 Feb 2017 17:55:34 +0000 (19:55 +0200)
committerJussi Kivilinna <jussi.kivilinna@iki.fi>
Mon, 27 Feb 2017 18:15:38 +0000 (20:15 +0200)
* cipher/cipher-gcm-armv8-aarch64-ce.S: Use '.cpu generic+simd+crypto'
instead of '.arch armv8-a+crypto'.
* cipher/rijndael-armv8-aarch64-ce.S: Ditto.
* cipher/sha1-armv8-aarch64-ce.S: Ditto.
* cipher/sha256-armv8-aarch64-ce.S: Ditto.
* configure.ac (gcry_cv_gcc_inline_asm_aarch64_neon): Ditto.
(gcry_cv_gcc_inline_asm_aarch64_crypto): Ditto; and include NEON
instructions to crypto instructions check.
--

GnuPG-bug-id: 2975
Reported-by: Kirill Ponomarev <kp@krion.cc>
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
cipher/cipher-gcm-armv8-aarch64-ce.S
cipher/rijndael-armv8-aarch64-ce.S
cipher/sha1-armv8-aarch64-ce.S
cipher/sha256-armv8-aarch64-ce.S
configure.ac

index 4830b61..0cfaf1c 100644 (file)
@@ -23,7 +23,7 @@
     defined(HAVE_COMPATIBLE_GCC_AARCH64_PLATFORM_AS) && \
     defined(HAVE_GCC_INLINE_ASM_AARCH64_CRYPTO)
 
-.arch armv8-a+crypto
+.cpu generic+simd+crypto
 
 .text
 
index 1ebb363..708ef34 100644 (file)
@@ -23,7 +23,7 @@
     defined(HAVE_COMPATIBLE_GCC_AARCH64_PLATFORM_AS) && \
     defined(HAVE_GCC_INLINE_ASM_AARCH64_CRYPTO)
 
-.arch armv8-a+crypto
+.cpu generic+simd+crypto
 
 .text
 
index dcc33a3..ec1810d 100644 (file)
@@ -23,7 +23,7 @@
     defined(HAVE_COMPATIBLE_GCC_AARCH64_PLATFORM_AS) && \
     defined(HAVE_GCC_INLINE_ASM_AARCH64_CRYPTO) && defined(USE_SHA1)
 
-.arch armv8-a+crypto
+.cpu generic+simd+crypto
 
 .text
 
index 257204f..a4575da 100644 (file)
@@ -23,7 +23,7 @@
     defined(HAVE_COMPATIBLE_GCC_AARCH64_PLATFORM_AS) && \
     defined(HAVE_GCC_INLINE_ASM_AARCH64_CRYPTO) && defined(USE_SHA256)
 
-.arch armv8-a+crypto
+.cpu generic+simd+crypto
 
 .text
 
index bc5bed4..6b85abe 100644 (file)
@@ -1649,7 +1649,7 @@ AC_CACHE_CHECK([whether GCC inline assembler supports AArch64 NEON instructions]
           gcry_cv_gcc_inline_asm_aarch64_neon=no
           AC_COMPILE_IFELSE([AC_LANG_SOURCE(
           [[__asm__(
-                ".arch armv8-a\n\t"
+                ".cpu generic+simd\n\t"
                 "mov w0, \#42;\n\t"
                 "dup v0.8b, w0;\n\t"
                 "ld4 {v0.8b,v1.8b,v2.8b,v3.8b},[x0],\#32;\n\t"
@@ -1674,7 +1674,11 @@ AC_CACHE_CHECK([whether GCC inline assembler supports AArch64 Crypto Extension i
           gcry_cv_gcc_inline_asm_aarch64_crypto=no
           AC_COMPILE_IFELSE([AC_LANG_SOURCE(
           [[__asm__(
-                ".arch armv8-a+crypto\n\t"
+                ".cpu generic+simd+crypto\n\t"
+
+                "mov w0, \#42;\n\t"
+                "dup v0.8b, w0;\n\t"
+                "ld4 {v0.8b,v1.8b,v2.8b,v3.8b},[x0],\#32;\n\t"
 
                 "sha1h s0, s0;\n\t"
                 "sha1c q0, s0, v0.4s;\n\t"