aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/configure
diff options
context:
space:
mode:
authorIgor Tsimbalist <igor.v.tsimbalist@intel.com>2017-11-17 22:28:10 +0100
committerIgor Tsimbalist <itsimbal@gcc.gnu.org>2017-11-17 22:28:10 +0100
commit36101de96474a2c223625dcc28119779e555058f (patch)
tree0e8c03bf34ce53ba661f48691a911ad2036db5ed /libstdc++-v3/configure
parentefe33ced3335418cfec484126fec001a56d958a7 (diff)
downloadgcc-36101de96474a2c223625dcc28119779e555058f.zip
gcc-36101de96474a2c223625dcc28119779e555058f.tar.gz
gcc-36101de96474a2c223625dcc28119779e555058f.tar.bz2
Enable building libstdc++-v3 with Intel CET
libstdc++-v3/ * acinclude.m4: Add cet.m4. * configure.ac: Set CET_FLAGS. Update EXTRA_CFLAGS, EXTRA_CXX_FLAGS. * libsupc++/Makefile.am: Use Add EXTRA_CFLAGS. * Makefile.in: Regenerate. * configure: Likewise. * doc/Makefile.in: Likewise. * include/Makefile.in: Likewise. * libsupc++/Makefile.in: Likewise. * po/Makefile.in: Likewise. * python/Makefile.in: Likewise. * src/Makefile.in: Likewise. * src/c++11/Makefile.in: Likewise. * src/c++98/Makefile.in: Likewise. * src/filesystem/Makefile.in: Likewise. * testsuite/Makefile.in: Likewise. From-SVN: r254895
Diffstat (limited to 'libstdc++-v3/configure')
-rwxr-xr-xlibstdc++-v3/configure94
1 files changed, 85 insertions, 9 deletions
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index 836a6d5..2ae77c9 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -611,6 +611,7 @@ glibcxx_toolexeclibdir
glibcxx_toolexecdir
gxx_include_dir
glibcxx_prefixdir
+EXTRA_CFLAGS
CPU_OPT_BITS_RANDOM
CPU_OPT_EXT_RANDOM
ERROR_CONSTANTS_SRCDIR
@@ -896,6 +897,7 @@ enable_libstdcxx_dual_abi
with_default_libstdcxx_abi
enable_libstdcxx_threads
enable_libstdcxx_filesystem_ts
+enable_cet
with_gxx_include_dir
enable_version_specific_runtime_libs
with_gcc_major_version_only
@@ -1594,6 +1596,8 @@ Optional Features:
enable C++11 threads support [default=auto]
--enable-libstdcxx-filesystem-ts
turns on ISO/IEC TS 18822 support [default=auto]
+ --enable-cet enable Intel CET in target libraries
+ [default=default]
--enable-version-specific-runtime-libs
Specify that runtime libraries should be installed
in a compiler-specific directory
@@ -11601,7 +11605,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11604 "configure"
+#line 11608 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11707,7 +11711,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11710 "configure"
+#line 11714 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -15393,7 +15397,7 @@ $as_echo "$glibcxx_cv_atomic_long_long" >&6; }
# Fake what AC_TRY_COMPILE does.
cat > conftest.$ac_ext << EOF
-#line 15396 "configure"
+#line 15400 "configure"
int main()
{
typedef bool atomic_type;
@@ -15428,7 +15432,7 @@ $as_echo "$glibcxx_cv_atomic_bool" >&6; }
rm -f conftest*
cat > conftest.$ac_ext << EOF
-#line 15431 "configure"
+#line 15435 "configure"
int main()
{
typedef short atomic_type;
@@ -15463,7 +15467,7 @@ $as_echo "$glibcxx_cv_atomic_short" >&6; }
rm -f conftest*
cat > conftest.$ac_ext << EOF
-#line 15466 "configure"
+#line 15470 "configure"
int main()
{
// NB: _Atomic_word not necessarily int.
@@ -15499,7 +15503,7 @@ $as_echo "$glibcxx_cv_atomic_int" >&6; }
rm -f conftest*
cat > conftest.$ac_ext << EOF
-#line 15502 "configure"
+#line 15506 "configure"
int main()
{
typedef long long atomic_type;
@@ -15580,7 +15584,7 @@ $as_echo "$as_me: WARNING: Performance of certain classes will degrade as a resu
# unnecessary for this test.
cat > conftest.$ac_ext << EOF
-#line 15583 "configure"
+#line 15587 "configure"
int main()
{
_Decimal32 d1;
@@ -15622,7 +15626,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
# unnecessary for this test.
cat > conftest.$ac_ext << EOF
-#line 15625 "configure"
+#line 15629 "configure"
template<typename T1, typename T2>
struct same
{ typedef T2 type; };
@@ -15656,7 +15660,7 @@ $as_echo "$enable_int128" >&6; }
rm -f conftest*
cat > conftest.$ac_ext << EOF
-#line 15659 "configure"
+#line 15663 "configure"
template<typename T1, typename T2>
struct same
{ typedef T2 type; };
@@ -81077,6 +81081,78 @@ CPU_OPT_BITS_RANDOM=config/${cpu_opt_bits_random}
+# Add CET specific flags if Intel 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
+
+EXTRA_CXX_FLAGS="$EXTRA_CXX_FLAGS $CET_FLAGS"
+EXTRA_CFLAGS="$EXTRA_CFLAGS $CET_FLAGS"
+
+
+
# Determine cross-compile flags and AM_CONDITIONALs.
#AC_SUBST(GLIBCXX_IS_NATIVE)
#AM_CONDITIONAL(CANADIAN, test $CANADIAN = yes)