mirror of
https://github.com/git/git
synced 2024-08-27 11:39:22 +00:00
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
This commit is contained in:
commit
e4efb39555
7
Makefile
7
Makefile
|
@ -1022,10 +1022,15 @@ ifdef DEVELOPER
|
||||||
CFLAGS += $(DEVELOPER_CFLAGS)
|
CFLAGS += $(DEVELOPER_CFLAGS)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
comma := ,
|
||||||
|
empty :=
|
||||||
|
space := $(empty) $(empty)
|
||||||
|
|
||||||
ifdef SANITIZE
|
ifdef SANITIZE
|
||||||
|
SANITIZERS := $(foreach flag,$(subst $(comma),$(space),$(SANITIZE)),$(flag))
|
||||||
BASIC_CFLAGS += -fsanitize=$(SANITIZE) -fno-sanitize-recover=$(SANITIZE)
|
BASIC_CFLAGS += -fsanitize=$(SANITIZE) -fno-sanitize-recover=$(SANITIZE)
|
||||||
BASIC_CFLAGS += -fno-omit-frame-pointer
|
BASIC_CFLAGS += -fno-omit-frame-pointer
|
||||||
ifeq ($(SANITIZE),undefined)
|
ifneq ($(filter undefined,$(SANITIZERS)),)
|
||||||
BASIC_CFLAGS += -DNO_UNALIGNED_LOADS
|
BASIC_CFLAGS += -DNO_UNALIGNED_LOADS
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
Loading…
Reference in a new issue