From 3ef6d0613da69182a953d92a18c5b6afced857ce Mon Sep 17 00:00:00 2001 From: Seth Howell Date: Mon, 27 Apr 2020 10:18:24 -0700 Subject: [PATCH] autopackage: Don't build unit tests with lto. Some of the unittests require symbols that don't work well with the lto option. For example when you build reduce_ut.c with the lto option, the __wrap_unlink symbol cannot be found. Also, while we are here, add a check to configure for unit tests built with lto. Signed-off-by: Seth Howell Change-Id: Iaf76cd050565ce2ff13b4230d7a3b735fd5384a6 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2055 Tested-by: SPDK CI Jenkins Reviewed-by: Ben Walker Reviewed-by: Changpeng Liu Reviewed-by: Aleksey Marchuk --- autopackage.sh | 2 +- configure | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/autopackage.sh b/autopackage.sh index 913b8078a..85274db7d 100755 --- a/autopackage.sh +++ b/autopackage.sh @@ -35,7 +35,7 @@ fi timing_enter build_release -./configure $(get_config_params) --disable-debug --enable-lto +./configure $(get_config_params) --disable-debug --enable-lto --disable-unit-tests $MAKE ${MAKEFLAGS} $MAKE ${MAKEFLAGS} clean diff --git a/configure b/configure index f49f6e50e..3e8f4b6df 100755 --- a/configure +++ b/configure @@ -494,6 +494,11 @@ if [[ "${CONFIG[ISAL]}" = "n" ]] && [[ "${CONFIG[REDUCE]}" = "y" ]]; then exit 1 fi +if [[ "${CONFIG[LTO]}" = "y" ]] && [[ "${CONFIG[UNIT_TESTS]}" = "y" ]]; then + echo "ERROR Conflicting options: --enable-lto is not compatible with --enable-unit-tests." + exit 1 +fi + if [ -z "${CONFIG[ENV]}" ]; then CONFIG[ENV]=$rootdir/lib/env_dpdk echo "Using default SPDK env in ${CONFIG[ENV]}"