Commit b6875e1c authored by Jim Harris's avatar Jim Harris Committed by Tomasz Zawadzki
Browse files

build: fix unit test builds that directly use env_dpdk



We take care to order libraries on the link line in dependency
order. But unittest builds using spdk.unittest.mk were doing
things a bit differently, and not doing the sorting.

This was uncovered while testing an upcoming patch that adds some
new env_dpdk dependencies on the log library. It is not clear
exactly why this did not cause a problem until now, but without
these changes, the relative order of libraries was definitely
different between 'normal' and 'unit test' apps.

Note we also need to explicitly add the env_dpdk library for unit
tests that directly link the env_dpdk library.

Signed-off-by: default avatarJim Harris <jim.harris@samsung.com>
Change-Id: I2674ad3a0a3a80d4ceb0c0ce3157aae9101eca0d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/23963


Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
parent 193002f9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ SPDK_LIB_LINKER_ARGS = \
# library with whole-archive, to keep its functions from getting stripped out
# when LTO is enabled.
SPDK_STATIC_LIB_LINKER_ARGS = \
	$(SPDK_LIB_LIST:%=$(SPDK_ROOT_DIR)/build/lib/libspdk_%.a) \
	$(SPDK_LIB_FILES) \
	-Wl,--whole-archive \
	$(SPDK_ROOT_DIR)/build/lib/libspdk_ut_mock.a \
	-Wl,--no-whole-archive
+1 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ ENV_LINKER_ARGS =
else
# Rewrite the env linker args to be static.
ENV_DPDK_FILE = $(call spdk_lib_list_to_static_libs,env_dpdk)
SPDK_LIB_LIST += env_dpdk
endif

install: all