Add thread sanitizer to configure options
Change-Id: Ibeab0bc70bb59da4ebb8bd175642f5f549f1d273 Signed-off-by: Ben Walker <benjamin.walker@intel.com> Reviewed-on: https://review.gerrithub.io/362425 Reviewed-by: Jim Harris <james.r.harris@intel.com> Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
This commit is contained in:
parent
675dc02b81
commit
830912e28a
3
CONFIG
3
CONFIG
@ -49,6 +49,9 @@ CONFIG_ASAN?=n
|
|||||||
# Build with Undefined Behavior Sanitizer enabled
|
# Build with Undefined Behavior Sanitizer enabled
|
||||||
CONFIG_UBSAN?=n
|
CONFIG_UBSAN?=n
|
||||||
|
|
||||||
|
# Build with Thread Sanitizer enabled
|
||||||
|
CONFIG_TSAN?=n
|
||||||
|
|
||||||
# Directory that contains the desired SPDK environment library.
|
# Directory that contains the desired SPDK environment library.
|
||||||
# By default, this is implemented using DPDK.
|
# By default, this is implemented using DPDK.
|
||||||
CONFIG_ENV?=$(SPDK_ROOT_DIR)/lib/env_dpdk
|
CONFIG_ENV?=$(SPDK_ROOT_DIR)/lib/env_dpdk
|
||||||
|
14
configure
vendored
14
configure
vendored
@ -62,6 +62,12 @@ for i in "$@"; do
|
|||||||
--disable-ubsan)
|
--disable-ubsan)
|
||||||
CONFIG_UBSAN=n
|
CONFIG_UBSAN=n
|
||||||
;;
|
;;
|
||||||
|
--enable-tsan)
|
||||||
|
CONFIG_TSAN=y
|
||||||
|
;;
|
||||||
|
--disable-tsan)
|
||||||
|
CONFIG_TSAN=n
|
||||||
|
;;
|
||||||
--enable-coverage)
|
--enable-coverage)
|
||||||
CONFIG_COVERAGE=y
|
CONFIG_COVERAGE=y
|
||||||
;;
|
;;
|
||||||
@ -132,6 +138,11 @@ if [ "$CONFIG_FIO_PLUGIN" = "y" ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$CONFIG_ASAN" = "y" -a "$CONFIG_TSAN" = "y" ]; then
|
||||||
|
echo "ERROR: ASAN and TSAN cannot be enabled at the same time."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
echo -n "Creating CONFIG.local..."
|
echo -n "Creating CONFIG.local..."
|
||||||
|
|
||||||
# Write the configuration file
|
# Write the configuration file
|
||||||
@ -154,6 +165,9 @@ fi
|
|||||||
if [ -n "$CONFIG_UBSAN" ]; then
|
if [ -n "$CONFIG_UBSAN" ]; then
|
||||||
echo "CONFIG_UBSAN?=$CONFIG_UBSAN" >> CONFIG.local
|
echo "CONFIG_UBSAN?=$CONFIG_UBSAN" >> CONFIG.local
|
||||||
fi
|
fi
|
||||||
|
if [ -n "$CONFIG_TSAN" ]; then
|
||||||
|
echo "CONFIG_TSAN?=$CONFIG_TSAN" >> CONFIG.local
|
||||||
|
fi
|
||||||
if [ -n "$CONFIG_ENV" ]; then
|
if [ -n "$CONFIG_ENV" ]; then
|
||||||
echo "CONFIG_ENV?=$CONFIG_ENV" >> CONFIG.local
|
echo "CONFIG_ENV?=$CONFIG_ENV" >> CONFIG.local
|
||||||
fi
|
fi
|
||||||
|
@ -115,6 +115,11 @@ COMMON_CFLAGS += -fsanitize=undefined
|
|||||||
LDFLAGS += -fsanitize=undefined
|
LDFLAGS += -fsanitize=undefined
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_TSAN),y)
|
||||||
|
COMMON_CFLAGS += -fsanitize=thread
|
||||||
|
LDFLAGS += -fsanitize=thread
|
||||||
|
endif
|
||||||
|
|
||||||
COMMON_CFLAGS += -pthread
|
COMMON_CFLAGS += -pthread
|
||||||
LDFLAGS += -pthread
|
LDFLAGS += -pthread
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user