From 538c15fc2a29ff142f2ec71d253d4027946ece09 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Thu, 18 Mar 2021 07:54:15 -0700 Subject: 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. --- config/cet.m4 | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'config/cet.m4') 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 -- cgit v1.1