summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2020-11-03 13:45:14 -0500
committerTavian Barnes <tavianator@tavianator.com>2020-11-03 13:45:14 -0500
commit9b34fc831eec048ee34d99250c240115f74b1bfa (patch)
treed04a007b6c890bb409dab318d20aa0019fb38dc3 /Makefile
parent77e594145c6c3da49f5e65a793d7cba90091f6bd (diff)
downloadbfs-9b34fc831eec048ee34d99250c240115f74b1bfa.tar.xz
Makefile: Fail early on sanitizer errors
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile8
1 files changed, 8 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index ab7e707..21c15be 100644
--- a/Makefile
+++ b/Makefile
@@ -55,6 +55,7 @@ LOCAL_LDLIBS :=
ASAN_CFLAGS := -fsanitize=address
MSAN_CFLAGS := -fsanitize=memory -fsanitize-memory-track-origins
UBSAN_CFLAGS := -fsanitize=undefined
+SANFLAGS := -fno-sanitize-recover
ifeq ($(OS),Linux)
LOCAL_LDFLAGS += -Wl,--as-needed
@@ -68,14 +69,21 @@ endif
ifneq ($(filter asan,$(MAKECMDGOALS)),)
LOCAL_CFLAGS += $(ASAN_CFLAGS)
+SANITIZE := y
endif
ifneq ($(filter msan,$(MAKECMDGOALS)),)
LOCAL_CFLAGS += $(MSAN_CFLAGS)
+SANITIZE := y
endif
ifneq ($(filter ubsan,$(MAKECMDGOALS)),)
LOCAL_CFLAGS += $(UBSAN_CFLAGS)
+SANITIZE := y
+endif
+
+ifdef SANITIZE
+LOCAL_CFLAGS += -fno-sanitize-recover=all
endif
ifneq ($(filter release,$(MAKECMDGOALS)),)