diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2022-03-02 15:08:22 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2022-03-09 08:57:56 -0500 |
commit | 6f2eaace7356815ead0add821709097ab43f93cc (patch) | |
tree | 3e5039cd392b3454dc64bb8d3c1797a25911b5fb /Makefile | |
parent | 35d30e42ac6981f888f5afa331a12e40f6ee19c5 (diff) | |
download | bfs-6f2eaace7356815ead0add821709097ab43f93cc.tar.xz |
Makefile: Add lsan and tsan flag targets
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -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)) |