aboutsummaryrefslogtreecommitdiff
path: root/config/cet.m4
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2020-05-12 18:37:03 -0700
committerH.J. Lu <hjl.tools@gmail.com>2020-05-12 18:37:03 -0700
commit90d00bbd9c514a0fea52d9dc44b98ce1dd564094 (patch)
tree95be8573f0dd17a81fe95b218960074ddd870fda /config/cet.m4
parent09f20ec88626cfba0a3e0ee0f5af80b172986d23 (diff)
downloadbinutils-90d00bbd9c514a0fea52d9dc44b98ce1dd564094.zip
binutils-90d00bbd9c514a0fea52d9dc44b98ce1dd564094.tar.gz
binutils-90d00bbd9c514a0fea52d9dc44b98ce1dd564094.tar.bz2
Sync config and libiberty with GCC
config/ PR bootstrap/94998 * cet.m4 (GCC_CET_HOST_FLAGS): Enable CET in cross compiler if possible. libiberty/ PR bootstrap/94998 * configure: Regenerated.
Diffstat (limited to 'config/cet.m4')
-rw-r--r--config/cet.m418
1 files changed, 12 insertions, 6 deletions
diff --git a/config/cet.m4 b/config/cet.m4
index ea616b7..d960869 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"