From 9cc7b31e58ca486c82b8c4c6826a2fc9005d2297 Mon Sep 17 00:00:00 2001 From: Seth Howell Date: Tue, 23 Jul 2019 19:09:21 -0700 Subject: [PATCH] Enable DPDK shared object build with SPDK shared object build. When building SPDK with shared objects, we should also build the DPDK submodule shared libraries. This will make it much easier for peole to link their applications against a dpdk shared library if the DPDK shared libraries installed on their system don't have all the symbols that SPDK needs. Also, add a linker argument to DPDK to specify that it should look in the dpdk subdirectory when linking libraries. Note: this change will not work until the default config options in the DPDK submodule are updated. Change-Id: I9546df7b84952eb20fe1ac98e3b3bbd0fcbda3a7 Signed-off-by: Seth Howell Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/463028 Reviewed-by: Darek Stojaczyk Reviewed-by: Jan Kryl Reviewed-by: Ben Walker Tested-by: SPDK CI Jenkins --- dpdkbuild/Makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dpdkbuild/Makefile b/dpdkbuild/Makefile index 59a2eb3ef..63def05d0 100644 --- a/dpdkbuild/Makefile +++ b/dpdkbuild/Makefile @@ -40,11 +40,12 @@ DPDK_FRAMEWORK = n DPDK_OPTS = DPDK_CFLAGS = -# We commented out this build option in our DPDK fork, but DPDK makefiles check -# its value specifically against 'n' to set linking flags properly. Set it here -# to 'n' for now. -# TODO allow DPDK to be built as shared library +ifeq ($(CONFIG_SHARED),y) +DPDK_OPTS += CONFIG_RTE_BUILD_SHARED_LIB=y +DPDK_LDFLAGS+= -rpath $(SPDK_ROOT_DIR)/dpdk/build/lib +else DPDK_OPTS += CONFIG_RTE_BUILD_SHARED_LIB=n +endif ifeq ($(CONFIG_CRYPTO),y) DPDK_FRAMEWORK = y