diff options
author | Alexey Samsonov <samsonov@google.com> | 2013-08-20 14:49:01 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2013-08-20 14:49:01 +0000 |
commit | ebc0484ebbd1b7ed142b2851e3308559dabe79f7 (patch) | |
tree | 49dfae92dfc0fa28b9848532e07527ec20e275b6 | |
parent | 45c9df5517260bea38ea8583c68756f9a9aaec5b (diff) | |
download | compiler-rt-ebc0484ebbd1b7ed142b2851e3308559dabe79f7.tar.gz compiler-rt-ebc0484ebbd1b7ed142b2851e3308559dabe79f7.tar.bz2 compiler-rt-ebc0484ebbd1b7ed142b2851e3308559dabe79f7.tar.xz |
[LSan] Add support for building standalone LSan runtime to Make build (compiler-rt part)
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@188804 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/lsan/Makefile.mk | 13 | ||||
-rw-r--r-- | make/platform/clang_linux.mk | 6 |
2 files changed, 14 insertions, 5 deletions
diff --git a/lib/lsan/Makefile.mk b/lib/lsan/Makefile.mk index aae5c32f..2a6b41c9 100644 --- a/lib/lsan/Makefile.mk +++ b/lib/lsan/Makefile.mk @@ -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=%) diff --git a/make/platform/clang_linux.mk b/make/platform/clang_linux.mk index f9c75880..6877c149 100644 --- a/make/platform/clang_linux.mk +++ b/make/platform/clang_linux.mk @@ -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 $(SANITIZER_CFLAGS) -fno-rtti 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 := $(UbsanFunctions) 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 |