Skip to content

Commit

Permalink
Disable Address Sanitizer for debug build
Browse files Browse the repository at this point in the history
Default build do not enable Address Sanitizer, however default debug
build enables it. With this patch, default debug build will also disable
Address Sanitizer and if user want to make a debug build with Address
Sanitizer enabled, user can `make asan-debug`.

Signed-off-by: Ziqian SUN (Zamir) <zsun@redhat.com>
  • Loading branch information
sztsian committed Jan 26, 2018
1 parent a6bced6 commit 3787e16
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,16 @@ OBJS+=parser.yy.o parser.tab.o

all: $(PROG)

debug: CFLAGS+=-g -DDEBUG -fsanitize=address
debug: LDFLAGS:=-lasan $(LDFLAGS)
debug: CFLAGS+=-g -DDEBUG
debug: LDFLAGS:=$(LDFLAGS)
debug: FLEXFLAGS+=-d
debug: $(PROG)

asan-debug: CFLAGS+=-g -DDEBUG -fsanitize=address
asan-debug: LDFLAGS:=-lasan $(LDFLAGS)
asan-debug: FLEXFLAGS+=-d
asan-debug: $(PROG)

asan: CFLAGS+=-fsanitize=address
asan: LDFLAGS:=-lasan $(LDFLAGS)
asan: $(PROG)
Expand Down

0 comments on commit 3787e16

Please sign in to comment.