aboutsummaryrefslogtreecommitdiff
path: root/config/cet.m4
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2021-03-18 07:54:15 -0700
committerH.J. Lu <hjl.tools@gmail.com>2021-03-18 08:02:46 -0700
commit538c15fc2a29ff142f2ec71d253d4027946ece09 (patch)
treef2001e5ebfe80d2d2ac6a98eebb0e879f473cba3 /config/cet.m4
parent835f2fae11e41956523df3839cd50471b708e97d (diff)
downloadfsf-binutils-gdb-538c15fc2a29ff142f2ec71d253d4027946ece09.zip
fsf-binutils-gdb-538c15fc2a29ff142f2ec71d253d4027946ece09.tar.gz
fsf-binutils-gdb-538c15fc2a29ff142f2ec71d253d4027946ece09.tar.bz2
GCC_CET_HOST_FLAGS: Check if host supports multi-byte NOPs
Check if host supports multi-byte NOPs before enabling CET on host. config/ PR binutils/27397 * cet.m4 (GCC_CET_HOST_FLAGS): Check if host supports multi-byte NOPs. libiberty/ PR binutils/27397 * configure: Regenerated.
Diffstat (limited to 'config/cet.m4')
-rw-r--r--config/cet.m419
1 files changed, 16 insertions, 3 deletions
diff --git a/config/cet.m4 b/config/cet.m4
index c67fb4f..7718be1 100644
--- a/config/cet.m4
+++ b/config/cet.m4
@@ -130,6 +130,18 @@ fi
if test x$may_have_cet = xyes; then
if test x$cross_compiling = xno; then
AC_TRY_RUN([
+int
+main ()
+{
+ asm ("endbr32");
+ return 0;
+}
+ ],
+ [have_multi_byte_nop=yes],
+ [have_multi_byte_nop=no])
+ have_cet=no
+ if test x$have_multi_byte_nop = xyes; then
+ AC_TRY_RUN([
static void
foo (void)
{
@@ -155,9 +167,10 @@ main ()
bar ();
return 0;
}
- ],
- [have_cet=no],
- [have_cet=yes])
+ ],
+ [have_cet=no],
+ [have_cet=yes])
+ fi
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