forked from OSchip/llvm-project
Revert r182465 and add lsan-common library to makefile-based build
llvm-svn: 182470
This commit is contained in:
parent
02c9c8c9f7
commit
49eb5700e2
|
@ -21,6 +21,7 @@ SubDirs += sanitizer_common
|
||||||
SubDirs += tsan
|
SubDirs += tsan
|
||||||
SubDirs += msan
|
SubDirs += msan
|
||||||
SubDirs += ubsan
|
SubDirs += ubsan
|
||||||
|
SubDirs += lsan
|
||||||
|
|
||||||
# Define the variables for this specific directory.
|
# Define the variables for this specific directory.
|
||||||
Sources := $(foreach file,$(wildcard $(Dir)/*.c),$(notdir $(file)))
|
Sources := $(foreach file,$(wildcard $(Dir)/*.c),$(notdir $(file)))
|
||||||
|
|
|
@ -85,7 +85,7 @@ else()
|
||||||
$<TARGET_OBJECTS:RTInterception.${arch}>
|
$<TARGET_OBJECTS:RTInterception.${arch}>
|
||||||
$<TARGET_OBJECTS:RTSanitizerCommon.${arch}>
|
$<TARGET_OBJECTS:RTSanitizerCommon.${arch}>
|
||||||
$<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}>
|
$<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}>
|
||||||
#$<TARGET_OBJECTS:RTLSanCommon.${arch}>
|
$<TARGET_OBJECTS:RTLSanCommon.${arch}>
|
||||||
CFLAGS ${ASAN_CFLAGS}
|
CFLAGS ${ASAN_CFLAGS}
|
||||||
DEFS ${ASAN_COMMON_DEFINITIONS}
|
DEFS ${ASAN_COMMON_DEFINITIONS}
|
||||||
SYMS asan.syms)
|
SYMS asan.syms)
|
||||||
|
|
|
@ -768,7 +768,7 @@ u32 LsanMetadata::stack_trace_id() const {
|
||||||
template <typename Callable> void ForEachChunk(Callable const &callback) {
|
template <typename Callable> void ForEachChunk(Callable const &callback) {
|
||||||
__asan::allocator.ForEachChunk(callback);
|
__asan::allocator.ForEachChunk(callback);
|
||||||
}
|
}
|
||||||
#if 0
|
#if CAN_SANITIZE_LEAKS
|
||||||
template void ForEachChunk<ProcessPlatformSpecificAllocationsCb>(
|
template void ForEachChunk<ProcessPlatformSpecificAllocationsCb>(
|
||||||
ProcessPlatformSpecificAllocationsCb const &callback);
|
ProcessPlatformSpecificAllocationsCb const &callback);
|
||||||
template void ForEachChunk<PrintLeakedCb>(PrintLeakedCb const &callback);
|
template void ForEachChunk<PrintLeakedCb>(PrintLeakedCb const &callback);
|
||||||
|
|
|
@ -560,12 +560,12 @@ void __asan_init() {
|
||||||
|
|
||||||
InitializeAllocator();
|
InitializeAllocator();
|
||||||
|
|
||||||
#if 0
|
#if CAN_SANITIZE_LEAKS
|
||||||
__lsan::InitCommonLsan();
|
__lsan::InitCommonLsan();
|
||||||
if (flags()->detect_leaks) {
|
if (flags()->detect_leaks) {
|
||||||
Atexit(__lsan::DoLeakCheck);
|
Atexit(__lsan::DoLeakCheck);
|
||||||
}
|
}
|
||||||
#endif
|
#endif // CAN_SANITIZE_LEAKS
|
||||||
|
|
||||||
if (flags()->verbosity) {
|
if (flags()->verbosity) {
|
||||||
Report("AddressSanitizer Init done\n");
|
Report("AddressSanitizer Init done\n");
|
||||||
|
|
|
@ -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=%)
|
|
@ -130,7 +130,7 @@ FUNCTIONS.san-x86_64 := $(SanitizerCommonFunctions)
|
||||||
FUNCTIONS.asan-i386 := $(AsanFunctions) $(InterceptionFunctions) \
|
FUNCTIONS.asan-i386 := $(AsanFunctions) $(InterceptionFunctions) \
|
||||||
$(SanitizerCommonFunctions)
|
$(SanitizerCommonFunctions)
|
||||||
FUNCTIONS.asan-x86_64 := $(AsanFunctions) $(InterceptionFunctions) \
|
FUNCTIONS.asan-x86_64 := $(AsanFunctions) $(InterceptionFunctions) \
|
||||||
$(SanitizerCommonFunctions)
|
$(SanitizerCommonFunctions) $(LsanCommonFunctions)
|
||||||
FUNCTIONS.asan-arm-android := $(AsanFunctions) $(InterceptionFunctions) \
|
FUNCTIONS.asan-arm-android := $(AsanFunctions) $(InterceptionFunctions) \
|
||||||
$(SanitizerCommonFunctions)
|
$(SanitizerCommonFunctions)
|
||||||
FUNCTIONS.tsan-x86_64 := $(TsanFunctions) $(InterceptionFunctions) \
|
FUNCTIONS.tsan-x86_64 := $(TsanFunctions) $(InterceptionFunctions) \
|
||||||
|
|
Loading…
Reference in New Issue