summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2020-05-12 10:39:42 -0700
committerH.J. Lu <hjl.tools@gmail.com>2020-05-12 10:39:54 -0700
commitd17cdc17c90ce77cb90c569322c1f241d3530cec (patch)
tree123c57d341267cdac580408d46ede76879f970bc /config
parent8a6790fb4e5090624fbd71e2b895e6bdd5319fd7 (diff)
downloadgcc-d17cdc17c90ce77cb90c569322c1f241d3530cec.tar.gz
Enable CET in cross compiler if possible
Don't perform CET run-time check for host when cross compiling. Instead, enable CET in cross compiler if possible so that it will run on both CET and non-CET hosts. config/ PR bootstrap/94998 * cet.m4 (GCC_CET_HOST_FLAGS): Enable CET in cross compiler if possible. libiberty/ PR bootstrap/94998 * configure: Regenerated. lto-plugin/ PR bootstrap/94998 * configure: Regenerated.
Diffstat (limited to 'config')
-rw-r--r--config/ChangeLog6
-rw-r--r--config/cet.m418
2 files changed, 18 insertions, 6 deletions
diff --git a/config/ChangeLog b/config/ChangeLog
index 5ab14d97559..8a8b2cbc89a 100644
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -1,3 +1,9 @@
+2020-05-12 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR bootstrap/94998
+ * cet.m4 (GCC_CET_HOST_FLAGS): Enable CET in cross compiler if
+ possible.
+
2020-04-28 H.J. Lu <hongjiu.lu@intel.com>
PR bootstrap/94739
diff --git a/config/cet.m4 b/config/cet.m4
index ea616b728a9..d9608699cd5 100644
--- a/config/cet.m4
+++ b/config/cet.m4
@@ -111,7 +111,8 @@ if test x$may_have_cet = xyes; then
fi
if test x$may_have_cet = xyes; then
- AC_TRY_RUN([
+ if test x$cross_compiling = xno; then
+ AC_TRY_RUN([
static void
foo (void)
{
@@ -137,12 +138,17 @@ main ()
bar ();
return 0;
}
- ],
- [have_cet=no],
- [have_cet=yes])
- if test x$enable_cet = xno -a x$have_cet = xyes; then
- AC_MSG_ERROR([Intel CET must be enabled on Intel CET enabled host])
+ ],
+ [have_cet=no],
+ [have_cet=yes])
+ if test x$enable_cet = xno -a x$have_cet = xyes; then
+ AC_MSG_ERROR([Intel CET must be enabled on Intel CET enabled host])
+ 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
$1="-fcf-protection"