]> git.ipfire.org Git - thirdparty/gcc.git/blame - config/cet.m4
[nvptx] Fix some missing mode warnings in nvptx.md
[thirdparty/gcc.git] / config / cet.m4
CommitLineData
5f42446c 1dnl
2dnl GCC_CET_FLAGS
3dnl (SHELL-CODE_HANDLER)
4dnl
5AC_DEFUN([GCC_CET_FLAGS],[dnl
ee8fea81 6GCC_ENABLE(cet, no, ,[enable Intel CET in target libraries],
7 permit yes|no|auto)
5611e648 8AC_MSG_CHECKING([for CET support])
9
5f42446c 10case "$host" in
11 i[[34567]]86-*-linux* | x86_64-*-linux*)
12 case "$enable_cet" in
ee8fea81 13 auto)
5611e648 14 # Check if target supports multi-byte NOPs
15 # and if assembler supports CET insn.
5f42446c 16 AC_COMPILE_IFELSE(
17 [AC_LANG_PROGRAM(
18 [],
5611e648 19 [
20#if !defined(__SSE2__)
21#error target does not support multi-byte NOPs
22#else
23asm ("setssbsy");
24#endif
25 ])],
5f42446c 26 [enable_cet=yes],
27 [enable_cet=no])
28 ;;
29 yes)
30 # Check if assembler supports CET.
31 AC_COMPILE_IFELSE(
32 [AC_LANG_PROGRAM(
33 [],
34 [asm ("setssbsy");])],
35 [],
36 [AC_MSG_ERROR([assembler with CET support is required for --enable-cet])])
37 ;;
38 esac
39 ;;
40 *)
41 enable_cet=no
42 ;;
43esac
44if test x$enable_cet = xyes; then
b5359ebd 45 $1="-fcf-protection -mshstk"
5611e648 46 AC_MSG_RESULT([yes])
47else
48 AC_MSG_RESULT([no])
5f42446c 49fi
50])