Commit 2c7ae013 by H.J. Lu

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.

(cherry picked from commit d17cdc17c90ce77cb90c569322c1f241d3530cec)
parent 2b7784f5
......@@ -111,6 +111,7 @@ if test x$may_have_cet = xyes; then
fi
if test x$may_have_cet = xyes; then
if test x$cross_compiling = xno; then
AC_TRY_RUN([
static void
foo (void)
......@@ -143,6 +144,11 @@ main ()
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"
......
......@@ -5375,6 +5375,7 @@ rm -f core conftest.err conftest.$ac_objext \
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;}
......@@ -5423,6 +5424,11 @@ 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
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"
......
......@@ -5768,6 +5768,7 @@ rm -f core conftest.err conftest.$ac_objext \
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;}
......@@ -5816,6 +5817,11 @@ 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
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"
......@@ -11941,7 +11947,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 11944 "configure"
#line 11950 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
......@@ -12047,7 +12053,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 12050 "configure"
#line 12056 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment