Revert r182465 and add lsan-common library to makefile-based build

llvm-svn: 182470
This commit is contained in:
Alexey Samsonov 2013-05-22 13:20:37 +00:00
parent 02c9c8c9f7
commit 49eb5700e2
6 changed files with 29 additions and 5 deletions

View File

@ -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)))

View File

@ -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)

View File

@ -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);

View File

@ -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");

View File

@ -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=%)

View File

@ -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) \