aboutsummaryrefslogtreecommitdiff
path: root/libsanitizer/tsan
diff options
context:
space:
mode:
authorIgor Tsimbalist <igor.v.tsimbalist@intel.com>2017-11-17 22:34:50 +0100
committerIgor Tsimbalist <itsimbal@gcc.gnu.org>2017-11-17 22:34:50 +0100
commit9069eb28d45baaa8baf5e3790b03b0e2cc5b49b3 (patch)
treef469641defe27b6947139a2f9ebaf9d086248a32 /libsanitizer/tsan
parent36101de96474a2c223625dcc28119779e555058f (diff)
downloadgcc-9069eb28d45baaa8baf5e3790b03b0e2cc5b49b3.zip
gcc-9069eb28d45baaa8baf5e3790b03b0e2cc5b49b3.tar.gz
gcc-9069eb28d45baaa8baf5e3790b03b0e2cc5b49b3.tar.bz2
Enable building libsanitizer with Intel CET
libsanitizer/ * acinclude.m4: Add enable.m4 and cet.m4. * Makefile.in: Regenerate. * asan/Makefile.am: Update AM_CXXFLAGS. * asan/Makefile.in: Regenerate. * configure: Likewise. * configure.ac: Set CET_FLAGS. Update EXTRA_CFLAGS, EXTRA_CXXFLAGS, EXTRA_ASFLAGS. * interception/Makefile.am: Update AM_CXXFLAGS. * interception/Makefile.in: Regenerate. * libbacktrace/Makefile.am: Update AM_CFLAGS, AM_CXXFLAGS. * libbacktrace/Makefile.in: Regenerate. * lsan/Makefile.am: Update AM_CXXFLAGS. * lsan/Makefile.in: Regenerate. * sanitizer_common/Makefile.am: Update AM_CXXFLAGS, AM_CCASFLAGS. * sanitizer_common/sanitizer_linux_x86_64.S: Include cet.h. Add _CET_ENDBR macro. * sanitizer_common/Makefile.in: Regenerate. * tsan/Makefile.am: Update AM_CXXFLAGS. * tsan/Makefile.in: Regenerate. * tsan/tsan_rtl_amd64.S Include cet.h. Add _CET_ENDBR macro. * ubsan/Makefile.am: Update AM_CXXFLAGS. * ubsan/Makefile.in: Regenerate. From-SVN: r254896
Diffstat (limited to 'libsanitizer/tsan')
-rw-r--r--libsanitizer/tsan/Makefile.am1
-rw-r--r--libsanitizer/tsan/Makefile.in8
-rw-r--r--libsanitizer/tsan/tsan_rtl_amd64.S7
3 files changed, 14 insertions, 2 deletions
diff --git a/libsanitizer/tsan/Makefile.am b/libsanitizer/tsan/Makefile.am
index c218983..753cb8f 100644
--- a/libsanitizer/tsan/Makefile.am
+++ b/libsanitizer/tsan/Makefile.am
@@ -7,6 +7,7 @@ DEFS = -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D
AM_CXXFLAGS = -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long -fPIC -fno-builtin -fno-exceptions -fno-rtti -fomit-frame-pointer -funwind-tables -fvisibility=hidden -Wno-variadic-macros
AM_CXXFLAGS += $(LIBSTDCXX_RAW_CXX_CXXFLAGS)
AM_CXXFLAGS += -std=gnu++11
+AM_CXXFLAGS += $(EXTRA_CXXFLAGS)
ACLOCAL_AMFLAGS = -I m4
toolexeclib_LTLIBRARIES = libtsan.la
diff --git a/libsanitizer/tsan/Makefile.in b/libsanitizer/tsan/Makefile.in
index e32e9c0..629056b 100644
--- a/libsanitizer/tsan/Makefile.in
+++ b/libsanitizer/tsan/Makefile.in
@@ -68,7 +68,8 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
$(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \
$(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \
$(top_srcdir)/acinclude.m4 $(top_srcdir)/../libtool.m4 \
- $(top_srcdir)/configure.ac
+ $(top_srcdir)/../config/enable.m4 \
+ $(top_srcdir)/../config/cet.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
@@ -193,6 +194,9 @@ ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
+EXTRA_ASFLAGS = @EXTRA_ASFLAGS@
+EXTRA_CFLAGS = @EXTRA_CFLAGS@
+EXTRA_CXXFLAGS = @EXTRA_CXXFLAGS@
FGREP = @FGREP@
FORMAT_FILE = @FORMAT_FILE@
GREP = @GREP@
@@ -313,7 +317,7 @@ AM_CXXFLAGS = -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic \
-Wno-long-long -fPIC -fno-builtin -fno-exceptions -fno-rtti \
-fomit-frame-pointer -funwind-tables -fvisibility=hidden \
-Wno-variadic-macros $(LIBSTDCXX_RAW_CXX_CXXFLAGS) \
- -std=gnu++11
+ -std=gnu++11 $(EXTRA_CXXFLAGS)
ACLOCAL_AMFLAGS = -I m4
toolexeclib_LTLIBRARIES = libtsan.la
nodist_toolexeclib_HEADERS = libtsan_preinit.o
diff --git a/libsanitizer/tsan/tsan_rtl_amd64.S b/libsanitizer/tsan/tsan_rtl_amd64.S
index 98947fd..4eb1ffd 100644
--- a/libsanitizer/tsan/tsan_rtl_amd64.S
+++ b/libsanitizer/tsan/tsan_rtl_amd64.S
@@ -2,6 +2,7 @@
#if defined(__x86_64__)
#include "sanitizer_common/sanitizer_asm.h"
+#include "cet.h"
#if !defined(__APPLE__)
.section .text
@@ -13,6 +14,7 @@ ASM_HIDDEN(__tsan_trace_switch)
.globl ASM_TSAN_SYMBOL(__tsan_trace_switch_thunk)
ASM_TSAN_SYMBOL(__tsan_trace_switch_thunk):
CFI_STARTPROC
+ _CET_ENDBR
# Save scratch registers.
push %rax
CFI_ADJUST_CFA_OFFSET(8)
@@ -93,6 +95,7 @@ ASM_HIDDEN(__tsan_report_race)
.globl ASM_TSAN_SYMBOL(__tsan_report_race_thunk)
ASM_TSAN_SYMBOL(__tsan_report_race_thunk):
CFI_STARTPROC
+ _CET_ENDBR
# Save scratch registers.
push %rax
CFI_ADJUST_CFA_OFFSET(8)
@@ -177,6 +180,7 @@ ASM_HIDDEN(__tsan_setjmp)
ASM_TYPE_FUNCTION(ASM_TSAN_SYMBOL_INTERCEPTOR(setjmp))
ASM_TSAN_SYMBOL_INTERCEPTOR(setjmp):
CFI_STARTPROC
+ _CET_ENDBR
// save env parameter
push %rdi
CFI_ADJUST_CFA_OFFSET(8)
@@ -218,6 +222,7 @@ ASM_SIZE(ASM_TSAN_SYMBOL_INTERCEPTOR(setjmp))
ASM_TYPE_FUNCTION(ASM_TSAN_SYMBOL_INTERCEPTOR(_setjmp))
ASM_TSAN_SYMBOL_INTERCEPTOR(_setjmp):
CFI_STARTPROC
+ _CET_ENDBR
// save env parameter
push %rdi
CFI_ADJUST_CFA_OFFSET(8)
@@ -259,6 +264,7 @@ ASM_SIZE(ASM_TSAN_SYMBOL_INTERCEPTOR(_setjmp))
ASM_TYPE_FUNCTION(ASM_TSAN_SYMBOL_INTERCEPTOR(sigsetjmp))
ASM_TSAN_SYMBOL_INTERCEPTOR(sigsetjmp):
CFI_STARTPROC
+ _CET_ENDBR
// save env parameter
push %rdi
CFI_ADJUST_CFA_OFFSET(8)
@@ -315,6 +321,7 @@ ASM_SIZE(ASM_TSAN_SYMBOL_INTERCEPTOR(sigsetjmp))
ASM_TYPE_FUNCTION(ASM_TSAN_SYMBOL_INTERCEPTOR(__sigsetjmp))
ASM_TSAN_SYMBOL_INTERCEPTOR(__sigsetjmp):
CFI_STARTPROC
+ _CET_ENDBR
// save env parameter
push %rdi
CFI_ADJUST_CFA_OFFSET(8)