From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id BEDB3A0562; Tue, 31 Mar 2020 18:21:38 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8B5DB2C15; Tue, 31 Mar 2020 18:21:37 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 44E5D2BCE for ; Tue, 31 Mar 2020 18:21:35 +0200 (CEST) IronPort-SDR: E+OLzKNtig6Zaey3UGshswiBzg9zU1lg0cpE+IQbDm9sMfRuPOy800g5U/63GjjPuXG/vpRCdQ Ctuna4Z1Q/9A== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Mar 2020 09:21:34 -0700 IronPort-SDR: sDPwmhe6KFITxfG9V/Evm16GmqYwB9OEOuKPi1CW5KayJ9jj/io4xUSxDy4jKNGPgNDMuxd0dD 1SxYdVRkMq2Q== X-IronPort-AV: E=Sophos;i="5.72,328,1580803200"; d="scan'208";a="422351356" Received: from bricha3-mobl.ger.corp.intel.com ([10.214.202.68]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 31 Mar 2020 09:21:27 -0700 Date: Tue, 31 Mar 2020 17:21:22 +0100 From: Bruce Richardson To: Pavan Nikhilesh Bhagavatula Cc: Jerin Jacob Kollanukkaran , Thomas Monjalon , Liang Ma , Peter Mccarthy , Marko Kovacevic , Ori Kam , Radu Nicolau , Akhil Goyal , Tomasz Kantecki , Sunil Kumar Kori , David Hunt , Honnappa Nagarahalli , "dev@dpdk.org" , "david.marchand@redhat.com" , "mattias.ronnblom@ericsson.com" Message-ID: <20200331162122.GA147@bricha3-MOBL.ger.corp.intel.com> References: <20200325211603.240288-1-jerinj@marvell.com> <20200329144342.1543749-1-jerinj@marvell.com> <20200329144342.1543749-2-jerinj@marvell.com> <20200330131715.GA132@bricha3-MOBL.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [dpdk-dev] [PATCH v3 01/33] meson: add libatomic as a global dependency for i686 clang X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" On Tue, Mar 31, 2020 at 01:36:46PM +0000, Pavan Nikhilesh Bhagavatula wrote: > > > >-----Original Message----- > >From: dev On Behalf Of Bruce Richardson > >Sent: Monday, March 30, 2020 6:47 PM > >To: Jerin Jacob Kollanukkaran > >Cc: Thomas Monjalon ; Pavan Nikhilesh > >Bhagavatula ; Liang Ma > >; Peter Mccarthy ; > >Marko Kovacevic ; Ori Kam > >; Radu Nicolau ; Akhil > >Goyal ; Tomasz Kantecki > >; Sunil Kumar Kori ; > >David Hunt ; Honnappa Nagarahalli > >; dev@dpdk.org; > >david.marchand@redhat.com; mattias.ronnblom@ericsson.com > >Subject: Re: [dpdk-dev] [PATCH v3 01/33] meson: add libatomic as a > >global dependency for i686 clang > > > >On Sun, Mar 29, 2020 at 08:13:10PM +0530, jerinj@marvell.com wrote: > >> From: Pavan Nikhilesh > >> > >> Add libatomic as a global dependency when compiling for 32-bit using > >> clang. As we need libatomic for 64-bit atomic ops. > >> > >> Cc: bruce.richardson@intel.com > >> Signed-off-by: Pavan Nikhilesh > >> --- > >> config/meson.build | 10 ++++++++++ > >> drivers/event/octeontx/meson.build | 5 ----- > >> drivers/event/octeontx2/meson.build | 5 ----- > >> drivers/event/opdl/meson.build | 5 ----- > >> examples/l2fwd-event/meson.build | 5 ----- > >> lib/librte_distributor/meson.build | 5 ----- > >> lib/librte_rcu/meson.build | 5 ----- > >> 7 files changed, 10 insertions(+), 30 deletions(-) > >> > >> diff --git a/config/meson.build b/config/meson.build > >> index abedd76f2..6e5530110 100644 > >> --- a/config/meson.build > >> +++ b/config/meson.build > >> @@ -173,6 +173,16 @@ if pcap_dep.found() and > >cc.has_header('pcap.h', dependencies: pcap_dep) > >> dpdk_extra_ldflags += '-lpcap' > >> endif > >> > >> + > >> +# for clang 32-bit compiles we need libatomic for 64-bit atomic ops > >> +if cc.get_id() == 'clang' and dpdk_conf.get('RTE_ARCH_64') == false > >> + atomic_dep = cc.find_library('atomic', required: true) > >> + if atomic_dep.found() > >> + add_project_link_arguments('-latomic', language: 'c') > >> + dpdk_extra_ldflags += '-latomic' > >> + endif > >> +endif > >> + > > > >Minor nit, you don't need to check for .found(), since the configure will > >fail if it's not found, since "required" is set to true. > > Yup but I felt a bit odd adding the dependency without using .found(). > I will remove the inner if check in the next version. > > > > >For cleanliness, you may also be able to use get_pkgconfig_variable() or > >get_configtool_variable() to get -latomic, rather than hard-coding it, > >though in this case I suspect hard-coding is fine. > > Looks like get_pkgconfig_variable/get_configtool_variable only work on dependency > object using it on object from find_library() causes meson to error out > ` Unknown method "get_pkgconfig_variable" in object ` > Ok, thanks for checking.