https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84148

--- Comment #13 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to igor.v.tsimbalist from comment #11)
> Created attachment 43408 [details]
> patch #2

case "$host" in
-  i[[34567]]86-*-linux* | x86_64-*-linux*)
-    case "$enable_cet" in
-      default)
-       # Check if assembler supports CET.
-       AC_COMPILE_IFELSE(
-        [AC_LANG_PROGRAM(
-         [],
-         [asm ("setssbsy");])],
-        [enable_cet=yes],
-        [enable_cet=no])
-       ;;
-      yes)
-       # Check if assembler supports CET.
-       AC_COMPILE_IFELSE(
-        [AC_LANG_PROGRAM(
+AC_MSG_CHECKING([for CET support])
+
+# Adjust the default value.
+if test x$enable_cet = xdefault; then
+  case "$host" in
+    i[[34567]]86-*-linux* | x86_64-*-linux*)
+      # Check if processor supports multi-byte NOPs.
+      AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+         [
+#if !defined(__SSE2__)
+#error compiler does not support multi-byte NOPs
       ^^^^^^^^ Change it to target.  Please simply merge it with

asm ("setssbsy");

Just do

#if !defined(__SSE2__)
#error target does not support multi-byte NOPs
#else
  asm ("setssbsy");
#endif

+#endif
+         ],
+         [])],
+       [enable_cet=yes],
+       [enable_cet=no])
+      ;;
+    *)
+      enable_cet=no
+      ;;
+  esac
+fi

Reply via email to