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

Xueming Li xuemingl at nvidia.com
Mon May 10 18:00:17 CEST 2021


Hi,

FYI, your patch has been queued to stable release 20.11.2

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/12/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/steevenlee/dpdk

This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/14702af2e52c0f1046fdb1e0006f09f1fb584b75

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 14702af2e52c0f1046fdb1e0006f09f1fb584b75 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
Cc: Luca Boccassi <bluca at debian.org>

[ 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      | 4 ----
 app/test/meson.build | 1 -
 config/meson.build   | 9 ++++++---
 examples/meson.build | 4 +---
 4 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/app/meson.build b/app/meson.build
index 87fc195dbf..50a53dbde8 100644
--- a/app/meson.build
+++ b/app/meson.build
@@ -21,9 +21,6 @@ apps = [
 	'test-regex',
 	'test-sad']
 
-# for BSD only
-lib_execinfo = cc.find_library('execinfo', required: false)
-
 default_cflags = machine_args + ['-DALLOW_EXPERIMENTAL_API']
 default_ldflags = []
 if get_option('default_library') == 'static' and not is_windows
@@ -53,7 +50,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 bdbc619476..3fdd22de7e 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -424,7 +424,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 2f150de3b8..5b7439aefb 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -125,11 +125,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
@@ -159,6 +156,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 3fe08d4ca5..d065a6a08b 100644
--- a/examples/meson.build
+++ b/examples/meson.build
@@ -6,8 +6,6 @@ if get_option('default_library') == 'static'
 	link_whole_libs = dpdk_static_libraries + 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',
@@ -82,7 +80,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']
 	subdir(example)
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-05-10 23:59:28.419493400 +0800
+++ 0069-build-detect-execinfo-library-on-Linux.patch	2021-05-10 23:59:26.430000000 +0800
@@ -1 +1 @@
-From 1cd512b2f5325c971c5bfdd7715debded986df27 Mon Sep 17 00:00:00 2001
+From 14702af2e52c0f1046fdb1e0006f09f1fb584b75 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Luca Boccassi <bluca at debian.org>
+
+[ upstream commit 1cd512b2f5325c971c5bfdd7715debded986df27 ]
@@ -16 +18,0 @@
-Cc: stable at dpdk.org
@@ -52 +54 @@
-index 561e493a29..099895fc87 100644
+index bdbc619476..3fdd22de7e 100644
@@ -55 +57 @@
-@@ -426,7 +426,6 @@ foreach d:test_deps
+@@ -424,7 +424,6 @@ foreach d:test_deps
@@ -64 +66 @@
-index 3cf560b8a3..66a2edcc47 100644
+index 2f150de3b8..5b7439aefb 100644
@@ -79 +81 @@
-@@ -166,6 +163,12 @@ if fdt_dep.found() and cc.has_header('fdt.h')
+@@ -159,6 +156,12 @@ if fdt_dep.found() and cc.has_header('fdt.h')


More information about the stable mailing list