Commit 3a501549 authored by Jim Harris's avatar Jim Harris Committed by Tomasz Zawadzki
Browse files

env_dpdk/Makefile: use _uniq for pkg-config file



Including rte_net twice in DPDK_LIB_LIST results in
it also getting added twice to the spdk_env_dpdk.pc
pkg-config file.

Some (most?) pkg-config versions will detect the
duplicate entry and squash it. But some don't, which
results in multiple definition errors when linking
using pkg-config to get the library lists.

The native SPDK build uses a make function "_uniq"
to remove these duplicates. Use that same function here
to remove any duplicates for pkg-config file generation.

Fixes issue #3177.
Fixes f961b323 ("env/dpdk: add rte_net dependency to vhost")

Signed-off-by: default avatarJim Harris <jim.harris@samsung.com>
Change-Id: If18c91aaa7a695903a595ebef0be1c07fa52316d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/20561


Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
parent 7f46fb47
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -21,10 +21,11 @@ SPDK_MAP_FILE = $(abspath $(CURDIR)/spdk_env_dpdk.map)
include $(SPDK_ROOT_DIR)/mk/spdk.lib.mk

LIBDPDK_PKGCONFIG = $(call pkgconfig_filename,spdk_dpdklibs)
UNIQUE_DPDK_LIB_LIST = $(call _uniq,$(DPDK_LIB_LIST))

$(LIBDPDK_PKGCONFIG): $(PKGCONFIG) $(PKGCONFIG_INST)
	$(Q)$(SPDK_ROOT_DIR)/scripts/pc_libs.sh \
		"-L$(DPDK_LIB_DIR) $(DPDK_LIB_LIST:%=-l%)" "" DPDK spdk_dpdklibs > $@
		"-L$(DPDK_LIB_DIR) $(UNIQUE_DPDK_LIB_LIST:%=-l%)" "" DPDK spdk_dpdklibs > $@
	$(Q)sed -i.bak '5s,.*,Requires: $(DEPDIRS-$(LIBNAME):%=spdk_%) spdk_dpdklibs,' $(PKGCONFIG) ; rm $(PKGCONFIG).bak
	$(Q)sed -i.bak '5s,.*,Requires: $(DEPDIRS-$(LIBNAME):%=spdk_%) spdk_dpdklibs,' $(PKGCONFIG_INST) ; rm $(PKGCONFIG_INST).bak