diff options
author | Igor Tsimbalist <igor.v.tsimbalist@intel.com> | 2018-02-19 17:25:49 +0100 |
---|---|---|
committer | Igor Tsimbalist <itsimbal@gcc.gnu.org> | 2018-02-19 17:25:49 +0100 |
commit | 14e335edc8c5c2cd18779e4e242a3d81037b8b43 (patch) | |
tree | 5439816d0ec4a7a72c403e59851b0b78e2d23c88 /config | |
parent | 65e3761d451229338a22226e154cb7d0bed5fcd1 (diff) | |
download | gcc-14e335edc8c5c2cd18779e4e242a3d81037b8b43.tar.gz |
CET shouldn't be enabled in 32-bit run-time libraries by defualt
ENDBR32 and RDSSPD are multi-byte NOPs on x86-64 processors and
newer x86 processors, starting Pentium Pro. They are UD on older
32-bit processors. Detect this at configure time and adjust the
default value for enable_cet. GCC will enable CET in 32-bit run-time
libraries in any case if --enable-cet is used to configure GCC.
PR target/84148
* config/cet.m4: Check if target support multi-byte NOPS (SSE).
* libatomic/configure: Regenerate.
* libbacktrace/configure: Likewise.
* libgcc/configure: Likewise.
* libgfortran/configure: Likewise.
* libgomp/configure: Likewise.
* libitm/configure: Likewise.
* libmpx/configure: Likewise.
* libobjc/configure: Likewise.
* libquadmath/configure: Likewise.
* libsanitizer/configure: Likewise.
* libssp/configure: Likewise.
* libstdc++-v3/configure: Likewise.
* libvtv/configure: Likewise.
From-SVN: r257809
Diffstat (limited to 'config')
-rw-r--r-- | config/ChangeLog | 5 | ||||
-rw-r--r-- | config/cet.m4 | 16 |
2 files changed, 19 insertions, 2 deletions
diff --git a/config/ChangeLog b/config/ChangeLog index fd7f82fc779..746a0a01ba0 100644 --- a/config/ChangeLog +++ b/config/ChangeLog @@ -1,3 +1,8 @@ +2018-02-14 Igor Tsimbalist <igor.v.tsimbalist@intel.com> + + PR target/84148 + * cet.m4: Check if target support multi-byte NOPS (SSE). + 2018-02-06 Eric Botcazou <ebotcazou@adacore.com> * gcc-plugin.m4 (GCC_ENABLE_PLUGINS): Remove -q option passed to grep. diff --git a/config/cet.m4 b/config/cet.m4 index 715f4bded19..23dd1f7d27d 100644 --- a/config/cet.m4 +++ b/config/cet.m4 @@ -5,15 +5,24 @@ dnl AC_DEFUN([GCC_CET_FLAGS],[dnl GCC_ENABLE(cet, default, ,[enable Intel CET in target libraries], permit yes|no|default) +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. + # 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]) ;; @@ -34,5 +43,8 @@ case "$host" in esac if test x$enable_cet = xyes; then $1="-fcf-protection -mcet" + AC_MSG_RESULT([yes]) +else + AC_MSG_RESULT([no]) fi ]) |