aboutsummaryrefslogtreecommitdiff
path: root/config/cet.m4
AgeCommit message (Collapse)AuthorFilesLines
2021-05-03GCC_CET_HOST_FLAGS: Check if host supports multi-byte NOPsH.J. Lu1-3/+16
Sync with binutils for PR binutils/27397. Check if host supports multi-byte NOPs before enabling CET on host. config/ PR bootstrap/99703 * cet.m4 (GCC_CET_HOST_FLAGS): Check if host supports multi-byte NOPs. libiberty/ PR bootstrap/99703 * configure: Regenerated.
2020-07-30Require CET support only for the final GCC buildH.J. Lu1-5/+18
With --enable-cet, require CET support only for the final GCC build. Don't enable CET without CET support for non-bootstrap build, in stage1 nor for build support. config/ PR bootstrap/96202 * cet.m4 (GCC_CET_HOST_FLAGS): Don't enable CET without CET support in stage1 nor for build support. gcc/ PR bootstrap/96202 * configure: Regenerated. libbacktrace/ PR bootstrap/96202 * configure: Regenerated. libcc1/ PR bootstrap/96202 * configure: Regenerated. libcpp/ PR bootstrap/96202 * configure: Regenerated. libdecnumber/ PR bootstrap/96202 * configure: Regenerated. libiberty/ PR bootstrap/96202 * configure: Regenerated. lto-plugin/ PR bootstrap/96202 * configure: Regenerated.
2020-05-29Avoid nested save_CFLAGS and save_LDFLAGSH.J. Lu1-8/+9
Avoid nested save_CFLAGS and save_LDFLAGS by replacing save_CFLAGS and save_LDFLAGS with cet_save_CFLAGS and cet_save_LDFLAGS in cet.m4. config/ PR bootstrap/95413 * cet.m4: Replace save_CFLAGS and save_LDFLAGS with cet_save_CFLAGS and cet_save_LDFLAGS. gcc/ PR bootstrap/95413 * configure: Regenerated. libatomic/ PR bootstrap/95413 * configure: Regenerated. libbacktrace/ PR bootstrap/95413 * configure: Regenerated. libcc1/ PR bootstrap/95413 * configure: Regenerated. libcpp/ PR bootstrap/95413 * configure: Regenerated. libdecnumber/ PR bootstrap/95413 * configure: Regenerated. libgcc/ PR bootstrap/95413 * configure: Regenerated. libgfortran/ PR bootstrap/95413 * configure: Regenerated. libgomp/ PR bootstrap/95413 * configure: Regenerated. libiberty/ PR bootstrap/95413 * configure: Regenerated. libitm/ PR bootstrap/95413 * configure: Regenerated. libobjc/ PR bootstrap/95413 * configure: Regenerated. libphobos/ PR bootstrap/95413 * configure: Regenerated. libquadmath/ PR bootstrap/95413 * configure: Regenerated. libsanitizer/ PR bootstrap/95413 * configure: Regenerated. libssp/ PR bootstrap/95413 * configure: Regenerated. libstdc++-v3/ PR bootstrap/95413 * configure: Regenerated. libvtv/ PR bootstrap/95413 * configure: Regenerated. lto-plugin/ PR bootstrap/95413 * configure: Regenerated. zlib/ PR bootstrap/95413 * configure: Regenerated.
2020-05-15x86: Also check if -fcf-protection worksH.J. Lu1-0/+3
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.
2020-05-14x86: Default CET run-time support to autoH.J. Lu1-1/+1
CET has been added since GCC 8. This patch defaults CET run-time support to auto. It enables CET run-time support if asssembler supports CET instructions and multi-byte NOPs are enabled via SSE2. config/ * cet.m4 (GCC_CET_FLAGS): Change default to auto. gcc/ * configure: Regenerated. libatomic/ * configure: Regenerated. libbacktrace/ * configure: Regenerated. libcc1/ * configure: Regenerated. libcpp/ * configure: Regenerated. libdecnumber/ * configure: Regenerated. libgcc/ * configure: Regenerated. libgfortran/ * configure: Regenerated. libgomp/ * configure: Regenerated. libitm/ * configure: Regenerated. libobjc/ * configure: Regenerated. libquadmath/ * configure: Regenerated. libsanitizer/ * configure: Regenerated. libssp/ * configure: Regenerated. libstdc++-v3/ * configure: Regenerated. libvtv/ * configure: Regenerated. zlib/ * configure: Regenerated.
2020-05-12Enable CET in cross compiler if possibleH.J. Lu1-6/+12
Don't perform CET run-time check for host when cross compiling. Instead, enable CET in cross compiler if possible so that it will run on both CET and non-CET hosts. config/ PR bootstrap/94998 * cet.m4 (GCC_CET_HOST_FLAGS): Enable CET in cross compiler if possible. libiberty/ PR bootstrap/94998 * configure: Regenerated. lto-plugin/ PR bootstrap/94998 * configure: Regenerated.
2020-04-28Check whether -fcf-protection=none -Wl,-z,ibt,-z,shstk work firstH.J. Lu1-3/+14
GCC_CET_HOST_FLAGS uses -Wl,-z,ibt,-z,shstk to check if Linux/x86 host has Intel CET enabled by introducing an Intel CET violation on purpose. To avoid false positive, check whether -Wl,-z,ibt,-z,shstk works first. -fcf-protection=none is added to avoid false negative when -fcf-protection is enabled by default. config/ PR bootstrap/94739 * cet.m4 (GCC_CET_HOST_FLAGS): Add -fcf-protection=none to -Wl,-z,ibt,-z,shstk. Check whether -fcf-protection=none -Wl,-z,ibt,-z,shstk works first. libiberty/ PR bootstrap/94739 * configure: Regenerated. lto-plugin/ PR bootstrap/94739 * configure: Regenerated.
2020-04-25Enable Intel CET in liblto_plugin.so on Intel CET enabled hostH.J. Lu1-0/+94
Since ld is Intel CET enabled on Intel CET enabled host, dlopen fails on liblto_plugin.so if it isn't Intel CET enabled. Add GCC_CET_HOST_FLAGS to cet.m4, use it in libiberty and lto-plugin to always enable Intel CET in liblto_plugin.so on Intel CET enabled host. On Linux/x86 host, enable Intel CET by default if assembler and compiler support Intel CET so that the generated liblto_plugin.so can be used on both CET and non-CET machines. It is an error to disable Intel CET in liblto_plugin.so on Intel CET enabled host. config/ PR bootstrap/94739 * cet.m4 (GCC_CET_HOST_FLAGS): New. libiberty/ PR bootstrap/94739 * Makefile.in (COMPILE.c): Add @CET_HOST_FLAGS@. (configure_deps): Add $(srcdir)/../config/cet.m4 and $(srcdir)/../config/enable.m4. * aclocal.m4: Include ../config/cet.m4 and ../config/enable.m4. * configure.ac: Add GCC_CET_HOST_FLAGS(CET_HOST_FLAGS) and AC_SUBST(CET_HOST_FLAGS). * configure: Regenerated. lto-plugin/ PR bootstrap/94739 * Makefile.am (AM_CFLAGS): Add $(CET_HOST_FLAGS). * configure.ac: Add GCC_CET_HOST_FLAGS(CET_HOST_FLAGS) and AC_SUBST(CET_HOST_FLAGS). * Makefile.in: Regenerated. * aclocal.m4: Likewise. * configure: Likewise.
2018-04-24x86/CET: Build target libraries with -mshstkH.J. Lu1-1/+1
With revision 259522: commit d59cfa9a4064339cf2bd2da828c4c133f13e57f0 Author: hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4> Date: Fri Apr 20 13:30:13 2018 +0000 Define __CET__ for -fcf-protection and remove -mibt -mcet becomes an alias for -mshstk. PR target/85485 * cet.m4 (GCC_CET_FLAGS): Replace -mcet with -mshstk. From-SVN: r259608
2018-04-19cet.m4 (GCC_CET_FLAGS): Default to --disable-cet, replace ↵Jakub Jelinek1-3/+3
--enable-cet=default with --enable-cet=auto. * config/cet.m4 (GCC_CET_FLAGS): Default to --disable-cet, replace --enable-cet=default with --enable-cet=auto. * doc/install.texi: Document --disable-cet being the default and --enable-cet=auto. * configure: Regenerated. From-SVN: r259487
2018-02-19CET shouldn't be enabled in 32-bit run-time libraries by defualtIgor Tsimbalist1-2/+14
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
2017-11-17Enable building libgcc with CET options.Igor Tsimbalist1-0/+38
Enable building libgcc with CET options by default on Linux/x86 if binutils supports CET v2.0. It can be disabled with --disable-cet. It is an error to configure GCC with --enable-cet if bintuiils doesn't support CET v2.0. ENDBR instruction is added to __morestack_large_model since it is called indirectly. 2017-11-17 Igor Tsimbalist <igor.v.tsimbalist@intel.com> config/ * cet.m4: New file. gcc/ * config.gcc (extra_headers): Add cet.h for x86 targets. * config/i386/cet.h: New file. * doc/install.texi: Add --enable-cet/--disable-cet. libgcc/ * Makefile.in (configure_deps): Add $(srcdir)/../config/cet.m4. (CET_FLAGS): New. * config/i386/morestack.S: Include <cet.h>. (__morestack_large_model): Add _CET_ENDBR at function entrance. * config/i386/resms64.h: Include <cet.h>. * config/i386/resms64f.h: Likewise. * config/i386/resms64fx.h: Likewise. * config/i386/resms64x.h: Likewise. * config/i386/savms64.h: Likewise. * config/i386/savms64f.h: Likewise. * config/i386/t-linux (HOST_LIBGCC2_CFLAGS): Add $(CET_FLAGS). (CRTSTUFF_T_CFLAGS): Likewise. * configure.ac: Include ../config/cet.m4. Set and substitute CET_FLAGS. * configure: Regenerated. From-SVN: r254868