Enable building libgcc with CET options.
authorIgor Tsimbalist <igor.v.tsimbalist@intel.com>
Fri, 17 Nov 2017 13:34:39 +0000 (14:34 +0100)
committerIgor Tsimbalist <itsimbal@gcc.gnu.org>
Fri, 17 Nov 2017 13:34:39 +0000 (14:34 +0100)
commit1ecae1fc238a6b02b3cc2de6a24d73966bc45a03
treedaa0015bf7667568564bbd9abcd7fbe77ef2942f
parenta851ce04f7050dd82aa8344e7b68ee8319fb7b6f
Enable building libgcc with CET options.

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
18 files changed:
config/ChangeLog
config/cet.m4 [new file with mode: 0644]
gcc/ChangeLog
gcc/config.gcc
gcc/config/i386/cet.h [new file with mode: 0644]
gcc/doc/install.texi
libgcc/ChangeLog
libgcc/Makefile.in
libgcc/config/i386/morestack.S
libgcc/config/i386/resms64.h
libgcc/config/i386/resms64f.h
libgcc/config/i386/resms64fx.h
libgcc/config/i386/resms64x.h
libgcc/config/i386/savms64.h
libgcc/config/i386/savms64f.h
libgcc/config/i386/t-linux
libgcc/configure
libgcc/configure.ac