From 47dd5b4a3559cc15e0556b1cb75303da426d1632 Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Sat, 29 Jan 2022 04:40:57 +0000 Subject: [PATCH] dpdkbuild: remove RTE_HAS_LIBARCHIVE from build config DPDK rte_eal_firmware.c will use libarchive APIs when libarchive is installed on the system. SPDK doesn't currently account for this, so if the user has libarchive installed, DPDK will emit libarchive calls that don't get resolved during link phase for static builds. We've had a similar situation with libbsd for a long time, where we remove the associated #define from the DPDK build config header file before we kick off the DPDK build. So extend that here for the RTE_HAS_LIBARCHIVE #define. It would be nicer to use pkg-config somehow to generate the necessarily libraries to install on the SPDK link line for static builds. But it's not exactly straightforward, so this solution ended up being the simplest by far, extending a mechanism that's worked well with SPDK's dpdkbuild up until this point. Fixes issue #2357. Signed-off-by: Jim Harris Change-Id: I79ff4648ee58a3e13f4b873f8acd1b31cca0fc31 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11385 Tested-by: SPDK CI Jenkins Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Reviewed-by: Dong Yi Reviewed-by: Konrad Sztyber Reviewed-by: Changpeng Liu --- dpdkbuild/Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dpdkbuild/Makefile b/dpdkbuild/Makefile index 3b3ab642c..1231fb3a7 100644 --- a/dpdkbuild/Makefile +++ b/dpdkbuild/Makefile @@ -187,12 +187,12 @@ $(SPDK_ROOT_DIR)/dpdk/build-tmp: $(SPDK_ROOT_DIR)/mk/cc.mk $(SPDK_ROOT_DIR)/incl $(Q)cd "$(SPDK_ROOT_DIR)/dpdk"; CC="$(SUB_CC)" meson --prefix="$(MESON_PREFIX)" --libdir lib -Dc_args="$(DPDK_CFLAGS)" -Dc_link_args="$(DPDK_LDFLAGS)" $(DPDK_OPTS) -Denable_drivers="$(shell echo $(DPDK_DRIVERS) | sed -E "s/ +/,/g")" -Ddisable_libs="$(shell echo $(DPDK_DISABLED_LIBS) | sed -E "s/ +/,/g")" build-tmp $(Q)sed $(SED_INPLACE_FLAG) 's/#define RTE_EAL_PMD_PATH .*/#define RTE_EAL_PMD_PATH ""/g' $(SPDK_ROOT_DIR)/dpdk/build-tmp/rte_build_config.h $(Q) \ - # TODO Meson build adds libbsd dependency when it's available. This means any app will be \ - # forced to link with -lbsd, but only if it's available on the system. The clean way to \ - # handle this would be to rely on DPDK's pkg-config file which will contain the -lbsd when \ - # required. For now just remove the libbsd dependency. DPDK will fallback to its internal \ - # functions. + # TODO Meson build adds libbsd and/or libarchive dependency when it's available. This means any app will be \ + # forced to link with -lbsd and/or -larchive, but only if it's available on the system. The clean way to \ + # handle this would be to rely on DPDK's pkg-config file which will contain the -lbsd/-larchive when \ + # required. For now just remove the dependencies. DPDK will fallback to its internal functions. $(Q)sed $(SED_INPLACE_FLAG) 's/#define RTE_USE_LIBBSD .*//g' $(SPDK_ROOT_DIR)/dpdk/build-tmp/rte_build_config.h + $(Q)sed $(SED_INPLACE_FLAG) 's/#define RTE_HAS_LIBARCHIVE .*//g' $(SPDK_ROOT_DIR)/dpdk/build-tmp/rte_build_config.h clean: $(Q)rm -rf $(SPDK_ROOT_DIR)/dpdk/build $(SPDK_ROOT_DIR)/dpdk/build-tmp