Commit 0e0a4890 authored by Daniel Verkamp's avatar Daniel Verkamp Committed by Jim Harris
Browse files

build: link mock lib with --whole-archive



The unit test mock library contains wrappers that aren't directly
referenced but still need to be kept to allow the final link to work
when they are used via --wrap.  Add the spdk_mock library to the
whole-archive list to prevent it from getting removed.

Fixes build with LTO enabled.

Change-Id: I2c70be7cb517a373178d34026f9980396727f8df
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/401074


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarDariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
parent 4a93f5d2
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -48,6 +48,10 @@ SPDK_FILTER_LIB_LIST += $(filter net,$(SPDK_LIB_LIST))
SPDK_FILTER_LIB_LIST += $(filter scsi,$(SPDK_LIB_LIST))
SPDK_FILTER_LIB_LIST += $(filter vhost,$(SPDK_LIB_LIST))

# The unit test mock wrappers need to be wrapped in whole-archive so they don't get
# automatically removed with LTO.
SPDK_FILTER_LIB_LIST += $(filter spdk_mock,$(SPDK_LIB_LIST))

SPDK_WHOLE_ARCHIVE_LIB_LIST = $(sort $(SPDK_FILTER_LIB_LIST))
SPDK_REMAINING_LIB_LIST = $(filter-out $(SPDK_WHOLE_ARCHIVE_LIB_LIST),$(SPDK_LIB_LIST))