summaryrefslogtreecommitdiff
path: root/libphobos/configure
diff options
context:
space:
mode:
authorIain Buclaw <ibuclaw@gdcproject.org>2020-09-07 15:43:04 +0200
committerIain Buclaw <ibuclaw@gdcproject.org>2020-09-08 12:14:56 +0200
commit285d81be9725acc36dc8eca48d4df506cd5e6f6f (patch)
treef11c13f6fd48555b952d1b3df40522ed8e3eecf6 /libphobos/configure
parentcd2d3822ca0f2f743601cc9d048d51f6d326f6a2 (diff)
downloadgcc-285d81be9725acc36dc8eca48d4df506cd5e6f6f.tar.gz
libphobos: libdruntime doesn't support shadow stack (PR95680)
Rather than implementing support within D runtime itself, use libc getcontext/swapcontext functions if CET is enabled. Removes whatever CET support was in the switchContext routine for x86 D runtime, along with setting version AsmExternal, so that the fallback ucontext_t implementation is used, which is capable of doing shadow stack handling. libphobos/ChangeLog: PR d/95680 * Makefile.in: Regenerate. * configure: Regenerate. * configure.ac (DCFG_ENABLE_CET): Substitute. * libdruntime/Makefile.in: Regenerate. * libdruntime/config/x86/switchcontext.S: Remove CET support code. * libdruntime/core/thread.d: Import gcc.config. Don't set version AsmExternal 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/configure')
-rwxr-xr-xlibphobos/configure13
1 files changed, 10 insertions, 3 deletions
diff --git a/libphobos/configure b/libphobos/configure
index a8d151cdccb..86a0aba6976 100755
--- a/libphobos/configure
+++ b/libphobos/configure
@@ -722,6 +722,7 @@ LIBTOOL
CFLAGS_FOR_BUILD
CC_FOR_BUILD
AR
+DCFG_ENABLE_CET
CET_FLAGS
RANLIB
MAINT
@@ -5586,7 +5587,7 @@ case "$host" in
case "$enable_cet" in
auto)
# Check if target supports multi-byte NOPs
- # and if assembler supports CET insn.
+ # and if compiler and assembler support CET insn.
cet_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fcf-protection"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -5650,6 +5651,12 @@ $as_echo "no" >&6; }
fi
+if test x$enable_cet = xyes; then :
+ DCFG_ENABLE_CET=true
+else
+ DCFG_ENABLE_CET=false
+fi
+
# This should be inherited in the recursive make, but ensure it is defined.
test "$AR" || AR=ar
@@ -11738,7 +11745,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11741 "configure"
+#line 11748 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11844,7 +11851,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11847 "configure"
+#line 11854 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H