summaryrefslogtreecommitdiff
path: root/libitm/configure
diff options
context:
space:
mode:
authorIgor Tsimbalist <igor.v.tsimbalist@intel.com>2017-11-17 23:59:41 +0100
committerIgor Tsimbalist <itsimbal@gcc.gnu.org>2017-11-17 23:59:41 +0100
commitc51081fc9f11848aa17d27dfb4224bf2ef32bacc (patch)
tree0994081391208ea323516829be75444e885ff12c /libitm/configure
parentcc03e55b5aced4f0e948f09d29f116ead8ded943 (diff)
downloadgcc-c51081fc9f11848aa17d27dfb4224bf2ef32bacc.tar.gz
Enable building libitm with Intel CET
libitm/ * Makefile.in: Regenerate. * acinclude.m4: Add enable.m4 and cet.m4. * config/x86/sjlj.S: Include cet.h. (_ITM_beginTransaction): Add _CET_ENDBR. Save Shadow Stack pointer. (GTM_longjmp): Add _CET_ENDBR. Restore Shadow Stack pointer. * config/x86/target.h (struct gtm_jmpbuf): Add new field for Shadow Stack pointer. * configure: Regenerate. * configure.ac: Set CET_FLAGS. Update XCFLAGS. * configure.ac: Update libtool_VERSION for x86. * testsuite/Makefile.in: Regenerate. From-SVN: r254908
Diffstat (limited to 'libitm/configure')
-rw-r--r--libitm/configure76
1 files changed, 74 insertions, 2 deletions
diff --git a/libitm/configure b/libitm/configure
index 775f370fbb5..d061c8c2659 100644
--- a/libitm/configure
+++ b/libitm/configure
@@ -777,6 +777,7 @@ enable_maintainer_mode
enable_linux_futex
enable_tls
enable_symvers
+enable_cet
with_gcc_major_version_only
'
ac_precious_vars='build_alias
@@ -1426,6 +1427,8 @@ Optional Features:
--enable-tls Use thread-local storage [default=yes]
--enable-symvers=STYLE enables symbol versioning of the shared library
[default=yes]
+ --enable-cet enable Intel CET in target libraries
+ [default=default]
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
@@ -11794,7 +11797,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11797 "configure"
+#line 11800 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11900,7 +11903,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11903 "configure"
+#line 11906 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -17586,6 +17589,75 @@ fi
XCFLAGS="$XCFLAGS $XPCFLAGS"
+# Add CET specific flags if CET is enabled
+ # Check whether --enable-cet was given.
+if test "${enable_cet+set}" = set; then :
+ enableval=$enable_cet;
+ case "$enableval" in
+ yes|no|default) ;;
+ *) as_fn_error "Unknown argument to enable/disable cet" "$LINENO" 5 ;;
+ esac
+
+else
+ enable_cet=default
+fi
+
+
+case "$host" in
+ i[34567]86-*-linux* | x86_64-*-linux*)
+ case "$enable_cet" in
+ default)
+ # Check if assembler supports CET.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+asm ("setssbsy");
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ enable_cet=yes
+else
+ enable_cet=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ;;
+ yes)
+ # Check if assembler supports CET.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+asm ("setssbsy");
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ as_fn_error "assembler with CET support is required for --enable-cet" "$LINENO" 5
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ;;
+ esac
+ ;;
+ *)
+ enable_cet=no
+ ;;
+esac
+if test x$enable_cet = xyes; then
+ CET_FLAGS="-fcf-protection -mcet"
+fi
+
+XCFLAGS="$XCFLAGS $CET_FLAGS"
+