diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2020-11-03 13:45:14 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2020-11-03 13:45:14 -0500 |
commit | 9b34fc831eec048ee34d99250c240115f74b1bfa (patch) | |
tree | d04a007b6c890bb409dab318d20aa0019fb38dc3 /Makefile | |
parent | 77e594145c6c3da49f5e65a793d7cba90091f6bd (diff) | |
download | bfs-9b34fc831eec048ee34d99250c240115f74b1bfa.tar.xz |
Makefile: Fail early on sanitizer errors
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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)),) |