summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2019-09-13 17:03:13 -0400
committerTavian Barnes <tavianator@tavianator.com>2019-09-13 17:03:13 -0400
commitf8e9397b508479b79f5dad062160b50d38686cb3 (patch)
tree0127be1fc6625c2f5736ab0f55f5d3fd0df85ca6 /Makefile
parent9c2b8f43af7da723720b1adc6e92e9ad0e1393b7 (diff)
downloadbfs-f8e9397b508479b79f5dad062160b50d38686cb3.tar.xz
Makefile: Include -fsanitize=* in the sanitizer flag variables
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile10
1 files changed, 7 insertions, 3 deletions
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