diff options
author | Derek Bruening <bruening@google.com> | 2016-06-14 15:15:38 +0000 |
---|---|---|
committer | Derek Bruening <bruening@google.com> | 2016-06-14 15:15:38 +0000 |
commit | b90f32bd596ec6e4c29d1e22bf83da6b2539d132 (patch) | |
tree | fa740508825a7aaf127adc09985d3f927e33a70f /lib/sanitizer_common/CMakeLists.txt | |
parent | df01596dcf605330585d5d539914aa9e25e45bb2 (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@272676 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/CMakeLists.txt')
-rw-r--r-- | lib/sanitizer_common/CMakeLists.txt | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/sanitizer_common/CMakeLists.txt b/lib/sanitizer_common/CMakeLists.txt index c59ca591b..4af000919 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(UNIX AND 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 UNIX 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() |