[compiler-rt] r182470 - Revert r182465 and add lsan-common library to makefile-based build

Alexey Samsonov samsonov at google.com
Wed May 22 06:20:37 PDT 2013


Author: samsonov
Date: Wed May 22 08:20:37 2013
New Revision: 182470

URL: http://llvm.org/viewvc/llvm-project?rev=182470&view=rev
Log:
Revert r182465 and add lsan-common library to makefile-based build

Added:
    compiler-rt/trunk/lib/lsan/Makefile.mk
Modified:
    compiler-rt/trunk/lib/Makefile.mk
    compiler-rt/trunk/lib/asan/CMakeLists.txt
    compiler-rt/trunk/lib/asan/asan_allocator2.cc
    compiler-rt/trunk/lib/asan/asan_rtl.cc
    compiler-rt/trunk/make/platform/clang_linux.mk

Modified: compiler-rt/trunk/lib/Makefile.mk
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/Makefile.mk?rev=182470&r1=182469&r2=182470&view=diff
==============================================================================
--- compiler-rt/trunk/lib/Makefile.mk (original)
+++ compiler-rt/trunk/lib/Makefile.mk Wed May 22 08:20:37 2013
@@ -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)))

Modified: compiler-rt/trunk/lib/asan/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/CMakeLists.txt?rev=182470&r1=182469&r2=182470&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/asan/CMakeLists.txt Wed May 22 08:20:37 2013
@@ -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)

Modified: compiler-rt/trunk/lib/asan/asan_allocator2.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_allocator2.cc?rev=182470&r1=182469&r2=182470&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_allocator2.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_allocator2.cc Wed May 22 08:20:37 2013
@@ -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);

Modified: compiler-rt/trunk/lib/asan/asan_rtl.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_rtl.cc?rev=182470&r1=182469&r2=182470&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_rtl.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_rtl.cc Wed May 22 08:20:37 2013
@@ -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");

Added: compiler-rt/trunk/lib/lsan/Makefile.mk
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/lsan/Makefile.mk?rev=182470&view=auto
==============================================================================
--- compiler-rt/trunk/lib/lsan/Makefile.mk (added)
+++ compiler-rt/trunk/lib/lsan/Makefile.mk Wed May 22 08:20:37 2013
@@ -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=%)

Modified: compiler-rt/trunk/make/platform/clang_linux.mk
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/make/platform/clang_linux.mk?rev=182470&r1=182469&r2=182470&view=diff
==============================================================================
--- compiler-rt/trunk/make/platform/clang_linux.mk (original)
+++ compiler-rt/trunk/make/platform/clang_linux.mk Wed May 22 08:20:37 2013
@@ -130,7 +130,7 @@ FUNCTIONS.san-x86_64 := $(SanitizerCommo
 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) \





More information about the llvm-commits mailing list