build: add config option to use Address Sanitizer

Change-Id: I98bf4ab1c58a90341c2a8529de4537fb0250f00d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Daniel Verkamp 2015-11-04 12:46:09 -07:00
parent bba5f43ce5
commit 4cb05719bd
2 changed files with 8 additions and 0 deletions

3
CONFIG
View File

@ -37,6 +37,9 @@ CONFIG_DEBUG?=n
# Build with code coverage instrumentation.
CONFIG_COVERAGE?=n
# Build with Address Sanitizer enabled
CONFIG_ADDRESS_SANITIZER?=n
# This directory should contain 'include' and 'lib' directories for your DPDK
# installation. Alternatively you can specify this on the command line
# with 'make DPDK_DIR=/path/to/dpdk'.

View File

@ -92,6 +92,11 @@ endif
CFLAGS += $(COMMON_CFLAGS) -Wno-pointer-sign -std=gnu99
ifeq ($(CONFIG_ADDRESS_SANITIZER),y)
COMMON_CFLAGS += -fsanitize=address
LDFLAGS += -fsanitize=address
endif
MAKEFLAGS += --no-print-directory
OBJS = $(C_SRCS:.c=.o)