mirror of
https://github.com/git/git
synced 2024-08-27 19:49:21 +00:00
Makefile: allow combining UBSan with other sanitizers
Multiple sanitizers can be specified as a comma-separated list. Set the flag NO_UNALIGNED_LOADS even if UndefinedBehaviorSanitizer is not the only sanitizer to build with. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
566cf0b3bd
commit
425ca6710b
7
Makefile
7
Makefile
|
@ -991,10 +991,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
|
||||
|
|
Loading…
Reference in a new issue