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 3F073A051C for ; Tue, 11 Feb 2020 12:32:41 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1CBB31BDF8; Tue, 11 Feb 2020 12:32:41 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 1CF13A3; Tue, 11 Feb 2020 12:32:37 +0100 (CET) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Feb 2020 03:32:36 -0800 X-IronPort-AV: E=Sophos;i="5.70,428,1574150400"; d="scan'208";a="221905406" Received: from bricha3-mobl.ger.corp.intel.com ([10.237.221.79]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 11 Feb 2020 03:32:33 -0800 Date: Tue, 11 Feb 2020 11:32:30 +0000 From: Bruce Richardson To: Thomas Monjalon Cc: dev@dpdk.org, stable@dpdk.org, Matan Azrad , Shahaf Shuler , Viacheslav Ovsiienko , =?iso-8859-1?Q?N=E9lio?= Laranjeiro Message-ID: <20200211113230.GB823@bricha3-MOBL.ger.corp.intel.com> References: <20200127154402.4008069-1-thomas@monjalon.net> <20200211011942.1569573-1-thomas@monjalon.net> <20200211011942.1569573-6-thomas@monjalon.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200211011942.1569573-6-thomas@monjalon.net> User-Agent: Mutt/1.12.1 (2019-06-15) Subject: Re: [dpdk-stable] [PATCH v3 5/5] net/mlx: fix overlinking with meson and glue dlopen X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 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" On Tue, Feb 11, 2020 at 02:19:42AM +0100, Thomas Monjalon wrote: > If ibverbs_link is dlopen, the PMD and application should not > be linked with ibverbs, but the glue library is. > Unfortunately the ibverbs dependency was exported in the > variable ext_deps, so there were overlinking. > > It is fixed by not exporting the dependency in ext_deps, > and recreating a limited dependency object for cflags only. > > Fixes: 1dd7c7e38c19 ("net/mlx4: support meson build") > Fixes: 96d7c62a70c7 ("net/mlx5: support meson build") > Cc: stable@dpdk.org > > Signed-off-by: Thomas Monjalon > --- > drivers/common/mlx5/meson.build | 6 ++++-- > drivers/net/mlx4/meson.build | 6 ++++-- > 2 files changed, 8 insertions(+), 4 deletions(-) > > diff --git a/drivers/common/mlx5/meson.build b/drivers/common/mlx5/meson.build > index 2bb2a83c45..2956fc20e2 100644 > --- a/drivers/common/mlx5/meson.build > +++ b/drivers/common/mlx5/meson.build > @@ -30,7 +30,7 @@ foreach libname:libnames > endif > if lib.found() > libs += lib > - if not static_ibverbs > + if not static_ibverbs and not dlopen_ibverbs > ext_deps += lib > endif > else > @@ -38,10 +38,12 @@ foreach libname:libnames > reason = 'missing dependency, "' + libname + '"' > endif > endforeach > -if build and static_ibverbs > +if build and (static_ibverbs or dlopen_ibverbs) > # Build without adding shared libs to Requires.private > ibv_cflags = run_command(pkgconf, '--cflags', 'libibverbs').stdout() > ext_deps += declare_dependency(compile_args: ibv_cflags.split()) > +endif > +if build and static_ibverbs > # Add static deps ldflags to internal apps and Libs.private > ibv_ldflags = run_command(ldflags_ibverbs_static, check:true).stdout() > ext_deps += declare_dependency(link_args:ibv_ldflags.split()) One small suggestion: Since out minimum version of meson is 0.47.1, we can use subdir_done() function. Putting subdir_done() immediately after build=false will simplify things as you won't need to continually check the build variable in each if statement. /Bruce