summaryrefslogtreecommitdiff
path: root/libitm/acinclude.m4
diff options
context:
space:
mode:
authorro <ro@138bc75d-0d04-0410-961f-82ee72b054a4>2012-01-23 13:03:25 +0000
committerro <ro@138bc75d-0d04-0410-961f-82ee72b054a4>2012-01-23 13:03:25 +0000
commitdffe2d192cf2ab307e74213d13797b9e95c09b6a (patch)
tree51a38715a0e7346a965322711a16d29cd887c919 /libitm/acinclude.m4
parentb94ae734847346812da1f0ad2709fcdaf6d9ab3c (diff)
downloadgcc-dffe2d192cf2ab307e74213d13797b9e95c09b6a.tar.gz
Clear hardware capabilities on libitm.so with Sun ld
* clearcap.map: New file. * acinclude.m4 (LIBITM_CHECK_LINKER_HWCAP): New test. * configure.ac: Call it. Clear HWCAP_LDFLAGS if defaulting to -mavx. * Makefile.am (AM_LDFLAGS): Add $(HWCAP_LDFLAGS) * configure: Regenerate. * Makefile.in: Regenerate. * testsuite/Makefile.in: Regenerate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@183430 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libitm/acinclude.m4')
-rw-r--r--libitm/acinclude.m430
1 files changed, 30 insertions, 0 deletions
diff --git a/libitm/acinclude.m4 b/libitm/acinclude.m4
index 069738d8e80..1031f1f12c8 100644
--- a/libitm/acinclude.m4
+++ b/libitm/acinclude.m4
@@ -261,6 +261,36 @@ 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 by Sun ld at the moment.
+dnl
+dnl Defines:
+dnl HWCAP_LDFLAGS='-Wl,-M,clearcap.map' 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 -Wl,-M,$srcdir/clearcap.map"
+
+ AC_MSG_CHECKING([for ld that supports -Wl,-M,mapfile])
+ AC_TRY_LINK([], [return 0;], [ac_hwcap_ldflags=yes],[ac_hwcap_ldflags=no])
+ if test "$ac_hwcap_ldflags" = "yes"; then
+ HWCAP_LDFLAGS="-Wl,-M,$srcdir/clearcap.map $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