diff options
| author | Iain Buclaw <ibuclaw@gdcproject.org> | 2025-02-25 18:01:09 +0100 |
|---|---|---|
| committer | Iain Buclaw <ibuclaw@gdcproject.org> | 2025-02-25 18:04:46 +0100 |
| commit | c17044e509824e5ed3de94c85a7a0dd71cfd9cc1 (patch) | |
| tree | 2ae5f1b20dc4c4727ce00715a84ad334600a414f /libphobos/libdruntime | |
| parent | 2d812eecc36e69b5c39ad49b80ab9965c63fdd09 (diff) | |
d/i386: Add CET TargetInfo key and predefined version [PR118654]
Adds a new i386 d_target_info_spec entry to handle requests for
`__traits(getTargetInfo, "CET")', and add predefined target version
`GNU_CET' when the option `-fcf-protecton' is used.
Both TargetInfo key and predefined version have been added to the D
front-end documentation.
In the library, `GNU_CET' replaces the existing use of the user-defined
version flag `CET' when building libphobos.
PR d/118654
gcc/ChangeLog:
* config/i386/i386-d.cc (ix86_d_target_versions): Predefine GNU_CET.
(ix86_d_handle_target_cf_protection): New.
(ix86_d_register_target_info): Add 'CET' TargetInfo key.
gcc/d/ChangeLog:
* implement-d.texi: Document CET version and traits key.
libphobos/ChangeLog:
* Makefile.in: Regenerate.
* configure: Regenerate.
* configure.ac: Remove CET_DFLAGS.
* libdruntime/Makefile.am: Replace CET_DFLAGS with CET_FLAGS.
* libdruntime/Makefile.in: Regenerate.
* libdruntime/core/thread/fiber/package.d: Replace CET with GNU_CET.
* src/Makefile.am: Replace CET_DFLAGS with CET_FLAGS.
* src/Makefile.in: Regenerate.
* testsuite/Makefile.in: Regenerate.
* testsuite/testsuite_flags.in: Replace CET_DFLAGS with CET_FLAGS.
gcc/testsuite/ChangeLog:
* gdc.dg/target/i386/i386.exp: New test.
* gdc.dg/target/i386/targetinfo_CET.d: New test.
Diffstat (limited to 'libphobos/libdruntime')
| -rw-r--r-- | libphobos/libdruntime/Makefile.am | 2 | ||||
| -rw-r--r-- | libphobos/libdruntime/Makefile.in | 3 | ||||
| -rw-r--r-- | libphobos/libdruntime/core/thread/fiber/package.d | 4 |
3 files changed, 4 insertions, 5 deletions
diff --git a/libphobos/libdruntime/Makefile.am b/libphobos/libdruntime/Makefile.am index fd117eca202..8df0e1c43b9 100644 --- a/libphobos/libdruntime/Makefile.am +++ b/libphobos/libdruntime/Makefile.am @@ -25,7 +25,7 @@ D_EXTRA_DFLAGS=-fpreview=dip1000 -fpreview=fieldwise -fpreview=dtorfields \ # D flags for compilation AM_DFLAGS= \ $(phobos_lt_pic_flag) $(phobos_compiler_shared_flag) \ - $(WARN_DFLAGS) $(CHECKING_DFLAGS) $(SECTION_FLAGS) $(CET_DFLAGS) + $(WARN_DFLAGS) $(CHECKING_DFLAGS) $(SECTION_FLAGS) $(CET_FLAGS) # Flags for other kinds of sources AM_CFLAGS=$(CET_FLAGS) diff --git a/libphobos/libdruntime/Makefile.in b/libphobos/libdruntime/Makefile.in index 2d87c8162af..999064e5221 100644 --- a/libphobos/libdruntime/Makefile.in +++ b/libphobos/libdruntime/Makefile.in @@ -625,7 +625,6 @@ CC = @CC@ CCAS = @CCAS@ CCASFLAGS = @CCASFLAGS@ CC_FOR_BUILD = @CC_FOR_BUILD@ -CET_DFLAGS = @CET_DFLAGS@ CET_FLAGS = @CET_FLAGS@ CFLAGS = @CFLAGS@ CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ @@ -784,7 +783,7 @@ D_EXTRA_DFLAGS = -fpreview=dip1000 -fpreview=fieldwise -fpreview=dtorfields \ # D flags for compilation AM_DFLAGS = \ $(phobos_lt_pic_flag) $(phobos_compiler_shared_flag) \ - $(WARN_DFLAGS) $(CHECKING_DFLAGS) $(SECTION_FLAGS) $(CET_DFLAGS) + $(WARN_DFLAGS) $(CHECKING_DFLAGS) $(SECTION_FLAGS) $(CET_FLAGS) # Flags for other kinds of sources diff --git a/libphobos/libdruntime/core/thread/fiber/package.d b/libphobos/libdruntime/core/thread/fiber/package.d index d10a25d683c..591b1dc146c 100644 --- a/libphobos/libdruntime/core/thread/fiber/package.d +++ b/libphobos/libdruntime/core/thread/fiber/package.d @@ -73,7 +73,7 @@ package { version = AlignFiberStackTo16Byte; - version (CET) + version (GNU_CET) { // fiber_switchContext does not support shadow stack from // Intel CET. So use ucontext implementation. @@ -94,7 +94,7 @@ package { version = AlignFiberStackTo16Byte; - version (CET) + version (GNU_CET) { // fiber_switchContext does not support shadow stack from // Intel CET. So use ucontext implementation. |
