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 43CD6A0562; Fri, 19 Mar 2021 15:58:07 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2E567140EF3; Fri, 19 Mar 2021 15:57:48 +0100 (CET) Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by mails.dpdk.org (Postfix) with ESMTP id 4BEF0140ED3; Fri, 19 Mar 2021 15:57:45 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id 00D4B1439; Fri, 19 Mar 2021 10:57:43 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 19 Mar 2021 10:57:44 -0400 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=ueT/cLtqKkpjG A8skqqz3Gg3qYMk7KPtdoHxLpSLv/8=; b=fVWfuZzWO8EJjrNjYJtW2PEiTUo1S 4TKGRTE5mWKxzylkI+a08BqOmIlRAs4dAw2o1BlH/enSD/v2U2WqH/6c3abRDx42 /sZ82zT6xuik1oxE1EMKsR4CvJ4lTKf5fTkPg8u+UIwulp2yYZxlncIHFSiFcvvc bTluj7qXsmn+/OckSe5tHtYHpygC0PnhFX2Px5tgEGZlElpxToZVjwMKpOlE9Rd8 sCMPao0GAaJBkbSD9Ezp6Ui/GIiCoL2OFYS4H+rlKomQiAVMKnQlol3l0eZXPK/o jeddTN4iuLfgDLF61NopVQ6njIQHaeaONPfoOaMIZaxuuPNeDUHlOM8iA== 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=ueT/cLtqKkpjGA8skqqz3Gg3qYMk7KPtdoHxLpSLv/8=; b=YOsqzH5C QQeBBjKEwnrPDzmREeCoZqQRNANyP6wti/6a3bbfQyrBy80gBU11mH7Hg1y52Ce9 hvHXqw+CdVUT9hpENkfhmAJSEXHRZhtX357euiKoNYbckhGx5HIDr4L56sCCb9ay KuH0EarWSv2hNCV78Z92c5RXfi6hEJEpOwSGsJWqrzx6Vtd3bL6shirsfsHUusdP YE1zEql6qB8ktG8cWdMT7LORWZOD6PdQfwJnMBuSLZyCxCk1kK2ZwiixWshib6zB iJ7E/cC5tsEQ4edyEta9qYFcGzBLGCdgq//moSQ1lFiGFcKIiYpSLpTlrKp57/nl nrXwavQevtWnSQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudefkedgjeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepvdehgfeivdejgedtveehfefhteelfefgieevgfffveefjeegtdfg uedthedtgeevnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf hiiigvpedunecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl ohhnrdhnvght 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 C489B240067; Fri, 19 Mar 2021 10:57:42 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: ncopa@alpinelinux.org, stable@dpdk.org, Bruce Richardson , Andrew Rybchenko , David Marchand Date: Fri, 19 Mar 2021 15:57:16 +0100 Message-Id: <20210319145730.3555384-4-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210319145730.3555384-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210319145730.3555384-1-thomas@monjalon.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v7 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 Acked-by: Andrew Rybchenko Acked-by: David Marchand --- 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 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.30.1