libphobos: libdruntime doesn't support shadow stack (PR95680)
The first implementation hit a front-end implementation bug where
version conditions are resolved ahead of static if confitions.
The logic for whether to use asm implemented fiber_switchContext or
libc's swapcontext has been moved from GNU_Enable_CET to version CET.
libphobos/ChangeLog:
PR d/95680
PR d/97007
* Makefile.am (AM_MAKEFLAGS): Remove $(CET_FLAGS).
* Makefile.in: Regenerate.
* configure: Regenerate.
* configure.ac (DCFG_ENABLE_CET): Remove substitution.
(CET_DFLAGS): Substitute.
* libdruntime/Makefile.am (AM_DFLAGS): Add $(CET_DFLAGS).
(AM_CFLAGS): Add $(CET_FLAGS).
(AM_CCASFLAGS): Likewise.
* libdruntime/Makefile.in: Regenerate.
* libdruntime/core/thread.d: Replace static if GNU_Enable_CET
condition with `version (CET)'.
* libdruntime/gcc/config.d.in (GNU_Enable_CET): Remove.
* src/Makefile.am (AM_DFLAGS): Add $(CET_DFLAGS).
(AM_CFLAGS): Add $(CET_FLAGS).
* src/Makefile.in: Regenerate.
* testsuite/Makefile.in: Regenerate.
* testsuite/testsuite_flags.in: Add $(CET_DFLAGS) to --gdcflags.
diff --git a/libphobos/configure b/libphobos/configure
index 86a0aba..4c1116d 100755
--- a/libphobos/configure
+++ b/libphobos/configure
@@ -722,7 +722,7 @@
CFLAGS_FOR_BUILD
CC_FOR_BUILD
AR
-DCFG_ENABLE_CET
+CET_DFLAGS
CET_FLAGS
RANLIB
MAINT
@@ -5651,12 +5651,11 @@
fi
-if test x$enable_cet = xyes; then :
- DCFG_ENABLE_CET=true
-else
- DCFG_ENABLE_CET=false
-fi
+# To ensure that runtime code for CET is compiled in, add in D version flags.
+if test "$enable_cet" = yes; then
+ CET_DFLAGS="$CET_FLAGS -fversion=CET"
+fi
# This should be inherited in the recursive make, but ensure it is defined.
test "$AR" || AR=ar
@@ -11745,7 +11744,7 @@
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11748 "configure"
+#line 11747 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11851,7 +11850,7 @@
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11854 "configure"
+#line 11853 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H