Skip to content

Commit e4efb39

Browse files
committed
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
2 parents d5bfa46 + 425ca67 commit e4efb39

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1022,10 +1022,15 @@ ifdef DEVELOPER
10221022
CFLAGS += $(DEVELOPER_CFLAGS)
10231023
endif
10241024

1025+
comma := ,
1026+
empty :=
1027+
space := $(empty) $(empty)
1028+
10251029
ifdef SANITIZE
1030+
SANITIZERS := $(foreach flag,$(subst $(comma),$(space),$(SANITIZE)),$(flag))
10261031
BASIC_CFLAGS += -fsanitize=$(SANITIZE) -fno-sanitize-recover=$(SANITIZE)
10271032
BASIC_CFLAGS += -fno-omit-frame-pointer
1028-
ifeq ($(SANITIZE),undefined)
1033+
ifneq ($(filter undefined,$(SANITIZERS)),)
10291034
BASIC_CFLAGS += -DNO_UNALIGNED_LOADS
10301035
endif
10311036
endif

0 commit comments

Comments
 (0)