зеркало из https://github.com/microsoft/git.git
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:
Родитель
566cf0b3bd
Коммит
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
|
||||
|
|
Загрузка…
Ссылка в новой задаче