[dpdk-stable] patch 'build: detect execinfo library on Linux' has been queued to stable release 19.11.9

Christian Ehrhardt christian.ehrhardt at canonical.com
Mon May 17 18:07:49 CEST 2021


Hi,

FYI, your patch has been queued to stable release 19.11.9

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/19/21. 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.

Queued patches are on a temporary branch at:
https://github.com/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/7f254be3728941b9439cb0c1bb43a5ba625c5cac

Thanks.

Christian Ehrhardt <christian.ehrhardt at canonical.com>

---
>From 7f254be3728941b9439cb0c1bb43a5ba625c5cac Mon Sep 17 00:00:00 2001
From: Thomas Monjalon <thomas at monjalon.net>
Date: Thu, 25 Feb 2021 02:49:19 +0100
Subject: [PATCH] build: detect execinfo library on Linux

[ upstream commit 1cd512b2f5325c971c5bfdd7715debded986df27 ]

The library execinfo and its header file can be installed on Alpine Linux
where the backtrace feature is not part of musl libc:
	apk add libexecinfo-dev

As a consequence, this library should not be restricted to BSD only.

At the same time, the library and header are detected once and added
globally to be linked with any application, internal or external.

Fixes: 9065b1fac65f ("build: fix dependency on execinfo for BSD meson builds")

Signed-off-by: Thomas Monjalon <thomas at monjalon.net>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko at oktetlabs.ru>
Acked-by: David Marchand <david.marchand at redhat.com>
---
 app/meson.build      | 3 ---
 app/test/meson.build | 1 -
 config/meson.build   | 9 ++++++---
 examples/meson.build | 4 +---
 4 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/app/meson.build b/app/meson.build
index c7f689eb79..4bdfaf4787 100644
--- a/app/meson.build
+++ b/app/meson.build
@@ -18,8 +18,6 @@ apps = [
 	'test-pmd',
 	'test-sad']
 
-# for BSD only
-lib_execinfo = cc.find_library('execinfo', required: false)
 
 default_cflags = machine_args
 default_ldflags = []
@@ -51,7 +49,6 @@ foreach app:apps
 			dep_objs += get_variable(get_option('default_library')
 				 + '_rte_' + d)
 		endforeach
-		dep_objs += lib_execinfo
 
 		link_libs = []
 		if get_option('default_library') == 'static'
diff --git a/app/test/meson.build b/app/test/meson.build
index 860728bb07..2e35e93477 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -387,7 +387,6 @@ foreach d:test_deps
 	def_lib = get_option('default_library')
 	test_dep_objs += get_variable(def_lib + '_rte_' + d)
 endforeach
-test_dep_objs += cc.find_library('execinfo', required: false)
 
 link_libs = []
 if get_option('default_library') == 'static'
diff --git a/config/meson.build b/config/meson.build
index b1f728ee86..4007b8f37c 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -121,11 +121,8 @@ if cc.find_library('m', required : false).found()
 	dpdk_extra_ldflags += '-lm'
 endif
 
-# for linux link against dl, for bsd execinfo
 if is_linux
 	link_lib = 'dl'
-elif is_freebsd
-	link_lib = 'execinfo'
 else
 	link_lib = ''
 endif
@@ -155,6 +152,12 @@ if fdt_dep.found() and cc.has_header('fdt.h')
 	dpdk_extra_ldflags += '-lfdt'
 endif
 
+libexecinfo = cc.find_library('libexecinfo', required: false)
+if libexecinfo.found() and cc.has_header('execinfo.h')
+	add_project_link_arguments('-lexecinfo', language: 'c')
+	dpdk_extra_ldflags += '-lexecinfo'
+endif
+
 # check for libbsd
 libbsd = dependency('libbsd', required: false, method: 'pkg-config')
 if libbsd.found()
diff --git a/examples/meson.build b/examples/meson.build
index 59b4a014a0..bcd40cc302 100644
--- a/examples/meson.build
+++ b/examples/meson.build
@@ -6,8 +6,6 @@ if get_option('default_library') == 'static'
 	driver_libs = dpdk_drivers
 endif
 
-execinfo = cc.find_library('execinfo', required: false)
-
 # list of all example apps. Keep 1-3 per line, in alphabetical order.
 all_examples = [
 	'bbdev_app', 'bond',
@@ -81,7 +79,7 @@ foreach example: examples
 	cflags = default_cflags
 	ldflags = default_ldflags
 
-	ext_deps = [execinfo]
+	ext_deps = []
 	includes = [include_directories(example)]
 	deps = ['eal', 'mempool', 'net', 'mbuf', 'ethdev', 'cmdline']
 	if is_windows
-- 
2.31.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-05-17 17:40:31.118181026 +0200
+++ 0040-build-detect-execinfo-library-on-Linux.patch	2021-05-17 17:40:29.171809476 +0200
@@ -1 +1 @@
-From 1cd512b2f5325c971c5bfdd7715debded986df27 Mon Sep 17 00:00:00 2001
+From 7f254be3728941b9439cb0c1bb43a5ba625c5cac Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 1cd512b2f5325c971c5bfdd7715debded986df27 ]
+
@@ -16 +17,0 @@
-Cc: stable at dpdk.org
@@ -23 +24 @@
- app/meson.build      | 4 ----
+ app/meson.build      | 3 ---
@@ -27 +28 @@
- 4 files changed, 7 insertions(+), 11 deletions(-)
+ 4 files changed, 7 insertions(+), 10 deletions(-)
@@ -30 +31 @@
-index 87fc195dbf..50a53dbde8 100644
+index c7f689eb79..4bdfaf4787 100644
@@ -33,2 +34,2 @@
-@@ -21,9 +21,6 @@ apps = [
- 	'test-regex',
+@@ -18,8 +18,6 @@ apps = [
+ 	'test-pmd',
@@ -39,2 +40,2 @@
--
- default_cflags = machine_args + ['-DALLOW_EXPERIMENTAL_API']
+ 
+ default_cflags = machine_args
@@ -42,2 +43 @@
- if get_option('default_library') == 'static' and not is_windows
-@@ -53,7 +50,6 @@ foreach app:apps
+@@ -51,7 +49,6 @@ foreach app:apps
@@ -52 +52 @@
-index 561e493a29..099895fc87 100644
+index 860728bb07..2e35e93477 100644
@@ -55 +55 @@
-@@ -426,7 +426,6 @@ foreach d:test_deps
+@@ -387,7 +387,6 @@ foreach d:test_deps
@@ -64 +64 @@
-index 3cf560b8a3..66a2edcc47 100644
+index b1f728ee86..4007b8f37c 100644
@@ -67 +67 @@
-@@ -125,11 +125,8 @@ if cc.find_library('m', required : false).found()
+@@ -121,11 +121,8 @@ if cc.find_library('m', required : false).found()
@@ -79 +79 @@
-@@ -166,6 +163,12 @@ if fdt_dep.found() and cc.has_header('fdt.h')
+@@ -155,6 +152,12 @@ if fdt_dep.found() and cc.has_header('fdt.h')
@@ -93 +93 @@
-index 3fe08d4ca5..d065a6a08b 100644
+index 59b4a014a0..bcd40cc302 100644
@@ -97 +97 @@
- 	link_whole_libs = dpdk_static_libraries + dpdk_drivers
+ 	driver_libs = dpdk_drivers
@@ -105 +105 @@
-@@ -82,7 +80,7 @@ foreach example: examples
+@@ -81,7 +79,7 @@ foreach example: examples
@@ -113 +113 @@
- 	subdir(example)
+ 	if is_windows


More information about the stable mailing list