From 6f2eaace7356815ead0add821709097ab43f93cc Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Wed, 2 Mar 2022 15:08:22 -0500 Subject: Makefile: Add lsan and tsan flag targets --- Makefile | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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)) -- cgit v1.2.3