[dpdk-stable] patch 'build: always link whole DPDK static libraries' has been queued to stable release 19.11.4

luca.boccassi at gmail.com luca.boccassi at gmail.com
Fri Jul 24 14:00:25 CEST 2020


Hi,

FYI, your patch has been queued to stable release 19.11.4

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 07/26/20. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Thanks.

Luca Boccassi

---
>From 683b922608454879abb09b6d0020013c1cf3e7f1 Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson at intel.com>
Date: Tue, 30 Jun 2020 15:14:27 +0100
Subject: [PATCH] build: always link whole DPDK static libraries

[ backported from upstream commit e2db26f76673762532c0b830502bf37aee20d1a8 ]

To ensure all constructors are included in static build, we need to pass
the --whole-archive flag when linking, which is used with the
"link_whole" meson option. Since we use link_whole for all libs, we no
longer need to track the lib as part of the static dependency, just the
path to the headers for compiling.

After this patch is applied, all DPDK .a files are inside
--whole-archive/--no-whole-archive flags, but external dependencies and
shared libs being linked against remain outside.

Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
Tested-by: Andrzej Ostruszka <aostruszka at marvell.com>
Acked-by: Luca Boccassi <bluca at debian.org>
Acked-by: Sunil Pai G <sunil.pai.g at intel.com>
Acked-by: Thomas Monjalon <thomas at monjalon.net>
---
 app/test/meson.build | 2 +-
 drivers/meson.build  | 2 +-
 examples/meson.build | 6 +++---
 lib/meson.build      | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/app/test/meson.build b/app/test/meson.build
index 6d4039bbd..12668fa45 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -390,7 +390,7 @@ test_dep_objs += cc.find_library('execinfo', required: false)
 
 link_libs = []
 if get_option('default_library') == 'static'
-	link_libs = dpdk_drivers
+	link_libs = dpdk_static_libraries + dpdk_drivers
 endif
 
 dpdk_test = executable('dpdk-test',
diff --git a/drivers/meson.build b/drivers/meson.build
index 4246cc32a..330b14636 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -196,7 +196,7 @@ foreach class:dpdk_driver_classes
 			shared_dep = declare_dependency(link_with: shared_lib,
 					include_directories: includes,
 					dependencies: shared_deps)
-			static_dep = declare_dependency(link_with: static_lib,
+			static_dep = declare_dependency(
 					include_directories: includes,
 					dependencies: static_deps)
 
diff --git a/examples/meson.build b/examples/meson.build
index 1f2b6f516..ec6bd5a08 100644
--- a/examples/meson.build
+++ b/examples/meson.build
@@ -1,9 +1,9 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017-2019 Intel Corporation
 
-driver_libs = []
+link_whole_libs = []
 if get_option('default_library') == 'static'
-	driver_libs = dpdk_drivers
+	link_whole_libs = dpdk_static_libraries + dpdk_drivers
 endif
 
 execinfo = cc.find_library('execinfo', required: false)
@@ -99,7 +99,7 @@ foreach example: examples
 		endif
 		executable('dpdk-' + name, sources,
 			include_directories: includes,
-			link_whole: driver_libs,
+			link_whole: link_whole_libs,
 			link_args: dpdk_extra_ldflags,
 			c_args: cflags,
 			dependencies: dep_objs)
diff --git a/lib/meson.build b/lib/meson.build
index d5a507fb4..bf938a392 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -127,7 +127,7 @@ foreach l:libraries
 					dependencies: static_deps,
 					include_directories: includes,
 					install: true)
-			static_dep = declare_dependency(link_with: static_lib,
+			static_dep = declare_dependency(
 					include_directories: includes,
 					dependencies: static_deps)
 
-- 
2.20.1



More information about the stable mailing list