Commit 20c11032 authored by Daniel Verkamp's avatar Daniel Verkamp
Browse files

build: link DPDK libraries with --whole-archive



The upcoming DPDK version adds objects that have no externally
referenced symbols but that must be linked in (specifically, the
default mempool handlers are now assigned by a constructor function).

Link all of the DPDK libraries with -Wl,--whole-archive to fix linking
against a static library build of DPDK.

Change-Id: Ia54b100d81aa7be30a8f4bcad65cc182e91dcc65
Reported-by: default avatarJay Sternberg <jay.e.sternberg@intel.com>
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent ec39dd62
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -161,7 +161,9 @@ DPDK_INC_DIR ?= $(DPDK_DIR_ABS)/include
DPDK_LIB_DIR ?= $(DPDK_DIR_ABS)/lib

DPDK_INC = -I$(DPDK_INC_DIR)
DPDK_LIB = -L$(DPDK_LIB_DIR) -Wl,--start-group -lrte_eal -lrte_mempool -lrte_ring -lrte_timer -Wl,--end-group -Wl,-rpath=$(DPDK_LIB_DIR)
DPDK_LIB = -L$(DPDK_LIB_DIR) -Wl,--start-group -Wl,--whole-archive \
	   -lrte_eal -lrte_mempool -lrte_ring -lrte_timer \
	   -Wl,--end-group -Wl,--no-whole-archive -Wl,-rpath=$(DPDK_LIB_DIR)
# librte_malloc was removed after DPDK 2.1.  Link this library conditionally based on its
#  existence to maintain backward compatibility.
ifneq ($(wildcard $(DPDK_DIR_ABS)/lib/librte_malloc.*),)