cet.m4 revision 1.1.1.1
1dnl 2dnl GCC_CET_FLAGS 3dnl (SHELL-CODE_HANDLER) 4dnl 5AC_DEFUN([GCC_CET_FLAGS],[dnl 6GCC_ENABLE(cet, default, ,[enable Intel CET in target libraries], 7 permit yes|no|default) 8case "$host" in 9 i[[34567]]86-*-linux* | x86_64-*-linux*) 10 case "$enable_cet" in 11 default) 12 # Check if assembler supports CET. 13 AC_COMPILE_IFELSE( 14 [AC_LANG_PROGRAM( 15 [], 16 [asm ("setssbsy");])], 17 [enable_cet=yes], 18 [enable_cet=no]) 19 ;; 20 yes) 21 # Check if assembler supports CET. 22 AC_COMPILE_IFELSE( 23 [AC_LANG_PROGRAM( 24 [], 25 [asm ("setssbsy");])], 26 [], 27 [AC_MSG_ERROR([assembler with CET support is required for --enable-cet])]) 28 ;; 29 esac 30 ;; 31 *) 32 enable_cet=no 33 ;; 34esac 35if test x$enable_cet = xyes; then 36 $1="-fcf-protection -mcet" 37fi 38]) 39