From 916f3d147186a20f36a7c2d0a7a6c27bb3e27c42 Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Thu, 26 Sep 2019 19:14:04 -0700 Subject: [PATCH] env_dpdk: add functions to define dpdk_env make variables Create dpdk_lib_list_to_libs and dpdk_env_linker_args functions to generate the library filename list and the linker arguments respectively. Use these functions internally as well. These will be useful as part of the Seastar work, where Seastar pkg-config includes a bunch of the DPDK libraries, and SPDK needs to just add a few more. Signed-off-by: Jim Harris Change-Id: Iaa6b49a8e1defacf63b3f6b414cd2e947670f8eb Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469751 Tested-by: SPDK CI Jenkins Reviewed-by: Ben Walker Reviewed-by: Shuhei Matsumoto --- lib/env_dpdk/env.mk | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/env_dpdk/env.mk b/lib/env_dpdk/env.mk index c08124a71..4a2371dcc 100644 --- a/lib/env_dpdk/env.mk +++ b/lib/env_dpdk/env.mk @@ -109,7 +109,15 @@ endif endif endif -DPDK_LIB = $(DPDK_LIB_LIST:%=$(DPDK_ABS_DIR)/lib/lib%$(DPDK_LIB_EXT)) +define dpdk_lib_list_to_libs +$(1:%=$(DPDK_ABS_DIR)/lib/lib%$(DPDK_LIB_EXT)) +endef + +define dpdk_env_linker_args +$(ENV_DPDK_FILE) -Wl,--whole-archive,--no-as-needed $(call dpdk_lib_list_to_libs,$1) -Wl,--no-whole-archive +endef + +DPDK_LIB = $(call dpdk_lib_list_to_libs,$(DPDK_LIB_LIST)) # SPDK memory registration requires experimental (deprecated) rte_memory API for DPDK 18.05 ENV_CFLAGS = $(DPDK_INC) -Wno-deprecated-declarations @@ -120,7 +128,7 @@ else ENV_DPDK_FILE = $(call spdk_lib_list_to_static_libs,env_dpdk) endif ENV_LIBS = $(ENV_DPDK_FILE) $(DPDK_LIB) -ENV_LINKER_ARGS = $(ENV_DPDK_FILE) -Wl,--whole-archive,--no-as-needed $(DPDK_LIB) -Wl,--no-whole-archive +ENV_LINKER_ARGS = $(call dpdk_env_linker_args,$(DPDK_LIB_LIST)) ifeq ($(CONFIG_IPSEC_MB),y) ENV_LINKER_ARGS += -lIPSec_MB -L$(IPSEC_MB_DIR)