[AArch64] Fix frame tests
[gcc.git] / config / hwcaps.m4
index e78c49c46d4623b49cee71bcdfb4560d0a9fc2c5..ff352fdd3a69537e72c3115228ba758c13b6a870 100644 (file)
@@ -1,3 +1,35 @@
+dnl
+dnl Check if the assembler used supports disabling generation of hardware
+dnl capabilities.  This is only supported by Solaris as at the moment.
+dnl
+dnl Defines:
+dnl  HWCAP_CFLAGS='-Wa,-nH' if possible.
+dnl
+AC_DEFUN([GCC_CHECK_ASSEMBLER_HWCAP], [
+  test -z "$HWCAP_CFLAGS" && HWCAP_CFLAGS=''
+
+  # Restrict the test to Solaris, other assemblers (e.g. AIX as) have -nH
+  # with a different meaning.
+  case ${target_os} in
+    solaris2*)
+      ac_save_CFLAGS="$CFLAGS"
+      CFLAGS="$CFLAGS -Wa,-nH"
+
+      AC_MSG_CHECKING([for as that supports -Wa,-nH])
+      AC_TRY_COMPILE([], [return 0;], [ac_hwcap_flags=yes],[ac_hwcap_flags=no])
+      if test "$ac_hwcap_flags" = "yes"; then
+       HWCAP_CFLAGS="-Wa,-nH $HWCAP_CFLAGS"
+      fi
+      AC_MSG_RESULT($ac_hwcap_flags)
+
+      CFLAGS="$ac_save_CFLAGS"
+      ;;
+  esac
+
+  AC_SUBST(HWCAP_CFLAGS)
+])
+
+
 dnl
 dnl Check if the linker used supports linker maps to clear hardware
 dnl capabilities.  This is only supported on Solaris at the moment.