summaryrefslogtreecommitdiff
path: root/libphobos/src
diff options
context:
space:
mode:
authorIain Buclaw <ibuclaw@gdcproject.org>2020-11-27 13:15:44 +0100
committerIain Buclaw <ibuclaw@gdcproject.org>2020-11-27 21:27:14 +0100
commit5dbab7b3f4d3a8298aeb8ecde1cfbc4b16913d28 (patch)
treeb4ea6ea1b7e373db2ffae2e9cb7b4e2b50a9bbe1 /libphobos/src
parent6b2f370fa915d74dff066d4b0340ddb459728046 (diff)
downloadgcc-5dbab7b3f4d3a8298aeb8ecde1cfbc4b16913d28.tar.gz
libphobos: Fix segfault at run-time when using custom Fibers (PR 98025)
When libphobos is configured with --enable-cet, this adds extra fields to the Fiber class to support the ucontext_t fallback implementation. These fields get omitted when compiling user code unless they also used `-fversion=CET' to build their project, which resulted in data being overwritten from within swapcontext(). On reviewing the ucontext_t definitions, it was found that the shadow stack fields were missing, and the struct size didn't match up on X32. This has been fixed in upstream druntime and merged down here. Reviewed-on: https://github.com/dlang/druntime/pull/3293 libphobos/ChangeLog: PR d/98025 * Makefile.in: Regenerate. * configure: Regenerate. * configure.ac (DCFG_ENABLE_CET): Substitute. * libdruntime/MERGE: Merge upstream druntime 0fe7974c. * libdruntime/Makefile.in: Regenerate. * libdruntime/core/thread.d: Import gcc.config. (class Fiber): Add ucontext_t fields when GNU_Enable_CET is true. * libdruntime/gcc/config.d.in (GNU_Enable_CET): Define. * src/Makefile.in: Regenerate. * testsuite/Makefile.in: Regenerate.
Diffstat (limited to 'libphobos/src')
-rw-r--r--libphobos/src/Makefile.in1
1 files changed, 1 insertions, 0 deletions
diff --git a/libphobos/src/Makefile.in b/libphobos/src/Makefile.in
index 4a0612a613b..2e721783d06 100644
--- a/libphobos/src/Makefile.in
+++ b/libphobos/src/Makefile.in
@@ -333,6 +333,7 @@ CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DCFG_ARM_EABI_UNWINDER = @DCFG_ARM_EABI_UNWINDER@
DCFG_DLPI_TLS_MODID = @DCFG_DLPI_TLS_MODID@
+DCFG_ENABLE_CET = @DCFG_ENABLE_CET@
DCFG_HAVE_64BIT_ATOMICS = @DCFG_HAVE_64BIT_ATOMICS@
DCFG_HAVE_ATOMIC_BUILTINS = @DCFG_HAVE_ATOMIC_BUILTINS@
DCFG_HAVE_LIBATOMIC = @DCFG_HAVE_LIBATOMIC@