aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-07-20 16:29:59 -0700
committerJunio C Hamano <gitster@pobox.com>2017-07-20 16:29:59 -0700
commite4efb39555582c5687df7a585f4cd9043dcd8ebc (patch)
treeaa20430040a6f8fc3611df49347b3695c626bd5b /Makefile
parentd5bfa469f467ff2c890272301ecab9ff94799ae3 (diff)
parent425ca6710b207f36ca0dfd28cc28b5f360355bef (diff)
downloadgit-e4efb39555582c5687df7a585f4cd9043dcd8ebc.tar.gz
git-e4efb39555582c5687df7a585f4cd9043dcd8ebc.tar.xz
Merge branch 'jk/build-with-asan'
A recent update made it easier to use "-fsanitize=" option while compiling but supported only one sanitize option. Allow more than one to be combined, joined with a comma, like "make SANITIZE=foo,bar". * jk/build-with-asan: Makefile: allow combining UBSan with other sanitizers
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile7
1 files changed, 6 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index ba4359ef8..9b98535a0 100644
--- a/Makefile
+++ b/Makefile
@@ -1022,10 +1022,15 @@ ifdef DEVELOPER
CFLAGS += $(DEVELOPER_CFLAGS)
endif
+comma := ,
+empty :=
+space := $(empty) $(empty)
+
ifdef SANITIZE
+SANITIZERS := $(foreach flag,$(subst $(comma),$(space),$(SANITIZE)),$(flag))
BASIC_CFLAGS += -fsanitize=$(SANITIZE) -fno-sanitize-recover=$(SANITIZE)
BASIC_CFLAGS += -fno-omit-frame-pointer
-ifeq ($(SANITIZE),undefined)
+ifneq ($(filter undefined,$(SANITIZERS)),)
BASIC_CFLAGS += -DNO_UNALIGNED_LOADS
endif
endif