Skip to content

Commit

Permalink
allow compatible sanitizers to be mixed
Browse files Browse the repository at this point in the history
  • Loading branch information
raphdev committed Mar 3, 2023
1 parent 5989172 commit 997b103
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions xsnap/makefiles/lin/xsnap-worker.mk
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,13 @@ ifeq ($(GOAL),debug)
endif
endif

ifeq ($(SANITIZER), address)
# sanitizers below are compatible - allow bundling them together
ifneq (,$(findstring address,$(SANITIZER)))
C_OPTIONS += -fsanitize=address -fsanitize-recover=address
LINK_OPTIONS += -fsanitize=address -fsanitize-recover=address
endif

ifeq ($(SANITIZER), undefined)
ifneq (,$(findstring undefined,$(SANITIZER)))
C_OPTIONS += -fsanitize=array-bounds,bool,builtin,enum,float-divide-by-zero,function,integer-divide-by-zero,null,object-size,return,returns-nonnull-attribute,shift,signed-integer-overflow,unsigned-integer-overflow,unreachable,vla-bound,vptr -fno-sanitize-recover=array-bounds,bool,builtin,enum,float-divide-by-zero,function,integer-divide-by-zero,null,object-size,return,returns-nonnull-attribute,shift,signed-integer-overflow,unreachable,vla-bound,vptr -fsanitize-recover=undefined
LINK_OPTIONS += -fsanitize=array-bounds,bool,builtin,enum,float-divide-by-zero,function,integer-divide-by-zero,null,object-size,return,returns-nonnull-attribute,shift,signed-integer-overflow,unsigned-integer-overflow,unreachable,vla-bound,vptr -fno-sanitize-recover=array-bounds,bool,builtin,enum,float-divide-by-zero,function,integer-divide-by-zero,null,object-size,return,returns-nonnull-attribute,shift,signed-integer-overflow,unreachable,vla-bound,vptr -fsanitize-recover=undefined
endif
Expand Down

0 comments on commit 997b103

Please sign in to comment.