+2020-05-12 H.J. Lu <hongjiu.lu@intel.com>
+
+ Sync with GCC
+ 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-29 H.J. Lu <hongjiu.lu@intel.com>
Sync with GCC
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)
{
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"
fi
if test x$may_have_cet = xyes; then
- if test "$cross_compiling" = yes; 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
conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
- 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"