From f8e9397b508479b79f5dad062160b50d38686cb3 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Fri, 13 Sep 2019 17:03:13 -0400 Subject: Makefile: Include -fsanitize=* in the sanitizer flag variables --- Makefile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index a079c08..34bacae 100644 --- a/Makefile +++ b/Makefile @@ -52,12 +52,16 @@ LOCAL_CFLAGS := -std=c99 LOCAL_LDFLAGS := LOCAL_LDLIBS := +ASAN_CFLAGS := -fsanitize=address +MSAN_CFLAGS := -fsanitize=memory +UBSAN_CFLAGS := -fsanitize=undefined + ifeq ($(OS),Linux) LOCAL_LDFLAGS += -Wl,--as-needed LOCAL_LDLIBS += -lacl -lcap -lattr -lrt # These libraries are not built with msan, so disable them -MSAN_CFLAGS := -DBFS_HAS_SYS_ACL=0 -DBFS_HAS_SYS_CAPABILITY=0 -DBFS_HAS_SYS_XATTR=0 +MSAN_CFLAGS += -DBFS_HAS_SYS_ACL=0 -DBFS_HAS_SYS_CAPABILITY=0 -DBFS_HAS_SYS_XATTR=0 endif ALL_CPPFLAGS = $(LOCAL_CPPFLAGS) $(CPPFLAGS) @@ -105,9 +109,9 @@ check: all ./tests.sh --bfs="$(CURDIR)/bfs -S ids" distcheck: - +$(MAKE) -Bs check CFLAGS="$(CFLAGS) -fsanitize=undefined -fsanitize=address" + +$(MAKE) -Bs check CFLAGS="$(CFLAGS) $(ASAN_CFLAGS) $(UBSAN_CFLAGS)" ifneq ($(OS),Darwin) - +$(MAKE) -Bs check CC=clang CFLAGS="$(CFLAGS) $(MSAN_CFLAGS) -fsanitize=memory" + +$(MAKE) -Bs check CC=clang CFLAGS="$(CFLAGS) $(MSAN_CFLAGS)" +$(MAKE) -Bs check CFLAGS="$(CFLAGS) -m32" endif +$(MAKE) -Bs release check -- cgit v1.2.3