libphobos: Fix segfault at run-time when using custom Fibers (PR 98025)
authorIain Buclaw <ibuclaw@gdcproject.org>
Fri, 27 Nov 2020 12:15:44 +0000 (13:15 +0100)
committerIain Buclaw <ibuclaw@gdcproject.org>
Fri, 27 Nov 2020 20:27:14 +0000 (21:27 +0100)
commit5dbab7b3f4d3a8298aeb8ecde1cfbc4b16913d28
treeb4ea6ea1b7e373db2ffae2e9cb7b4e2b50a9bbe1
parent6b2f370fa915d74dff066d4b0340ddb459728046
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.
libphobos/Makefile.in
libphobos/configure
libphobos/configure.ac
libphobos/libdruntime/MERGE
libphobos/libdruntime/Makefile.in
libphobos/libdruntime/core/sys/posix/ucontext.d
libphobos/libdruntime/core/thread.d
libphobos/libdruntime/gcc/config.d.in
libphobos/src/Makefile.in
libphobos/testsuite/Makefile.in