From 4c1a5d8b71e29b71e0bc1004480c12c5fc427cb7 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Fri, 15 May 2020 09:06:50 -0700 Subject: x86: Also check if -fcf-protection works When defaulting CET run-time support to auto, check if -fcf-protection works. Even if the stage1 GCC doesn't support -fcf-protection, since the final GCC does, CET run-time support will be enabled by default if binutils support CET. config/ PR bootstrap/95147 * cet.m4 (GCC_CET_FLAGS): Also check if -fcf-protection works when defaulting to auto. libatomic/ PR bootstrap/95147 * configure: Regenerated. libbacktrace/ PR bootstrap/95147 * configure: Regenerated. libgcc/ PR bootstrap/95147 * configure: Regenerated. libgfortran/ PR bootstrap/95147 * configure: Regenerated. libgomp/ PR bootstrap/95147 * configure: Regenerated. libitm/ PR bootstrap/95147 * configure: Regenerated. libobjc/ PR bootstrap/95147 * configure: Regenerated. libphobos/ PR bootstrap/95147 * configure: Regenerated. libquadmath/ PR bootstrap/95147 * configure: Regenerated. libsanitizer/ PR bootstrap/95147 * configure: Regenerated. libssp/ PR bootstrap/95147 * configure: Regenerated. libstdc++-v3/ PR bootstrap/95147 * configure: Regenerated. libvtv/ PR bootstrap/95147 * configure: Regenerated. zlib/ PR bootstrap/95147 * configure: Regenerated. --- config/ChangeLog | 6 ++++++ config/cet.m4 | 3 +++ 2 files changed, 9 insertions(+) (limited to 'config') diff --git a/config/ChangeLog b/config/ChangeLog index d36c5bb..a4d5474 100644 --- a/config/ChangeLog +++ b/config/ChangeLog @@ -1,3 +1,9 @@ +2020-05-15 H.J. Lu + + PR bootstrap/95147 + * cet.m4 (GCC_CET_FLAGS): Also check if -fcf-protection works + when defaulting to auto. + 2020-05-14 H.J. Lu * cet.m4 (GCC_CET_FLAGS): Change default to auto. diff --git a/config/cet.m4 b/config/cet.m4 index 63c6ea9..2bb2c8a 100644 --- a/config/cet.m4 +++ b/config/cet.m4 @@ -13,6 +13,8 @@ case "$host" in auto) # Check if target supports multi-byte NOPs # and if assembler supports CET insn. + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -fcf-protection" AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [], @@ -25,6 +27,7 @@ asm ("setssbsy"); ])], [enable_cet=yes], [enable_cet=no]) + CFLAGS="$save_CFLAGS" ;; yes) # Check if assembler supports CET. -- cgit v1.1