From 4c1a5d8b71e29b71e0bc1004480c12c5fc427cb7 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Fri, 15 May 2020 09:06:50 -0700 Subject: [PATCH] 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 +++ libatomic/ChangeLog | 5 +++++ libatomic/configure | 3 +++ libbacktrace/ChangeLog | 5 +++++ libbacktrace/configure | 3 +++ libgcc/ChangeLog | 5 +++++ libgcc/configure | 3 +++ libgfortran/ChangeLog | 5 +++++ libgfortran/configure | 7 +++++-- libgomp/ChangeLog | 5 +++++ libgomp/configure | 3 +++ libitm/ChangeLog | 5 +++++ libitm/configure | 3 +++ libobjc/ChangeLog | 5 +++++ libobjc/configure | 7 +++++-- libphobos/ChangeLog | 5 +++++ libphobos/configure | 11 +++++++---- libquadmath/ChangeLog | 5 +++++ libquadmath/configure | 3 +++ libsanitizer/ChangeLog | 5 +++++ libsanitizer/configure | 3 +++ libssp/ChangeLog | 5 +++++ libssp/configure | 7 +++++-- libstdc++-v3/ChangeLog | 5 +++++ libstdc++-v3/configure | 3 +++ libvtv/ChangeLog | 5 +++++ libvtv/configure | 3 +++ zlib/ChangeLog.gcj | 5 +++++ zlib/configure | 7 +++++-- 30 files changed, 133 insertions(+), 12 deletions(-) diff --git a/config/ChangeLog b/config/ChangeLog index d36c5bb4976..a4d54749669 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 63c6ea9ee02..2bb2c8a95ac 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. diff --git a/libatomic/ChangeLog b/libatomic/ChangeLog index 38d5ef3dabb..ddfce8d5552 100644 --- a/libatomic/ChangeLog +++ b/libatomic/ChangeLog @@ -1,3 +1,8 @@ +2020-05-15 H.J. Lu + + PR bootstrap/95147 + * configure: Regenerated. + 2020-05-14 H.J. Lu * configure: Regenerated. diff --git a/libatomic/configure b/libatomic/configure index c4b4714abc0..478670a6fe7 100755 --- a/libatomic/configure +++ b/libatomic/configure @@ -15595,6 +15595,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" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -15618,6 +15620,7 @@ else enable_cet=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$save_CFLAGS" ;; yes) # Check if assembler supports CET. diff --git a/libbacktrace/ChangeLog b/libbacktrace/ChangeLog index 81fa56e5ba5..9f45d72f4fe 100644 --- a/libbacktrace/ChangeLog +++ b/libbacktrace/ChangeLog @@ -1,3 +1,8 @@ +2020-05-15 H.J. Lu + + PR bootstrap/95147 + * configure: Regenerated. + 2020-05-14 H.J. Lu * configure: Regenerated. diff --git a/libbacktrace/configure b/libbacktrace/configure index 95d06c60be1..d851e807d2d 100755 --- a/libbacktrace/configure +++ b/libbacktrace/configure @@ -12169,6 +12169,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" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -12192,6 +12194,7 @@ else enable_cet=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$save_CFLAGS" ;; yes) # Check if assembler supports CET. diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index b0a432f3236..7343c773ecf 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,8 @@ +2020-05-15 H.J. Lu + + PR bootstrap/95147 + * configure: Regenerated. + 2020-05-14 H.J. Lu * configure: Regenerated. diff --git a/libgcc/configure b/libgcc/configure index a5d5ab84607..5d0c79bcd75 100755 --- a/libgcc/configure +++ b/libgcc/configure @@ -4913,6 +4913,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" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4936,6 +4938,7 @@ else enable_cet=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$save_CFLAGS" ;; yes) # Check if assembler supports CET. diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 1e6ee7929fd..149f45e1088 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,8 @@ +2020-05-15 H.J. Lu + + PR bootstrap/95147 + * configure: Regenerated. + 2020-05-14 Thomas Koenig PR libfortran/95119 diff --git a/libgfortran/configure b/libgfortran/configure index 3c8be061ede..97d9616e425 100755 --- a/libgfortran/configure +++ b/libgfortran/configure @@ -6014,6 +6014,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" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -6037,6 +6039,7 @@ else enable_cet=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$save_CFLAGS" ;; yes) # Check if assembler supports CET. @@ -12719,7 +12722,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12722 "configure" +#line 12725 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12825,7 +12828,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12828 "configure" +#line 12831 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index 687b7207a89..0011763acd8 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,8 @@ +2020-05-15 H.J. Lu + + PR bootstrap/95147 + * configure: Regenerated. + 2020-05-14 Thomas Koenig PR libfortran/95119 diff --git a/libgomp/configure b/libgomp/configure index 4a0e1498415..e5710b26749 100755 --- a/libgomp/configure +++ b/libgomp/configure @@ -16753,6 +16753,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" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -16776,6 +16778,7 @@ else enable_cet=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$save_CFLAGS" ;; yes) # Check if assembler supports CET. diff --git a/libitm/ChangeLog b/libitm/ChangeLog index 3c384113d07..b3ebcab466b 100644 --- a/libitm/ChangeLog +++ b/libitm/ChangeLog @@ -1,3 +1,8 @@ +2020-05-15 H.J. Lu + + PR bootstrap/95147 + * configure: Regenerated. + 2020-05-14 H.J. Lu * configure: Regenerated. diff --git a/libitm/configure b/libitm/configure index 2c451fb0a98..be70ea6f76f 100755 --- a/libitm/configure +++ b/libitm/configure @@ -17890,6 +17890,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" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -17913,6 +17915,7 @@ else enable_cet=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$save_CFLAGS" ;; yes) # Check if assembler supports CET. diff --git a/libobjc/ChangeLog b/libobjc/ChangeLog index accabfbd379..5f42020f0b6 100644 --- a/libobjc/ChangeLog +++ b/libobjc/ChangeLog @@ -1,3 +1,8 @@ +2020-05-15 H.J. Lu + + PR bootstrap/95147 + * configure: Regenerated. + 2020-05-14 H.J. Lu * configure: Regenerated. diff --git a/libobjc/configure b/libobjc/configure index 018c9db76e8..6975a727d5e 100755 --- a/libobjc/configure +++ b/libobjc/configure @@ -3466,6 +3466,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" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -3489,6 +3491,7 @@ else enable_cet=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$save_CFLAGS" ;; yes) # Check if assembler supports CET. @@ -10775,7 +10778,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10778 "configure" +#line 10781 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -10881,7 +10884,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10884 "configure" +#line 10887 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/libphobos/ChangeLog b/libphobos/ChangeLog index c885d926216..e5422ecd063 100644 --- a/libphobos/ChangeLog +++ b/libphobos/ChangeLog @@ -1,3 +1,8 @@ +2020-05-15 H.J. Lu + + PR bootstrap/95147 + * configure: Regenerated. + 2020-05-08 H.J. Lu * libdruntime/config/x86/switchcontext.S: Include if diff --git a/libphobos/configure b/libphobos/configure index c8137d4d572..4551e9fddef 100755 --- a/libphobos/configure +++ b/libphobos/configure @@ -1478,7 +1478,7 @@ Optional Features: --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer - --enable-cet enable Intel CET in target libraries [default=no] + --enable-cet enable Intel CET in target libraries [default=auto] --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] @@ -5573,7 +5573,7 @@ if test "${enable_cet+set}" = set; then : esac else - enable_cet=no + enable_cet=auto fi @@ -5586,6 +5586,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" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5609,6 +5611,7 @@ else enable_cet=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$save_CFLAGS" ;; yes) # Check if assembler supports CET. @@ -11734,7 +11737,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11737 "configure" +#line 11740 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11840,7 +11843,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11843 "configure" +#line 11846 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/libquadmath/ChangeLog b/libquadmath/ChangeLog index fbb548e8b04..eb045415f75 100644 --- a/libquadmath/ChangeLog +++ b/libquadmath/ChangeLog @@ -1,3 +1,8 @@ +2020-05-15 H.J. Lu + + PR bootstrap/95147 + * configure: Regenerated. + 2020-05-14 H.J. Lu * configure: Regenerated. diff --git a/libquadmath/configure b/libquadmath/configure index d995a2cfd25..dee79cf99a0 100755 --- a/libquadmath/configure +++ b/libquadmath/configure @@ -13039,6 +13039,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" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -13062,6 +13064,7 @@ else enable_cet=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$save_CFLAGS" ;; yes) # Check if assembler supports CET. diff --git a/libsanitizer/ChangeLog b/libsanitizer/ChangeLog index 7bb6269e650..001483b6ca6 100644 --- a/libsanitizer/ChangeLog +++ b/libsanitizer/ChangeLog @@ -1,3 +1,8 @@ +2020-05-15 H.J. Lu + + PR bootstrap/95147 + * configure: Regenerated. + 2020-05-14 H.J. Lu * configure: Regenerated. diff --git a/libsanitizer/configure b/libsanitizer/configure index 8d1aa6db492..7ec074491c1 100755 --- a/libsanitizer/configure +++ b/libsanitizer/configure @@ -16862,6 +16862,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" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -16885,6 +16887,7 @@ else enable_cet=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$save_CFLAGS" ;; yes) # Check if assembler supports CET. diff --git a/libssp/ChangeLog b/libssp/ChangeLog index 43fe3fe35fe..dfb2015edc5 100644 --- a/libssp/ChangeLog +++ b/libssp/ChangeLog @@ -1,3 +1,8 @@ +2020-05-15 H.J. Lu + + PR bootstrap/95147 + * configure: Regenerated. + 2020-05-14 H.J. Lu * configure: Regenerated. diff --git a/libssp/configure b/libssp/configure index 7e54b16bfaf..2eb4c7998d5 100755 --- a/libssp/configure +++ b/libssp/configure @@ -4338,6 +4338,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" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4361,6 +4363,7 @@ else enable_cet=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$save_CFLAGS" ;; yes) # Check if assembler supports CET. @@ -10996,7 +10999,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10999 "configure" +#line 11002 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11102,7 +11105,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11105 "configure" +#line 11108 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index a6f5d6f09de..dde62ad4779 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,8 @@ +2020-05-15 H.J. Lu + + PR bootstrap/95147 + * configure: Regenerated. + 2020-05-14 H.J. Lu * configure: Regenerated. diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index 24cc51c8bef..502f6602001 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -77488,6 +77488,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" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -77511,6 +77513,7 @@ else enable_cet=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$save_CFLAGS" ;; yes) # Check if assembler supports CET. diff --git a/libvtv/ChangeLog b/libvtv/ChangeLog index 96c417c4042..b50e74be2c7 100644 --- a/libvtv/ChangeLog +++ b/libvtv/ChangeLog @@ -1,3 +1,8 @@ +2020-05-15 H.J. Lu + + PR bootstrap/95147 + * configure: Regenerated. + 2020-05-14 H.J. Lu * configure: Regenerated. diff --git a/libvtv/configure b/libvtv/configure index 9d42cb88fb2..eced2b23ce0 100755 --- a/libvtv/configure +++ b/libvtv/configure @@ -15680,6 +15680,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" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -15703,6 +15705,7 @@ else enable_cet=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$save_CFLAGS" ;; yes) # Check if assembler supports CET. diff --git a/zlib/ChangeLog.gcj b/zlib/ChangeLog.gcj index 1057533823b..0986b1469f0 100644 --- a/zlib/ChangeLog.gcj +++ b/zlib/ChangeLog.gcj @@ -1,3 +1,8 @@ +2020-05-15 H.J. Lu + + PR bootstrap/95147 + * configure: Regenerated. + 2020-05-14 H.J. Lu * configure: Regenerated. diff --git a/zlib/configure b/zlib/configure index 65005f131dc..ae1f1934911 100755 --- a/zlib/configure +++ b/zlib/configure @@ -4169,6 +4169,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" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4192,6 +4194,7 @@ else enable_cet=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$save_CFLAGS" ;; yes) # Check if assembler supports CET. @@ -10739,7 +10742,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10742 "configure" +#line 10745 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -10845,7 +10848,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10848 "configure" +#line 10851 "configure" #include "confdefs.h" #if HAVE_DLFCN_H -- 2.30.2