summaryrefslogtreecommitdiff
path: root/lib/sanitizer_common/CMakeLists.txt
diff options
context:
space:
mode:
authorDerek Bruening <bruening@google.com>2016-06-13 21:50:00 +0000
committerDerek Bruening <bruening@google.com>2016-06-13 21:50:00 +0000
commit2a8f0a92c347dbc714cab40a5c61cf336fa0be18 (patch)
treebd6fb5ac0bc518fa102a32c37d87dfb4ddc05819 /lib/sanitizer_common/CMakeLists.txt
parent97a35f8a8e9741e9157c0afdbb48a9db99d8a718 (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@272591 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/CMakeLists.txt')
-rw-r--r--lib/sanitizer_common/CMakeLists.txt16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/sanitizer_common/CMakeLists.txt b/lib/sanitizer_common/CMakeLists.txt
index c59ca591b..9b9ba4b56 100644
--- a/lib/sanitizer_common/CMakeLists.txt
+++ b/lib/sanitizer_common/CMakeLists.txt
@@ -34,6 +34,11 @@ set(SANITIZER_SOURCES_NOTERMINATION
sanitizer_thread_registry.cc
sanitizer_win.cc)
+if(NOT APPLE)
+ list(APPEND SANITIZER_SOURCES_NOTERMINATION
+ sanitizer_linux_x86_64.S)
+endif()
+
set(SANITIZER_SOURCES
${SANITIZER_SOURCES_NOTERMINATION} sanitizer_termination.cc)
@@ -133,6 +138,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 AND NOT APPLE)
+ # 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()