diff options
author | Alexey Samsonov <samsonov@google.com> | 2013-05-22 13:20:37 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2013-05-22 13:20:37 +0000 |
commit | 49eb5700e2eb53eb0bb04b8178d1ef5ac68abef4 (patch) | |
tree | 401533831b3057ba1dbc86268991047b0d6ff539 /compiler-rt | |
parent | 02c9c8c9f7f75bccc8c791fc659fd090e7e3a348 (diff) | |
download | bcm5719-llvm-49eb5700e2eb53eb0bb04b8178d1ef5ac68abef4.tar.gz bcm5719-llvm-49eb5700e2eb53eb0bb04b8178d1ef5ac68abef4.zip |
Revert r182465 and add lsan-common library to makefile-based build
llvm-svn: 182470
Diffstat (limited to 'compiler-rt')
-rw-r--r-- | compiler-rt/lib/Makefile.mk | 1 | ||||
-rw-r--r-- | compiler-rt/lib/asan/CMakeLists.txt | 2 | ||||
-rw-r--r-- | compiler-rt/lib/asan/asan_allocator2.cc | 2 | ||||
-rw-r--r-- | compiler-rt/lib/asan/asan_rtl.cc | 4 | ||||
-rw-r--r-- | compiler-rt/lib/lsan/Makefile.mk | 23 | ||||
-rw-r--r-- | compiler-rt/make/platform/clang_linux.mk | 2 |
6 files changed, 29 insertions, 5 deletions
diff --git a/compiler-rt/lib/Makefile.mk b/compiler-rt/lib/Makefile.mk index 8b912c43cf3..8054c35aa36 100644 --- a/compiler-rt/lib/Makefile.mk +++ b/compiler-rt/lib/Makefile.mk @@ -21,6 +21,7 @@ SubDirs += sanitizer_common SubDirs += tsan SubDirs += msan SubDirs += ubsan +SubDirs += lsan # Define the variables for this specific directory. Sources := $(foreach file,$(wildcard $(Dir)/*.c),$(notdir $(file))) diff --git a/compiler-rt/lib/asan/CMakeLists.txt b/compiler-rt/lib/asan/CMakeLists.txt index 98544a418e2..a567a4d3e97 100644 --- a/compiler-rt/lib/asan/CMakeLists.txt +++ b/compiler-rt/lib/asan/CMakeLists.txt @@ -85,7 +85,7 @@ else() $<TARGET_OBJECTS:RTInterception.${arch}> $<TARGET_OBJECTS:RTSanitizerCommon.${arch}> $<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}> - #$<TARGET_OBJECTS:RTLSanCommon.${arch}> + $<TARGET_OBJECTS:RTLSanCommon.${arch}> CFLAGS ${ASAN_CFLAGS} DEFS ${ASAN_COMMON_DEFINITIONS} SYMS asan.syms) diff --git a/compiler-rt/lib/asan/asan_allocator2.cc b/compiler-rt/lib/asan/asan_allocator2.cc index 79fda78cd7a..4c57affbb39 100644 --- a/compiler-rt/lib/asan/asan_allocator2.cc +++ b/compiler-rt/lib/asan/asan_allocator2.cc @@ -768,7 +768,7 @@ u32 LsanMetadata::stack_trace_id() const { template <typename Callable> void ForEachChunk(Callable const &callback) { __asan::allocator.ForEachChunk(callback); } -#if 0 +#if CAN_SANITIZE_LEAKS template void ForEachChunk<ProcessPlatformSpecificAllocationsCb>( ProcessPlatformSpecificAllocationsCb const &callback); template void ForEachChunk<PrintLeakedCb>(PrintLeakedCb const &callback); diff --git a/compiler-rt/lib/asan/asan_rtl.cc b/compiler-rt/lib/asan/asan_rtl.cc index 539ed9b8c5b..f989c5c0d2a 100644 --- a/compiler-rt/lib/asan/asan_rtl.cc +++ b/compiler-rt/lib/asan/asan_rtl.cc @@ -560,12 +560,12 @@ void __asan_init() { InitializeAllocator(); -#if 0 +#if CAN_SANITIZE_LEAKS __lsan::InitCommonLsan(); if (flags()->detect_leaks) { Atexit(__lsan::DoLeakCheck); } -#endif +#endif // CAN_SANITIZE_LEAKS if (flags()->verbosity) { Report("AddressSanitizer Init done\n"); diff --git a/compiler-rt/lib/lsan/Makefile.mk b/compiler-rt/lib/lsan/Makefile.mk new file mode 100644 index 00000000000..aae5c32fd32 --- /dev/null +++ b/compiler-rt/lib/lsan/Makefile.mk @@ -0,0 +1,23 @@ +#===- lib/lsan/Makefile.mk ---------------------------------*- Makefile -*--===# +# +# The LLVM Compiler Infrastructure +# +# This file is distributed under the University of Illinois Open Source +# License. See LICENSE.TXT for details. +# +#===------------------------------------------------------------------------===# + +ModuleName := lsan_common +SubDirs := + +Sources := $(foreach file,$(wildcard $(Dir)/lsan_common*.cc),$(notdir $(file))) +ObjNames := $(Sources:%.cc=%.o) + +Implementation := Generic + +# FIXME: use automatic dependencies? +Dependencies := $(wildcard $(Dir)/*.h) +Dependencies += $(wildcard $(Dir)/../sanitizer_common/*.h) + +# Define a convenience variable for all the asan functions. +LsanCommonFunctions := $(Sources:%.cc=%) diff --git a/compiler-rt/make/platform/clang_linux.mk b/compiler-rt/make/platform/clang_linux.mk index 985e485985a..05efdb6d67e 100644 --- a/compiler-rt/make/platform/clang_linux.mk +++ b/compiler-rt/make/platform/clang_linux.mk @@ -130,7 +130,7 @@ FUNCTIONS.san-x86_64 := $(SanitizerCommonFunctions) FUNCTIONS.asan-i386 := $(AsanFunctions) $(InterceptionFunctions) \ $(SanitizerCommonFunctions) FUNCTIONS.asan-x86_64 := $(AsanFunctions) $(InterceptionFunctions) \ - $(SanitizerCommonFunctions) + $(SanitizerCommonFunctions) $(LsanCommonFunctions) FUNCTIONS.asan-arm-android := $(AsanFunctions) $(InterceptionFunctions) \ $(SanitizerCommonFunctions) FUNCTIONS.tsan-x86_64 := $(TsanFunctions) $(InterceptionFunctions) \ |