diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2019-09-13 17:03:13 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2019-09-13 17:03:13 -0400 |
commit | f8e9397b508479b79f5dad062160b50d38686cb3 (patch) | |
tree | 0127be1fc6625c2f5736ab0f55f5d3fd0df85ca6 | |
parent | 9c2b8f43af7da723720b1adc6e92e9ad0e1393b7 (diff) | |
download | bfs-f8e9397b508479b79f5dad062160b50d38686cb3.tar.xz |
Makefile: Include -fsanitize=* in the sanitizer flag variables
-rw-r--r-- | Makefile | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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 |