[compiler-rt] r188804 - [LSan] Add support for building standalone LSan runtime to Make build (compiler-rt part)

Alexey Samsonov samsonov at google.com
Tue Aug 20 07:49:01 PDT 2013


Author: samsonov
Date: Tue Aug 20 09:49:01 2013
New Revision: 188804

URL: http://llvm.org/viewvc/llvm-project?rev=188804&view=rev
Log:
[LSan] Add support for building standalone LSan runtime to Make build (compiler-rt part)

Modified:
    compiler-rt/trunk/lib/lsan/Makefile.mk
    compiler-rt/trunk/make/platform/clang_linux.mk

Modified: compiler-rt/trunk/lib/lsan/Makefile.mk
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/lsan/Makefile.mk?rev=188804&r1=188803&r2=188804&view=diff
==============================================================================
--- compiler-rt/trunk/lib/lsan/Makefile.mk (original)
+++ compiler-rt/trunk/lib/lsan/Makefile.mk Tue Aug 20 09:49:01 2013
@@ -7,17 +7,22 @@
 #
 #===------------------------------------------------------------------------===#
 
-ModuleName := lsan_common
+ModuleName := lsan
 SubDirs := 
 
-Sources := $(foreach file,$(wildcard $(Dir)/lsan_common*.cc),$(notdir $(file)))
+Sources := $(foreach file,$(wildcard $(Dir)/*.cc),$(notdir $(file)))
 ObjNames := $(Sources:%.cc=%.o)
 
 Implementation := Generic
 
 # FIXME: use automatic dependencies?
 Dependencies := $(wildcard $(Dir)/*.h)
+Dependencies += $(wildcard $(Dir)/../interception/*.h)
 Dependencies += $(wildcard $(Dir)/../sanitizer_common/*.h)
 
-# Define a convenience variable for all the asan functions.
-LsanCommonFunctions := $(Sources:%.cc=%)
+# Define a convenience variable for all the lsan functions.
+LsanFunctions := $(Sources:%.cc=%)
+
+# lsan functions used in another sanitizers.
+LsanCommonSources := $(foreach file,$(wildcard $(Dir)/lsan_common*.cc),$(notdir $(file)))
+LsanCommonFunctions := $(LsanCommonSources:%.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=188804&r1=188803&r2=188804&view=diff
==============================================================================
--- compiler-rt/trunk/make/platform/clang_linux.mk (original)
+++ compiler-rt/trunk/make/platform/clang_linux.mk Tue Aug 20 09:49:01 2013
@@ -61,7 +61,7 @@ endif
 # Build runtime libraries for x86_64.
 ifeq ($(call contains,$(SupportedArches),x86_64),true)
 Configs += full-x86_64 profile-x86_64 san-x86_64 asan-x86_64 tsan-x86_64 \
-           msan-x86_64 ubsan-x86_64 ubsan_cxx-x86_64 dfsan-x86_64
+           msan-x86_64 ubsan-x86_64 ubsan_cxx-x86_64 dfsan-x86_64 lsan-x86_64
 Arch.full-x86_64 := x86_64
 Arch.profile-x86_64 := x86_64
 Arch.san-x86_64 := x86_64
@@ -71,6 +71,7 @@ Arch.msan-x86_64 := x86_64
 Arch.ubsan-x86_64 := x86_64
 Arch.ubsan_cxx-x86_64 := x86_64
 Arch.dfsan-x86_64 := x86_64
+Arch.lsan-x86_64 := x86_64
 endif
 
 ifneq ($(LLVM_ANDROID_TOOLCHAIN_DIR),)
@@ -103,6 +104,7 @@ CFLAGS.ubsan-x86_64 := $(CFLAGS) -m64 $(
 CFLAGS.ubsan_cxx-i386 := $(CFLAGS) -m32 $(SANITIZER_CFLAGS)
 CFLAGS.ubsan_cxx-x86_64 := $(CFLAGS) -m64 $(SANITIZER_CFLAGS)
 CFLAGS.dfsan-x86_64 := $(CFLAGS) -m64 $(SANITIZER_CFLAGS)
+CFLAGS.lsan-x86_64 := $(CFLAGS) -m64 $(SANITIZER_CFLAGS)
 
 SHARED_LIBRARY.asan-arm-android := 1
 ANDROID_COMMON_FLAGS := -target arm-linux-androideabi \
@@ -140,6 +142,8 @@ FUNCTIONS.ubsan-x86_64 := $(UbsanFunctio
 FUNCTIONS.ubsan_cxx-i386 := $(UbsanCXXFunctions)
 FUNCTIONS.ubsan_cxx-x86_64 := $(UbsanCXXFunctions)
 FUNCTIONS.dfsan-x86_64 := $(DfsanFunctions) $(SanitizerCommonFunctions)
+FUNCTIONS.lsan-x86_64 := $(LsanFunctions) $(InterceptionFunctions) \
+                                          $(SanitizerCommonFunctions)
 
 # Always use optimized variants.
 OPTIMIZED := 1





More information about the llvm-commits mailing list