mk: force --no-as-needed for spdk libs.
When building shared libs, we specifically don't set the --as-needed flag so that we still link against libraries that have constructor functions. LD reports on its man page that the default behavior is equivalent to --no-as-needed. For RHEL based distros like fedora and centos this works fine. While the LD man page shipped with ubuntu distributions also states that --no-as-needed is the default, they don't respect that behavior and do --as-needed linking unless you force them with --no-as-needed. Change-Id: I914ab849323de198af5c5e53fffb1f57fcaff5fe Signed-off-by: Seth Howell <seth.howell@intel.com> Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464621 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
b3cf508f56
commit
e29c6fe133
@ -116,7 +116,7 @@ ENV_CFLAGS = $(DPDK_INC) -Wno-deprecated-declarations
|
|||||||
ENV_CXXFLAGS = $(ENV_CFLAGS)
|
ENV_CXXFLAGS = $(ENV_CFLAGS)
|
||||||
ENV_DPDK_FILE = $(call spdk_lib_list_to_static_libs,env_dpdk)
|
ENV_DPDK_FILE = $(call spdk_lib_list_to_static_libs,env_dpdk)
|
||||||
ENV_LIBS = $(ENV_DPDK_FILE) $(DPDK_LIB)
|
ENV_LIBS = $(ENV_DPDK_FILE) $(DPDK_LIB)
|
||||||
ENV_LINKER_ARGS = $(ENV_DPDK_FILE) -Wl,--whole-archive $(DPDK_LIB) -Wl,--no-whole-archive
|
ENV_LINKER_ARGS = $(ENV_DPDK_FILE) -Wl,--whole-archive,--no-as-needed $(DPDK_LIB) -Wl,--no-whole-archive
|
||||||
|
|
||||||
ifeq ($(CONFIG_IPSEC_MB),y)
|
ifeq ($(CONFIG_IPSEC_MB),y)
|
||||||
ENV_LINKER_ARGS += -lIPSec_MB -L$(IPSEC_MB_DIR)
|
ENV_LINKER_ARGS += -lIPSec_MB -L$(IPSEC_MB_DIR)
|
||||||
|
@ -35,6 +35,7 @@ SPDK_LIB_FILES = $(call spdk_lib_list_to_static_libs,$(SPDK_LIB_LIST))
|
|||||||
SPDK_LIB_LINKER_ARGS = \
|
SPDK_LIB_LINKER_ARGS = \
|
||||||
-L$(SPDK_ROOT_DIR)/build/lib \
|
-L$(SPDK_ROOT_DIR)/build/lib \
|
||||||
-Wl,--whole-archive \
|
-Wl,--whole-archive \
|
||||||
|
-Wl,--no-as-needed \
|
||||||
$(SPDK_LIB_LIST:%=-lspdk_%) \
|
$(SPDK_LIB_LIST:%=-lspdk_%) \
|
||||||
-Wl,--no-whole-archive
|
-Wl,--no-whole-archive
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user