summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Kivilinna <jussi.kivilinna@iki.fi>2020-12-05 13:47:13 +0200
committerJussi Kivilinna <jussi.kivilinna@iki.fi>2020-12-18 20:20:36 +0200
commit8352b0ece5237e3f86f1525b072e8f690ad0fa94 (patch)
treee355e349d560595087833df4651b0244bc2aa91a
parentc90fb0d8fb7a84bbcc8d6832de6a554405591850 (diff)
downloadlibgcrypt-8352b0ece5237e3f86f1525b072e8f690ad0fa94.tar.gz
aarch64: use configure check for assembly ELF directives support
* configure.ac (gcry_cv_gcc_asm_elf_directives): New check. (HAVE_GCC_ASM_ELF_DIRECTIVES): New 'config.h' macro. * cipher/asm-common-aarch64.h (ELF): Change feature macro check from __ELF__ to HAVE_GCC_ASM_ELF_DIRECTIVES. -- Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
-rw-r--r--cipher/asm-common-aarch64.h2
-rw-r--r--configure.ac20
2 files changed, 21 insertions, 1 deletions
diff --git a/cipher/asm-common-aarch64.h b/cipher/asm-common-aarch64.h
index 4ffc1b71..4e0b6d2e 100644
--- a/cipher/asm-common-aarch64.h
+++ b/cipher/asm-common-aarch64.h
@@ -23,7 +23,7 @@
#include <config.h>
-#ifdef __ELF__
+#ifdef HAVE_GCC_ASM_ELF_DIRECTIVES
# define ELF(...) __VA_ARGS__
#else
# define ELF(...) /*_*/
diff --git a/configure.ac b/configure.ac
index e90d46e4..fda74056 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1225,6 +1225,26 @@ fi
#
+# Check whether GCC assembler supports for ELF directives.
+#
+AC_CACHE_CHECK([whether GCC assembler supports for ELF directives],
+ [gcry_cv_gcc_asm_elf_directives],
+ [gcry_cv_gcc_asm_elf_directives=no
+ AC_LINK_IFELSE([AC_LANG_PROGRAM(
+ [[__asm__(
+ /* Test if ELF directives '.type' and '.size' are supported. */
+ "asmfunc:\n\t"
+ ".size asmfunc,.-asmfunc;\n\t"
+ ".type asmfunc,STT_FUNC;\n\t"
+ );]])],
+ [gcry_cv_gcc_asm_elf_directives=yes])])
+if test "$gcry_cv_gcc_asm_elf_directives" = "yes" ; then
+ AC_DEFINE(HAVE_GCC_ASM_ELF_DIRECTIVES,1,
+ [Defined if underlying assembler supports for ELF directives])
+fi
+
+
+#
# Check whether underscores in symbols are required. This needs to be
# done before setting up the assembler stuff.
#