summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/lsan/Makefile.mk13
-rw-r--r--make/platform/clang_linux.mk6
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