patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: dev@dpdk.org
Cc: bruce.richardson@intel.com, stable@dpdk.org,
	"Matan Azrad" <matan@mellanox.com>,
	"Shahaf Shuler" <shahafs@mellanox.com>,
	"Viacheslav Ovsiienko" <viacheslavo@mellanox.com>,
	"Nélio Laranjeiro" <nelio.laranjeiro@6wind.com>
Subject: [dpdk-stable] [PATCH v5 6/6] net/mlx: fix overlinking with meson and glue dlopen
Date: Wed, 12 Feb 2020 23:07:08 +0100	[thread overview]
Message-ID: <20200212220708.492297-7-thomas@monjalon.net> (raw)
In-Reply-To: <20200212220708.492297-1-thomas@monjalon.net>

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 <thomas@monjalon.net>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 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 0fe086136a..cfc178257d 100644
--- a/drivers/common/mlx5/meson.build
+++ b/drivers/common/mlx5/meson.build
@@ -29,7 +29,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
 		subdir_done()
 	endif
 endforeach
-if static_ibverbs
+if 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 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())
diff --git a/drivers/net/mlx4/meson.build b/drivers/net/mlx4/meson.build
index f66e70f4d1..c598745730 100644
--- a/drivers/net/mlx4/meson.build
+++ b/drivers/net/mlx4/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
@@ -39,10 +39,12 @@ foreach libname:libnames
 		subdir_done()
 	endif
 endforeach
-if static_ibverbs
+if 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 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())
-- 
2.25.0


      parent reply	other threads:[~2020-02-12 22:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200116071656.1663967-1-thomas@monjalon.net>
     [not found] ` <20200212015944.3037000-1-thomas@monjalon.net>
2020-02-12  1:59   ` [dpdk-stable] [PATCH v4 " Thomas Monjalon
     [not found] ` <20200212220708.492297-1-thomas@monjalon.net>
2020-02-12 22:07   ` Thomas Monjalon [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200212220708.492297-7-thomas@monjalon.net \
    --to=thomas@monjalon.net \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=matan@mellanox.com \
    --cc=nelio.laranjeiro@6wind.com \
    --cc=shahafs@mellanox.com \
    --cc=stable@dpdk.org \
    --cc=viacheslavo@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).