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.
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464621 (master)
(cherry picked from commit e29c6fe133
)
Change-Id: I914ab849323de198af5c5e53fffb1f57fcaff5fe
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/467292
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
parent
d899c6db20
commit
265c55d21b
@ -116,7 +116,7 @@ ENV_CFLAGS = $(DPDK_INC) -Wno-deprecated-declarations
|
||||
ENV_CXXFLAGS = $(ENV_CFLAGS)
|
||||
ENV_DPDK_FILE = $(call spdk_lib_list_to_static_libs,env_dpdk)
|
||||
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)
|
||||
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 = \
|
||||
-L$(SPDK_ROOT_DIR)/build/lib \
|
||||
-Wl,--whole-archive \
|
||||
-Wl,--no-as-needed \
|
||||
$(SPDK_LIB_LIST:%=-lspdk_%) \
|
||||
-Wl,--no-whole-archive
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user