From patchwork Sun Feb 28 12:53:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 88273 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id AF6ADA0548; Sun, 28 Feb 2021 13:54:27 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9581522A275; Sun, 28 Feb 2021 13:54:06 +0100 (CET) Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by mails.dpdk.org (Postfix) with ESMTP id 9AEC722A26A; Sun, 28 Feb 2021 13:54:04 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id 93A625D4; Sun, 28 Feb 2021 07:54:03 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sun, 28 Feb 2021 07:54:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=xdj9HOKcUYReE mi2Y/XsMU997JCJbBiR+6Yy23h8tmU=; b=g7zjO80IOr4ZsPqNcIQbl2sL2rsRL CbkIRd40anG3FAb/b64KWf2cBtDO766yGvOOx0f6mw4uYxk9FIsOtltgxjIURyiU T1HbYFp2OY8uIyGn1lHNdn9lxzisweCLx2pqPeTH1OPYe/rcIXO6uIZHm7oNvBVv SJ2uzgL1qUQK2ctQcKMQYVUOkjuJ6OrBzOjvbde7tu8lMIx9yrAvXjrGntpPH40c ryT0scUlmgQzOp1ghYYlsfG0bmFWTse7yNc1jwuDSUgNgTJ0q8RRAb5seE6nQC/k r2ICzpxMebGz52+kBLp+L78sporLfHFzKytd663+drrURpLpXSEOdsdKA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=xdj9HOKcUYReEmi2Y/XsMU997JCJbBiR+6Yy23h8tmU=; b=HHqlVKk3 FmXFFTP+Mj8pdUHpfX5+vzp3l2cBrFwC8MWTuCkANu2BuZgNsC/Q/KW61jLQzKO0 efxgHoBRugVGOfqWkqr6/1kIl2SWAvZpa0XlC3rta797keLh1pYZnKpZg5y0tIG2 SgKdQljLnmT2NoNHzK+Ny4tp3Dht8V0+bl8Zpp65tOiMspKtOItFMQqTglHsDBgx a+vwOVpFTdQAM6ERrXYfICGhT0cFy2S+szLwyEsegQgfntYavG/7bMV3uCyi4+AF vrWbXf9ApmubD/3mHtQ1SHHTDdxyAe0HaRSjBWuPNUka87qEm99Bkd0fVwZvNDNb ukMq5rcGLx1vsw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrleeigdegjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpedvhefgiedvjeegtdevheefhfetleefgfeivefgffevfeejgedtgfeu tdehtdegveenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuih iivgepudenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhho nhdrnhgvth X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 945771080059; Sun, 28 Feb 2021 07:54:02 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: ncopa@alpinelinux.org, stable@dpdk.org, Bruce Richardson Date: Sun, 28 Feb 2021 13:53:38 +0100 Message-Id: <20210228125353.2436562-4-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210228125353.2436562-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210228125353.2436562-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v6 03/17] build: detect execinfo library on Linux X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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") Cc: stable@dpdk.org Signed-off-by: Thomas Monjalon Acked-by: Bruce Richardson --- 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 561e493a29..099895fc87 100644 --- a/app/test/meson.build +++ b/app/test/meson.build @@ -426,7 +426,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 3cf560b8a3..66a2edcc47 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 @@ -166,6 +163,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 b9ab24223f..ab06e2da33 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', @@ -76,7 +74,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)