summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2022-03-02 15:08:22 -0500
committerTavian Barnes <tavianator@tavianator.com>2022-03-09 08:57:56 -0500
commit6f2eaace7356815ead0add821709097ab43f93cc (patch)
tree3e5039cd392b3454dc64bb8d3c1797a25911b5fb /Makefile
parent35d30e42ac6981f888f5afa331a12e40f6ee19c5 (diff)
downloadbfs-6f2eaace7356815ead0add821709097ab43f93cc.tar.xz
Makefile: Add lsan and tsan flag targets
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile14
1 files changed, 13 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 8ca542b..f1a483b 100644
--- a/Makefile
+++ b/Makefile
@@ -65,7 +65,9 @@ LOCAL_LDFLAGS :=
LOCAL_LDLIBS :=
ASAN := $(filter asan,$(MAKECMDGOALS))
+LSAN := $(filter lsan,$(MAKECMDGOALS))
MSAN := $(filter msan,$(MAKECMDGOALS))
+TSAN := $(filter tsan,$(MAKECMDGOALS))
UBSAN := $(filter ubsan,$(MAKECMDGOALS))
ifndef MSAN
@@ -129,11 +131,21 @@ LOCAL_CFLAGS += -fsanitize=address
SANITIZE := y
endif
+ifdef LSAN
+LOCAL_CFLAGS += -fsanitize=leak
+SANITIZE := y
+endif
+
ifdef MSAN
LOCAL_CFLAGS += -fsanitize=memory -fsanitize-memory-track-origins
SANITIZE := y
endif
+ifdef TSAN
+LOCAL_CFLAGS += -fsanitize=thread
+SANITIZE := y
+endif
+
ifdef UBSAN
LOCAL_CFLAGS += -fsanitize=undefined
SANITIZE := y
@@ -164,7 +176,7 @@ $(shell ./flags.sh $(ALL_FLAGS))
BIN_GOALS := bfs tests/mksock tests/trie tests/xtimegm
# Goals that are treated like flags by this Makefile
-FLAG_GOALS := asan msan ubsan gcov release
+FLAG_GOALS := asan lsan msan tsan ubsan gcov release
# These are the remaining non-flag goals
GOALS := $(filter-out $(FLAG_GOALS),$(MAKECMDGOALS))