Handle multiple target events before commit resume
[deliverable/binutils-gdb.git] / config / cet.m4
index 715f4bded19c311ea4159678cfb5862b06a255b7..b53c1bbd5cdef2d3241c192fe01b0ce02af9edcf 100644 (file)
@@ -3,17 +3,26 @@ dnl GCC_CET_FLAGS
 dnl    (SHELL-CODE_HANDLER)
 dnl
 AC_DEFUN([GCC_CET_FLAGS],[dnl
-GCC_ENABLE(cet, default, ,[enable Intel CET in target libraries],
-          permit yes|no|default)
+GCC_ENABLE(cet, no, ,[enable Intel CET in target libraries],
+          permit yes|no|auto)
+AC_MSG_CHECKING([for CET support])
+
 case "$host" in
   i[[34567]]86-*-linux* | x86_64-*-linux*)
     case "$enable_cet" in
-      default)
-       # Check if assembler supports CET.
+      auto)
+       # Check if target supports multi-byte NOPs
+       # and if assembler supports CET insn.
        AC_COMPILE_IFELSE(
         [AC_LANG_PROGRAM(
          [],
-         [asm ("setssbsy");])],
+         [
+#if !defined(__SSE2__)
+#error target does not support multi-byte NOPs
+#else
+asm ("setssbsy");
+#endif
+         ])],
         [enable_cet=yes],
         [enable_cet=no])
        ;;
@@ -33,6 +42,9 @@ case "$host" in
     ;;
 esac
 if test x$enable_cet = xyes; then
-  $1="-fcf-protection -mcet"
+  $1="-fcf-protection -mshstk"
+  AC_MSG_RESULT([yes])
+else
+  AC_MSG_RESULT([no])
 fi
 ])
This page took 0.025053 seconds and 4 git commands to generate.