summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2013-05-22 13:20:37 +0000
committerAlexey Samsonov <samsonov@google.com>2013-05-22 13:20:37 +0000
commit49eb5700e2eb53eb0bb04b8178d1ef5ac68abef4 (patch)
tree401533831b3057ba1dbc86268991047b0d6ff539 /compiler-rt/lib
parent02c9c8c9f7f75bccc8c791fc659fd090e7e3a348 (diff)
downloadbcm5719-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/lib')
-rw-r--r--compiler-rt/lib/Makefile.mk1
-rw-r--r--compiler-rt/lib/asan/CMakeLists.txt2
-rw-r--r--compiler-rt/lib/asan/asan_allocator2.cc2
-rw-r--r--compiler-rt/lib/asan/asan_rtl.cc4
-rw-r--r--compiler-rt/lib/lsan/Makefile.mk23
5 files changed, 28 insertions, 4 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=%)
OpenPOWER on IntegriCloud