# HG changeset patch
# Parent 652ae1c5b6c997f22956287c4158ac9bef51f7d3
Disable hwcaps on libgfortran
new file mode 100644
@@ -0,0 +1,28 @@
+dnl
+dnl Check if the linker used supports linker maps to clear hardware
+dnl capabilities. This is only supported on Solaris at the moment.
+dnl
+dnl Defines:
+dnl HWCAP_LDFLAGS=-mclear-hwcap if possible
+dnl LD (as a side effect of testing)
+dnl
+AC_DEFUN([GCC_CHECK_LINKER_HWCAP], [
+ test -z "$HWCAP_LDFLAGS" && HWCAP_LDFLAGS=''
+ AC_REQUIRE([AC_PROG_LD])
+
+ ac_save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LFLAGS -mclear-hwcap"
+
+ AC_MSG_CHECKING([for -mclear-hwcap])
+ AC_TRY_LINK([], [return 0;], [ac_hwcap_ldflags=yes],[ac_hwcap_ldflags=no])
+ if test "$ac_hwcap_ldflags" = "yes"; then
+ HWCAP_LDFLAGS="-mclear-hwcap $HWCAP_LDFLAGS"
+ fi
+ AC_MSG_RESULT($ac_hwcap_ldflags)
+
+ LDFLAGS="$ac_save_LDFLAGS"
+
+ AC_SUBST(HWCAP_LDFLAGS)
+
+ AM_CONDITIONAL(HAVE_HWCAP, test $ac_hwcap_ldflags != no)
+])
@@ -38,6 +38,7 @@ toolexeclib_DATA = libgfortran.spec
libgfortran_la_LINK = $(LINK) $(libgfortran_la_LDFLAGS)
libgfortran_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` \
$(LTLDFLAGS) $(LIBQUADLIB) ../libbacktrace/libbacktrace.la \
+ $(HWCAP_LDFLAGS) \
-lm $(extra_ldflags_libgfortran) \
$(version_arg) -Wc,-shared-libgcc
libgfortran_la_DEPENDENCIES = $(version_dep) libgfortran.spec $(LIBQUADLIB_DEP)
@@ -222,6 +222,9 @@ fi
AC_MSG_RESULT($ac_fdsections)
AC_SUBST(SECTION_FLAGS)
+# Check linker hardware capability support.
+GCC_CHECK_LINKER_HWCAP
+
# Find other programs we need.
AC_CHECK_TOOL(AS, as)
AC_CHECK_TOOL(AR, ar)
@@ -300,36 +300,6 @@ AC_DEFUN([LIBITM_CHECK_LINKER_FEATURES],
dnl
-dnl Check if the linker used supports linker maps to clear hardware
-dnl capabilities. This is only supported on Solaris at the moment.
-dnl
-dnl Defines:
-dnl HWCAP_LDFLAGS=-mclear-hwcap if possible
-dnl LD (as a side effect of testing)
-dnl
-AC_DEFUN([LIBITM_CHECK_LINKER_HWCAP], [
- test -z "$HWCAP_LDFLAGS" && HWCAP_LDFLAGS=''
- AC_REQUIRE([AC_PROG_LD])
-
- ac_save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LFLAGS -mclear-hwcap"
-
- AC_MSG_CHECKING([for -mclear-hwcap])
- AC_TRY_LINK([], [return 0;], [ac_hwcap_ldflags=yes],[ac_hwcap_ldflags=no])
- if test "$ac_hwcap_ldflags" = "yes"; then
- HWCAP_LDFLAGS="-mclear-hwcap $HWCAP_LDFLAGS"
- fi
- AC_MSG_RESULT($ac_hwcap_ldflags)
-
- LDFLAGS="$ac_save_LDFLAGS"
-
- AC_SUBST(HWCAP_LDFLAGS)
-
- AM_CONDITIONAL(HAVE_HWCAP, test $ac_hwcap_ldflags != no)
-])
-
-
-dnl
dnl Add version tags to symbols in shared library (or not), additionally
dnl marking other symbols as private/local (or not).
dnl
@@ -215,7 +215,7 @@ LIBITM_CHECK_ATTRIBUTE_DLLEXPORT
LIBITM_CHECK_ATTRIBUTE_ALIAS
# Check linker hardware capability support.
-LIBITM_CHECK_LINKER_HWCAP
+GCC_CHECK_LINKER_HWCAP
# If defaulting to -mavx, don't clear hwcaps.
AC_CHECK_DECL([__AVX__], [HWCAP_LDFLAGS=''])