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 D647DA034F for ; Thu, 25 Feb 2021 19:23:29 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7DE34160835; Thu, 25 Feb 2021 19:23:28 +0100 (CET) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by mails.dpdk.org (Postfix) with ESMTP id 57522160806; Thu, 25 Feb 2021 19:23:25 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id EE6B55C00AE; Thu, 25 Feb 2021 13:23:24 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 25 Feb 2021 13:23:24 -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=BgeJ+Y5pK8WsD A+DYJfdzKbbUcW7A3oG9YMbHxH+ykU=; b=tvm1/ar2VD5ktJXt8lDa3dtO8Zt0O qr6qu2Q/y1Fhx230nJYNEts2dnmAcD0tpK/CY2iGseazYWmr17W97QhYd28vv5Jl EdOypAb/Ys1V0UwdnYnt7GNFmE//s8U9UQcCpU8U2ZXzvtyQQOctn4wPSqiysCVH Pf5ophh/5CEu+OPdquYNTQU1ataLMLswsjxqNXuWJJH/w00JS7vxyhy51Owjn+rb 50Gw4HGZoaJZwVI6qh6mmx8imaZ4rzZ9hnNpWAOP9lrGmWp2r7hcJzYfRQA6Vu45 hg85tlr7+p/gzvtlfeKaRsJBhWU/nrO/PDb3TNOMXbEbUZqKklun6Np+A== 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=BgeJ+Y5pK8WsDA+DYJfdzKbbUcW7A3oG9YMbHxH+ykU=; b=SqoaKUrb PC16NTyPSqpNuBiVzqQIii93YYs5WpWJE4g2qVuEP7JuPo/M+ngb7fRhVUUBzuG5 KrCQwtDdwZQcFLBvxvneEstcQ4pE1873UifzOxT9QUoXJ667eUS8kGqsZvnxse/z kENMAMNrgZjL8d7Cmg3mJl6eh++DREw5jPyNdQtVRTdTppP0wR8C+sA5vsJTTurI PWsqWn4yBDrHthwNW7sK4hEvZFUM9MDCWYJ2JpE0EfWY5O7/Z/GhVrdkqNReqevx Y95MvTvzTQDR1HMx8+mLiQ6bHIrAp+jr3jBLcZqCQ/JaRic9Jmoz6JsgjooPfQM5 Csqfbd5T27efcw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrkeelgdduudegucetufdoteggodetrfdotf 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 45277240065; Thu, 25 Feb 2021 13:23:24 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: ncopa@alpinelinux.org, stable@dpdk.org, Bruce Richardson Date: Thu, 25 Feb 2021 19:22:36 +0100 Message-Id: <20210225182250.1149592-4-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210225182250.1149592-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210225182250.1149592-1-thomas@monjalon.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH v5 03/17] build: detect execinfo library on Linux 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" 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 --- 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) -- 2.30.1