summaryrefslogtreecommitdiff
path: root/libcc1
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2020-05-14 08:25:39 -0700
committerH.J. Lu <hjl.tools@gmail.com>2020-05-14 09:05:02 -0700
commit8d286dd118a5bd16f7ae0fb9dfcdcfd020bea803 (patch)
treeab2ce2b5fbec75efcf5ac324b2499c81cb95210c /libcc1
parent4036327e4cab5c9a0235bb784b02d5a06a614065 (diff)
x86: Default CET run-time support to auto
CET has been added since GCC 8. This patch defaults CET run-time support to auto. It enables CET run-time support if asssembler supports CET instructions and multi-byte NOPs are enabled via SSE2. config/ * cet.m4 (GCC_CET_FLAGS): Change default to auto. gcc/ * configure: Regenerated. libatomic/ * configure: Regenerated. libbacktrace/ * configure: Regenerated. libcc1/ * configure: Regenerated. libcpp/ * configure: Regenerated. libdecnumber/ * configure: Regenerated. libgcc/ * configure: Regenerated. libgfortran/ * configure: Regenerated. libgomp/ * configure: Regenerated. libitm/ * configure: Regenerated. libobjc/ * configure: Regenerated. libquadmath/ * configure: Regenerated. libsanitizer/ * configure: Regenerated. libssp/ * configure: Regenerated. libstdc++-v3/ * configure: Regenerated. libvtv/ * configure: Regenerated. zlib/ * configure: Regenerated.
Diffstat (limited to 'libcc1')
-rw-r--r--libcc1/ChangeLog4
-rwxr-xr-xlibcc1/configure43
2 files changed, 41 insertions, 6 deletions
diff --git a/libcc1/ChangeLog b/libcc1/ChangeLog
index e31ca9c51ea..24d324629e9 100644
--- a/libcc1/ChangeLog
+++ b/libcc1/ChangeLog
@@ -1,3 +1,7 @@
+2020-05-14 H.J. Lu <hongjiu.lu@intel.com>
+
+ * configure: Regenerated.
+
2020-05-12 H.J. Lu <hongjiu.lu@intel.com>
* Makefile.am (AM_CXXFLAGS): Add $(CET_HOST_FLAGS).
diff --git a/libcc1/configure b/libcc1/configure
index 76377a2b3eb..5e790db36b0 100755
--- a/libcc1/configure
+++ b/libcc1/configure
@@ -14619,10 +14619,35 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
;;
esac
+save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -fcf-protection=none"
+save_LDFLAGS="$LDFLAGS"
+LDFLAGS="$LDFLAGS -Wl,-z,ibt,-z,shstk"
if test x$may_have_cet = xyes; then
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS -Wl,-z,ibt,-z,shstk"
- if test "$cross_compiling" = yes; then :
+ # Check whether -fcf-protection=none -Wl,-z,ibt,-z,shstk work.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ may_have_cet=yes
+else
+ may_have_cet=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+if test x$may_have_cet = xyes; then
+ if test x$cross_compiling = xno; then
+ if test "$cross_compiling" = yes; then :
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot run test program while cross compiling
@@ -14667,10 +14692,14 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
- LDFLAGS="$save_LDFLAGS"
- if test x$enable_cet = xno -a x$have_cet = xyes; then
- as_fn_error $? "Intel CET must be enabled on Intel CET enabled host" "$LINENO" 5
+ if test x$enable_cet = xno -a x$have_cet = xyes; then
+ as_fn_error $? "Intel CET must be enabled on Intel CET enabled host" "$LINENO" 5
+ fi
fi
+else
+ # Enable CET in cross compiler if possible so that it will run on both
+ # CET and non-CET hosts.
+ have_cet=yes
fi
if test x$enable_cet = xyes; then
CET_HOST_FLAGS="-fcf-protection"
@@ -14680,6 +14709,8 @@ else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
+CFLAGS="$save_CFLAGS"
+LDFLAGS="$save_LDFLAGS"