summaryrefslogtreecommitdiff
path: root/libquadmath/configure
diff options
context:
space:
mode:
authorIgor Tsimbalist <itsimbal@gcc.gnu.org>2017-11-17 23:36:50 +0100
committerIgor Tsimbalist <itsimbal@gcc.gnu.org>2017-11-17 23:36:50 +0100
commitfda26abecc9a71f75d654776fdd97183f15f7df7 (patch)
tree301126087662937243794b5cafa593feb57091f4 /libquadmath/configure
parentff035ef67334c4a5011d2f28a8b1c5813c1da9d5 (diff)
Enable building libquadmath with Intel CET
libquadmath/ * Makefile.am: Update AM_CFLAGS. * Makefile.in: Regenerate: * acinclude.m4: Add enable.m4 and cet.m4. * configure: Regenerate. * configure.ac: Set CET_FLAGS. Update XCFLAGS. From-SVN: r254899
Diffstat (limited to 'libquadmath/configure')
-rwxr-xr-xlibquadmath/configure78
1 files changed, 76 insertions, 2 deletions
diff --git a/libquadmath/configure b/libquadmath/configure
index b1dc7f38537..b32dcbc8e03 100755
--- a/libquadmath/configure
+++ b/libquadmath/configure
@@ -604,6 +604,7 @@ LIBOBJS
get_gcc_base_ver
GENINSRC_FALSE
GENINSRC_TRUE
+XCFLAGS
BUILD_LIBQUADMATH_FALSE
BUILD_LIBQUADMATH_TRUE
LIBQUAD_USE_SYMVER_SUN_FALSE
@@ -750,6 +751,7 @@ with_gnu_ld
enable_libtool_lock
enable_maintainer_mode
enable_symvers
+enable_cet
enable_generated_files_in_srcdir
with_gcc_major_version_only
'
@@ -1396,6 +1398,8 @@ Optional Features:
--enable-maintainer-mode enable make rules and dependencies not useful
(and sometimes confusing) to the casual installer
--disable-symvers disable symbol versioning for libquadmath
+ --enable-cet enable Intel CET in target libraries
+ [default=default]
--enable-generated-files-in-srcdir
put copies of generated files in source dir intended
for creating source tarballs for users without
@@ -10572,7 +10576,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 10575 "configure"
+#line 10579 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -10678,7 +10682,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 10681 "configure"
+#line 10685 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -12819,6 +12823,76 @@ $as_echo "#define USE_I18N_NUMBER_H 1" >>confdefs.h
fi
+# 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"
+
+
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure