From a0dfc38289c33de3c40c28b01b047dbadafecf3e Mon Sep 17 00:00:00 2001 From: MITSUNARI Shigeo Date: Thu, 8 Sep 2016 09:20:40 +0900 Subject: [PATCH] add sanitize option if DEBUG=1 --- common.mk | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/common.mk b/common.mk index d8ecaf5..2ca4006 100644 --- a/common.mk +++ b/common.mk @@ -31,8 +31,10 @@ AR=ar r MKDIR=mkdir -p RM=rm -rf - -ifneq ($(DEBUG),1) +ifeq ($(DEBUG),1) + CFLAGS+=-fsanitize=address + LDFLAGS+=-fsanitize=address +else CFLAGS_OPT+=-fomit-frame-pointer -DNDEBUG ifeq ($(CXX),clang++) CFLAGS_OPT+=-O3