config: add option to turn on UBSan

Change-Id: Ifb6b86db530d78bffdc28112f5fe1bdfcba6249c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Daniel Verkamp 2016-11-30 11:16:25 -07:00
parent 6b1e22bd86
commit 1b68a8e705
2 changed files with 8 additions and 0 deletions

3
CONFIG
View File

@ -43,6 +43,9 @@ CONFIG_COVERAGE?=n
# Build with Address Sanitizer enabled
CONFIG_ASAN?=n
# Build with Undefined Behavior Sanitizer enabled
CONFIG_UBSAN?=n
# Directory that contains the desired SPDK environment library.
# By default, this is implemented using DPDK.
CONFIG_ENV?=$(SPDK_ROOT_DIR)/lib/env_dpdk

View File

@ -100,6 +100,11 @@ COMMON_CFLAGS += -fsanitize=address
LDFLAGS += -fsanitize=address
endif
ifeq ($(CONFIG_UBSAN),y)
COMMON_CFLAGS += -fsanitize=undefined
LDFLAGS += -fsanitize=undefined
endif
COMMON_CFLAGS += -pthread
LDFLAGS += -pthread