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.
This commit is contained in:
H.J. Lu 2020-05-15 09:06:50 -07:00
parent 0ec52417fd
commit 4c1a5d8b71
30 changed files with 133 additions and 12 deletions

View File

@ -1,3 +1,9 @@
2020-05-15 H.J. Lu <hongjiu.lu@intel.com>
PR bootstrap/95147
* cet.m4 (GCC_CET_FLAGS): Also check if -fcf-protection works
when defaulting to auto.
2020-05-14 H.J. Lu <hongjiu.lu@intel.com>
* cet.m4 (GCC_CET_FLAGS): Change default to auto.

View File

@ -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.

View File

@ -1,3 +1,8 @@
2020-05-15 H.J. Lu <hongjiu.lu@intel.com>
PR bootstrap/95147
* configure: Regenerated.
2020-05-14 H.J. Lu <hongjiu.lu@intel.com>
* configure: Regenerated.

3
libatomic/configure vendored
View File

@ -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.

View File

@ -1,3 +1,8 @@
2020-05-15 H.J. Lu <hongjiu.lu@intel.com>
PR bootstrap/95147
* configure: Regenerated.
2020-05-14 H.J. Lu <hongjiu.lu@intel.com>
* configure: Regenerated.

View File

@ -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.

View File

@ -1,3 +1,8 @@
2020-05-15 H.J. Lu <hongjiu.lu@intel.com>
PR bootstrap/95147
* configure: Regenerated.
2020-05-14 H.J. Lu <hongjiu.lu@intel.com>
* configure: Regenerated.

3
libgcc/configure vendored
View File

@ -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.

View File

@ -1,3 +1,8 @@
2020-05-15 H.J. Lu <hongjiu.lu@intel.com>
PR bootstrap/95147
* configure: Regenerated.
2020-05-14 Thomas Koenig <tkoenig@gcc.gnu.org>
PR libfortran/95119

View File

@ -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

View File

@ -1,3 +1,8 @@
2020-05-15 H.J. Lu <hongjiu.lu@intel.com>
PR bootstrap/95147
* configure: Regenerated.
2020-05-14 Thomas Koenig <tkoenig@gcc.gnu.org>
PR libfortran/95119

3
libgomp/configure vendored
View File

@ -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.

View File

@ -1,3 +1,8 @@
2020-05-15 H.J. Lu <hongjiu.lu@intel.com>
PR bootstrap/95147
* configure: Regenerated.
2020-05-14 H.J. Lu <hongjiu.lu@intel.com>
* configure: Regenerated.

3
libitm/configure vendored
View File

@ -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.

View File

@ -1,3 +1,8 @@
2020-05-15 H.J. Lu <hongjiu.lu@intel.com>
PR bootstrap/95147
* configure: Regenerated.
2020-05-14 H.J. Lu <hongjiu.lu@intel.com>
* configure: Regenerated.

7
libobjc/configure vendored
View File

@ -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

View File

@ -1,3 +1,8 @@
2020-05-15 H.J. Lu <hongjiu.lu@intel.com>
PR bootstrap/95147
* configure: Regenerated.
2020-05-08 H.J. Lu <hongjiu.lu@intel.com>
* libdruntime/config/x86/switchcontext.S: Include <cet.h> if

11
libphobos/configure vendored
View File

@ -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

View File

@ -1,3 +1,8 @@
2020-05-15 H.J. Lu <hongjiu.lu@intel.com>
PR bootstrap/95147
* configure: Regenerated.
2020-05-14 H.J. Lu <hongjiu.lu@intel.com>
* configure: Regenerated.

View File

@ -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.

View File

@ -1,3 +1,8 @@
2020-05-15 H.J. Lu <hongjiu.lu@intel.com>
PR bootstrap/95147
* configure: Regenerated.
2020-05-14 H.J. Lu <hongjiu.lu@intel.com>
* configure: Regenerated.

View File

@ -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.

View File

@ -1,3 +1,8 @@
2020-05-15 H.J. Lu <hongjiu.lu@intel.com>
PR bootstrap/95147
* configure: Regenerated.
2020-05-14 H.J. Lu <hongjiu.lu@intel.com>
* configure: Regenerated.

7
libssp/configure vendored
View File

@ -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

View File

@ -1,3 +1,8 @@
2020-05-15 H.J. Lu <hongjiu.lu@intel.com>
PR bootstrap/95147
* configure: Regenerated.
2020-05-14 H.J. Lu <hongjiu.lu@intel.com>
* configure: Regenerated.

View File

@ -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.

View File

@ -1,3 +1,8 @@
2020-05-15 H.J. Lu <hongjiu.lu@intel.com>
PR bootstrap/95147
* configure: Regenerated.
2020-05-14 H.J. Lu <hongjiu.lu@intel.com>
* configure: Regenerated.

3
libvtv/configure vendored
View File

@ -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.

View File

@ -1,3 +1,8 @@
2020-05-15 H.J. Lu <hongjiu.lu@intel.com>
PR bootstrap/95147
* configure: Regenerated.
2020-05-14 H.J. Lu <hongjiu.lu@intel.com>
* configure: Regenerated.

7
zlib/configure vendored
View File

@ -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