]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
configure.ac: check if compiler supports -Wa,-march=all
authorDaiki Ueno <ueno@gnu.org>
Fri, 29 Apr 2022 10:01:53 +0000 (12:01 +0200)
committerDaiki Ueno <ueno@gnu.org>
Fri, 6 May 2022 08:08:48 +0000 (10:08 +0200)
Clang from LLVM 13.0.0 caused a segumentation fault if an unknown
architecture is supplied through -march.  While this has been fixed in
13.0.1, until it is widely deployed this adds a configure check as a
safeguard:
https://github.com/llvm/llvm-project/commit/d31f8cc6884ba3cc3e088fd57c4c533868e8a8b2

Signed-off-by: Daiki Ueno <ueno@gnu.org>
configure.ac
lib/accelerated/aarch64/Makefile.am

index f4f2a59d9a07eaa2288f85743405b09183f9edfe..bf0b001e820d9d7ebb968f7babc81bce2a297835 100644 (file)
@@ -203,6 +203,20 @@ case $host_cpu in
   ;;
 esac
 
+# Check if the assembler supports -march=all
+if test "$hw_accel" = aarch64; then
+  AARCH64_CCASFLAGS="-Wa,-march=all"
+  AC_MSG_CHECKING([whether the compiler supports -Wa,-march=all])
+  : > conftest.s
+  if "$CCAS" "$AARCH64_CCASFLAGS" -c conftest.s >/dev/null 2>&1; then
+    AC_MSG_RESULT(yes)
+  else
+    AC_MSG_RESULT(no)
+    AARCH64_CCASFLAGS=
+  fi
+  AC_SUBST(AARCH64_CCASFLAGS)
+fi
+
 # check for gcc's __get_cpuid_count functionality
 AC_MSG_CHECKING([for __get_cpuid_count])
 AC_LINK_IFELSE(
index 0c245aca4074b7c0e56b839f91e256dd01166361..aa2cc3043141916facfc7090e2e70eedb46a31fb 100644 (file)
@@ -34,7 +34,7 @@ AM_CPPFLAGS += -I$(srcdir)/../../minitasn1
 endif
 
 #ensure that we have all aarch64 instruction sets enabled for the assembler
-AM_CCASFLAGS = -Wa,-march=all
+AM_CCASFLAGS = $(AARCH64_CCASFLAGS)
 
 EXTRA_DIST = README