aboutsummaryrefslogtreecommitdiff
path: root/libmpx/configure
diff options
context:
space:
mode:
authorIgor Tsimbalist <itsimbal@gcc.gnu.org>2017-11-17 23:41:10 +0100
committerIgor Tsimbalist <itsimbal@gcc.gnu.org>2017-11-17 23:41:10 +0100
commitabccc074bb741574b00b078277b711194310c497 (patch)
tree97acddd4eaed58045b878032b231aee06c51efce /libmpx/configure
parentfda26abecc9a71f75d654776fdd97183f15f7df7 (diff)
downloadgcc-abccc074bb741574b00b078277b711194310c497.zip
gcc-abccc074bb741574b00b078277b711194310c497.tar.gz
gcc-abccc074bb741574b00b078277b711194310c497.tar.bz2
Enable building libmpx with Intel CET
libmpx/ * Makefile.in: Regenerate. * acinclude.m4: Add enable.m4 and cet.m4. * configure: Regenerate. * configure.ac: Set CET_FLAGS. Update XCFLAGS. * mpxrt/Makefile.am: Update libmpx_la_CFLAGS. * mpxrt/Makefile.in: Regenerate. * mpxwrap/Makefile.am: Add AM_CFLAGS. Update libmpxwrappers_la_CFLAGS. * mpxwrap/Makefile.in: Regenerate. From-SVN: r254900
Diffstat (limited to 'libmpx/configure')
-rw-r--r--libmpx/configure76
1 files changed, 74 insertions, 2 deletions
diff --git a/libmpx/configure b/libmpx/configure
index 853993a..7bc68b8 100644
--- a/libmpx/configure
+++ b/libmpx/configure
@@ -732,6 +732,7 @@ with_pic
enable_fast_install
with_gnu_ld
enable_libtool_lock
+enable_cet
with_gcc_major_version_only
'
ac_precious_vars='build_alias
@@ -1372,6 +1373,8 @@ Optional Features:
--enable-fast-install[=PKGS]
optimize for fast installation [default=yes]
--disable-libtool-lock avoid locking (might break parallel builds)
+ --enable-cet enable Intel CET in target libraries
+ [default=default]
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
@@ -11234,7 +11237,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11237 "configure"
+#line 11240 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11340,7 +11343,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11343 "configure"
+#line 11346 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11581,6 +11584,75 @@ CC="$lt_save_CC"
XCFLAGS="-Wall -Wextra"
+# 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"
+
if test "${multilib}" = "yes"; then