"AR_FLAGS=$(AR_FLAGS)" \
"CC_FOR_BUILD=$(CC_FOR_BUILD)" \
"CC_FOR_TARGET=$(CC_FOR_TARGET)" \
- "CCASFLAGS=$(CCASFLAGS) $(CET_FLAGS)" \
- "CFLAGS=$(CFLAGS) $(CET_FLAGS)" \
- "CXXFLAGS=$(CXXFLAGS) $(CET_FLAGS)" \
+ "CCASFLAGS=$(CCASFLAGS)" \
+ "CFLAGS=$(CFLAGS)" \
+ "CXXFLAGS=$(CXXFLAGS)" \
"CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
- "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET) $(CET_FLAGS)" \
+ "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
"GDC_FOR_TARGET=$(GDC_FOR_TARGET)" \
"GDC=$(GDC)" \
- "GDCFLAGS=$(GDCFLAGS) $(CET_FLAGS)" \
+ "GDCFLAGS=$(GDCFLAGS)" \
"INSTALL=$(INSTALL)" \
"INSTALL_DATA=$(INSTALL_DATA)" \
"INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
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@
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@
"AR_FLAGS=$(AR_FLAGS)" \
"CC_FOR_BUILD=$(CC_FOR_BUILD)" \
"CC_FOR_TARGET=$(CC_FOR_TARGET)" \
- "CCASFLAGS=$(CCASFLAGS) $(CET_FLAGS)" \
- "CFLAGS=$(CFLAGS) $(CET_FLAGS)" \
- "CXXFLAGS=$(CXXFLAGS) $(CET_FLAGS)" \
+ "CCASFLAGS=$(CCASFLAGS)" \
+ "CFLAGS=$(CFLAGS)" \
+ "CXXFLAGS=$(CXXFLAGS)" \
"CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
- "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET) $(CET_FLAGS)" \
+ "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
"GDC_FOR_TARGET=$(GDC_FOR_TARGET)" \
"GDC=$(GDC)" \
- "GDCFLAGS=$(GDCFLAGS) $(CET_FLAGS)" \
+ "GDCFLAGS=$(GDCFLAGS)" \
"INSTALL=$(INSTALL)" \
"INSTALL_DATA=$(INSTALL_DATA)" \
"INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
CFLAGS_FOR_BUILD
CC_FOR_BUILD
AR
-DCFG_ENABLE_CET
+CET_DFLAGS
CET_FLAGS
RANLIB
MAINT
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
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
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
# Add CET specific flags if CET is enabled
GCC_CET_FLAGS(CET_FLAGS)
AC_SUBST(CET_FLAGS)
-AS_IF([test x$enable_cet = xyes],
- [DCFG_ENABLE_CET=true], [DCFG_ENABLE_CET=false])
-AC_SUBST(DCFG_ENABLE_CET)
+# 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"
+ AC_SUBST(CET_DFLAGS)
+fi
# This should be inherited in the recursive make, but ensure it is defined.
test "$AR" || AR=ar
# D flags for compilation
AM_DFLAGS= \
$(phobos_compiler_pic_flag) \
- $(WARN_DFLAGS) $(CHECKING_DFLAGS)
+ $(WARN_DFLAGS) $(CHECKING_DFLAGS) $(CET_DFLAGS)
+
+# Flags for other kinds of sources
+AM_CFLAGS=$(CET_FLAGS)
+AM_CCASFLAGS=$(CET_FLAGS)
# Install all D and DI files
ALL_DRUNTIME_INSTALL_DSOURCES = $(DRUNTIME_DSOURCES) \
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@
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@
# D flags for compilation
AM_DFLAGS = \
$(phobos_compiler_pic_flag) \
- $(WARN_DFLAGS) $(CHECKING_DFLAGS)
+ $(WARN_DFLAGS) $(CHECKING_DFLAGS) $(CET_DFLAGS)
+# Flags for other kinds of sources
+AM_CFLAGS = $(CET_FLAGS)
+AM_CCASFLAGS = $(CET_FLAGS)
+
# Install all D and DI files
ALL_DRUNTIME_INSTALL_DSOURCES = $(DRUNTIME_DSOURCES) \
$(DRUNTIME_DSOURCES_BIONIC) $(DRUNTIME_DSOURCES_DARWIN) \
}
else version (X86)
{
- import gcc.config;
-
version = AlignFiberStackTo16Byte;
- static if (!GNU_Enable_CET)
+ version (CET)
+ {
+ // fiber_switchContext does not support shadow stack from
+ // Intel CET. So use ucontext implementation.
+ }
+ else
{
version = AsmExternal;
version (MinGW)
- {
version = GNU_AsmX86_Windows;
- }
else version (Posix)
- {
version = AsmX86_Posix;
- }
}
}
else version (X86_64)
{
- import gcc.config;
-
version = AlignFiberStackTo16Byte;
- static if (!GNU_Enable_CET)
+ version (CET)
{
- version (D_X32)
- {
- // let X32 be handled by ucontext swapcontext
- }
- else
- {
- version = AsmExternal;
+ // fiber_switchContext does not support shadow stack from
+ // Intel CET. So use ucontext implementation.
+ }
+ else version (D_X32)
+ {
+ // let X32 be handled by ucontext swapcontext
+ }
+ else
+ {
+ version = AsmExternal;
- version (MinGW)
- version = GNU_AsmX86_64_Windows;
- else version (Posix)
- version = AsmX86_64_Posix;
- }
+ version (MinGW)
+ version = GNU_AsmX86_64_Windows;
+ else version (Posix)
+ version = AsmX86_64_Posix;
}
}
else version (PPC)
// Do we have qsort_r function
enum Have_Qsort_R = @DCFG_HAVE_QSORT_R@;
-
-// Whether libphobos been configured with --enable-cet.
-enum GNU_Enable_CET = @DCFG_ENABLE_CET@;
# D flags for compilation
AM_DFLAGS= \
$(phobos_compiler_pic_flag) \
- $(WARN_DFLAGS) $(CHECKING_DFLAGS)
+ $(WARN_DFLAGS) $(CHECKING_DFLAGS) $(CET_DFLAGS)
+
+# Flags for other kinds of sources
+AM_CFLAGS=$(CET_FLAGS)
# Install all D files
ALL_PHOBOS_INSTALL_DSOURCES = $(PHOBOS_DSOURCES)
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@
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@
# D flags for compilation
AM_DFLAGS = \
$(phobos_compiler_pic_flag) \
- $(WARN_DFLAGS) $(CHECKING_DFLAGS)
+ $(WARN_DFLAGS) $(CHECKING_DFLAGS) $(CET_DFLAGS)
+# Flags for other kinds of sources
+AM_CFLAGS = $(CET_FLAGS)
+
# Install all D files
ALL_PHOBOS_INSTALL_DSOURCES = $(PHOBOS_DSOURCES)
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@
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@
;;
--gdcflags)
GDCFLAGS_default="-fmessage-length=0 -fno-show-column"
- GDCFLAGS_config="@WARN_DFLAGS@ @GDCFLAGS@ -fno-release -funittest"
+ GDCFLAGS_config="@WARN_DFLAGS@ @GDCFLAGS@ @CET_DFLAGS@ -fno-release -funittest"
echo ${GDCFLAGS_default} ${GDCFLAGS_config}
;;
--gdcpaths)