From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 29A1FA0A02 for ; Mon, 17 May 2021 18:12:14 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 21CE740041; Mon, 17 May 2021 18:12:14 +0200 (CEST) Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by mails.dpdk.org (Postfix) with ESMTP id 5129440041 for ; Mon, 17 May 2021 18:12:11 +0200 (CEST) Received: from 2.general.paelzer.uk.vpn ([10.172.196.173] helo=Keschdeichel.fritz.box) by youngberry.canonical.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1lifqi-0007ge-Q6; Mon, 17 May 2021 16:12:08 +0000 From: Christian Ehrhardt To: Thomas Monjalon Cc: Bruce Richardson , Andrew Rybchenko , David Marchand , dpdk stable Date: Mon, 17 May 2021 18:07:49 +0200 Message-Id: <20210517161039.3132619-40-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517161039.3132619-1-christian.ehrhardt@canonical.com> References: <20210517161039.3132619-1-christian.ehrhardt@canonical.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'build: detect execinfo library on Linux' has been queued to stable release 19.11.9 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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 --- >From 7f254be3728941b9439cb0c1bb43a5ba625c5cac Mon Sep 17 00:00:00 2001 From: Thomas Monjalon 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 Acked-by: Bruce Richardson Acked-by: Andrew Rybchenko Acked-by: David Marchand --- 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@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