summaryrefslogtreecommitdiff
path: root/libiberty/configure
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2021-02-12 16:30:23 -0800
committerH.J. Lu <hjl.tools@gmail.com>2021-05-03 05:00:05 -0700
commitfd7eb4bc94cafa745eba75c64fa483a1689a5aad (patch)
treefe9a68be3e55f37d4353b944e77a472dcbf4f5d4 /libiberty/configure
parent4f48c335d36674f90046b2823f0ac1c0545dc082 (diff)
GCC_CET_HOST_FLAGS: Check if host supports multi-byte NOPs
Sync with binutils for PR binutils/27397. Check if host supports multi-byte NOPs before enabling CET on host. config/ PR bootstrap/99703 * cet.m4 (GCC_CET_HOST_FLAGS): Check if host supports multi-byte NOPs. libiberty/ PR bootstrap/99703 * configure: Regenerated.
Diffstat (limited to 'libiberty/configure')
-rwxr-xr-xlibiberty/configure29
1 files changed, 29 insertions, 0 deletions
diff --git a/libiberty/configure b/libiberty/configure
index 2ea7c119809..fc0c953dd1a 100755
--- a/libiberty/configure
+++ b/libiberty/configure
@@ -5396,6 +5396,34 @@ else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+int
+main ()
+{
+ asm ("endbr32");
+ return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ have_multi_byte_nop=yes
+else
+ have_multi_byte_nop=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ have_cet=no
+ if test x$have_multi_byte_nop = xyes; 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
+See \`config.log' for more details" "$LINENO" 5; }
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
static void
foo (void)
{
@@ -5432,6 +5460,7 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
+ 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