Skip to content

Commit

Permalink
autopackage: Don't build unit tests with lto.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Change-Id: Iaf76cd050565ce2ff13b4230d7a3b735fd5384a6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2055
Tested-by: SPDK CI Jenkins <[email protected]>
Reviewed-by: Ben Walker <[email protected]>
Reviewed-by: Changpeng Liu <[email protected]>
Reviewed-by: Aleksey Marchuk <[email protected]>
  • Loading branch information
Seth5141 authored and tomzawadzki committed Apr 29, 2020
1 parent f74fdce commit 3ef6d06
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion autopackage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 5 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -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]}"
Expand Down

0 comments on commit 3ef6d06

Please sign in to comment.