subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
+ $(top_srcdir)/../config/cet.m4 \
+ $(top_srcdir)/../config/enable.m4 \
$(top_srcdir)/../config/lead-dot.m4 \
$(top_srcdir)/../config/multi.m4 \
$(top_srcdir)/../config/override.m4 \
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@
CFLAGS_FOR_BUILD
CC_FOR_BUILD
AR
+DCFG_ENABLE_CET
CET_FLAGS
RANLIB
MAINT
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
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
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
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
# 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)
# This should be inherited in the recursive make, but ensure it is defined.
test "$AR" || AR=ar
subdir = libdruntime
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
+ $(top_srcdir)/../config/cet.m4 \
+ $(top_srcdir)/../config/enable.m4 \
$(top_srcdir)/../config/lead-dot.m4 \
$(top_srcdir)/../config/multi.m4 \
$(top_srcdir)/../config/override.m4 \
CCAS = @CCAS@
CCASFLAGS = @CCASFLAGS@
CC_FOR_BUILD = @CC_FOR_BUILD@
+CET_FLAGS = @CET_FLAGS@
CFLAGS = @CFLAGS@
CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
CHECKING_DFLAGS = @CHECKING_DFLAGS@
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@
#include "../common/threadasm.S"
-#ifdef __CET__
-# include <cet.h>
-#else
-# define _CET_ENDBR
-#endif
-
-#if defined(__i386__)
+#if defined(__i386__) && !defined(__CET__)
.text
.globl CSYM(fiber_switchContext)
.align 16
CSYM(fiber_switchContext):
.cfi_startproc
- _CET_ENDBR
// save current stack state
push %ebp
mov %esp, %ebp
.cfi_endproc
.size CSYM(fiber_switchContext),.-CSYM(fiber_switchContext)
-#elif defined(__x86_64__) && !defined(__ILP32__)
+#elif defined(__x86_64__) && !defined(__ILP32__) && !defined(__CET__)
.text
.globl CSYM(fiber_switchContext)
.align 16
CSYM(fiber_switchContext):
.cfi_startproc
- _CET_ENDBR
// Save current stack state.save current stack state
push %rbp
mov %rsp, %rbp
}
else version (X86)
{
- version = AsmExternal;
+ import gcc.config;
- version (MinGW)
- {
- version = GNU_AsmX86_Windows;
- version = AlignFiberStackTo16Byte;
- }
- else version (Posix)
+ version = AlignFiberStackTo16Byte;
+
+ static if (!GNU_Enable_CET)
{
- version = AsmX86_Posix;
- version (OSX)
- version = AlignFiberStackTo16Byte;
+ version = AsmExternal;
+
+ version (MinGW)
+ {
+ version = GNU_AsmX86_Windows;
+ }
+ else version (Posix)
+ {
+ version = AsmX86_Posix;
+ }
}
}
else version (X86_64)
{
- version (D_X32)
- {
- // let X32 be handled by ucontext swapcontext
- }
- else
+ import gcc.config;
+
+ version = AlignFiberStackTo16Byte;
+
+ static if (!GNU_Enable_CET)
{
- version = AsmExternal;
- version = AlignFiberStackTo16Byte;
+ 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@;
subdir = src
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
+ $(top_srcdir)/../config/cet.m4 \
+ $(top_srcdir)/../config/enable.m4 \
$(top_srcdir)/../config/lead-dot.m4 \
$(top_srcdir)/../config/multi.m4 \
$(top_srcdir)/../config/override.m4 \
CCAS = @CCAS@
CCASFLAGS = @CCASFLAGS@
CC_FOR_BUILD = @CC_FOR_BUILD@
+CET_FLAGS = @CET_FLAGS@
CFLAGS = @CFLAGS@
CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
CHECKING_DFLAGS = @CHECKING_DFLAGS@
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@
subdir = testsuite
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
+ $(top_srcdir)/../config/cet.m4 \
+ $(top_srcdir)/../config/enable.m4 \
$(top_srcdir)/../config/lead-dot.m4 \
$(top_srcdir)/../config/multi.m4 \
$(top_srcdir)/../config/override.m4 \
CCAS = @CCAS@
CCASFLAGS = @CCASFLAGS@
CC_FOR_BUILD = @CC_FOR_BUILD@
+CET_FLAGS = @CET_FLAGS@
CFLAGS = @CFLAGS@
CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
CHECKING_DFLAGS = @CHECKING_DFLAGS@
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@