summaryrefslogtreecommitdiff
path: root/lib/sanitizer_common/CMakeLists.txt
diff options
context:
space:
mode:
authorDerek Bruening <bruening@google.com>2016-06-13 15:42:39 +0000
committerDerek Bruening <bruening@google.com>2016-06-13 15:42:39 +0000
commitd5a0419aecd169af9f26b6f7254ff2ef555e497f (patch)
treec969efaae3f2a01befbd5c81c9c5a21988cd680e /lib/sanitizer_common/CMakeLists.txt
parent51be894d7708c17d006a298b247facc796305db0 (diff)
[sanitizer][esan] Add internal_sigaction_syscall
Summary: Adds a version of sigaction that uses a raw system call, to avoid circular dependencies and support calling sigaction prior to setting up interceptors. The new sigaction relies on an assembly sigreturn routine for its restorer, which is Linux x86_64-only for now. Uses the new sigaction to initialize the working set tool's shadow fault handler prior to libc interceptor being set up. This is required to support instrumentation invoked during interceptor setup, which happens with an instrumented tcmalloc or other allocator compiled with esan. Adds a test that emulates an instrumented allocator. Reviewers: aizatsky Subscribers: vitalybuka, tberghammer, zhaoqin, danalbert, kcc, srhines, eugenis, llvm-commits, kubabrecka Differential Revision: http://reviews.llvm.org/D21083 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@272553 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/CMakeLists.txt')
-rw-r--r--lib/sanitizer_common/CMakeLists.txt12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/sanitizer_common/CMakeLists.txt b/lib/sanitizer_common/CMakeLists.txt
index c59ca591b..52f4d5e7f 100644
--- a/lib/sanitizer_common/CMakeLists.txt
+++ b/lib/sanitizer_common/CMakeLists.txt
@@ -12,6 +12,7 @@ set(SANITIZER_SOURCES_NOTERMINATION
sanitizer_libignore.cc
sanitizer_linux.cc
sanitizer_linux_s390.cc
+ sanitizer_linux_x86_64.S
sanitizer_mac.cc
sanitizer_persistent_allocator.cc
sanitizer_platform_limits_linux.cc
@@ -133,6 +134,17 @@ append_list_if(SANITIZER_LIMIT_FRAME_SIZE -Wframe-larger-than=570
append_list_if(COMPILER_RT_HAS_WGLOBAL_CONSTRUCTORS_FLAG -Wglobal-constructors
SANITIZER_CFLAGS)
+if (LLVM_ENABLE_PEDANTIC)
+ # With -pedantic, our .S files raise warnings about empty macro arguments
+ # from __USER_LABEL_PREFIX__ being an empty arg to GLUE(). Unfortunately,
+ # there is no simple way to test for an empty define, nor to disable just
+ # that warning or to disable -pedantic. There is also no simple way to
+ # remove -pedantic from just this file (we'd have to remove from
+ # CMAKE_C*_FLAGS and re-add as a source property to all the non-.S files).
+ set_source_files_properties(sanitizer_linux_x86_64.S
+ PROPERTIES COMPILE_FLAGS "-w")
+endif ()
+
if(APPLE)
set(OS_OPTION OS ${SANITIZER_COMMON_SUPPORTED_OS})
endif()