Skip to content

Instantly share code, notes, and snippets.

@anjannath
Created May 11, 2022 11:05
Show Gist options
  • Save anjannath/39d4d434031f06b7364551600adc8e8b to your computer and use it in GitHub Desktop.
Save anjannath/39d4d434031f06b7364551600adc8e8b to your computer and use it in GitHub Desktop.
diff --git a/configure.ac b/configure.ac
index f4f2a59d9a..bf0b001e82 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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(
diff --git a/lib/accelerated/aarch64/Makefile.am b/lib/accelerated/aarch64/Makefile.am
index 0c245aca40..aa2cc30431 100644
--- a/lib/accelerated/aarch64/Makefile.am
+++ b/lib/accelerated/aarch64/Makefile.am
@@ -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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment