* [dpdk-stable] [PATCH v3 5/5] net/mlx: fix overlinking with meson and glue dlopen
[not found] ` <20200211011942.1569573-1-thomas@monjalon.net>
@ 2020-02-11 1:19 ` Thomas Monjalon
2020-02-11 11:32 ` Bruce Richardson
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Monjalon @ 2020-02-11 1:19 UTC (permalink / raw)
To: dev
Cc: bruce.richardson, stable, Matan Azrad, Shahaf Shuler,
Viacheslav Ovsiienko, Nélio Laranjeiro
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>
---
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())
diff --git a/drivers/net/mlx4/meson.build b/drivers/net/mlx4/meson.build
index 2970f395c1..bcfe5b0890 100644
--- a/drivers/net/mlx4/meson.build
+++ b/drivers/net/mlx4/meson.build
@@ -31,7 +31,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
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())
--
2.25.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-stable] [PATCH v3 5/5] net/mlx: fix overlinking with meson and glue dlopen
2020-02-11 1:19 ` [dpdk-stable] [PATCH v3 5/5] net/mlx: fix overlinking with meson and glue dlopen Thomas Monjalon
@ 2020-02-11 11:32 ` Bruce Richardson
2020-02-11 11:34 ` Thomas Monjalon
0 siblings, 1 reply; 3+ messages in thread
From: Bruce Richardson @ 2020-02-11 11:32 UTC (permalink / raw)
To: Thomas Monjalon
Cc: dev, stable, Matan Azrad, Shahaf Shuler, Viacheslav Ovsiienko,
Nélio Laranjeiro
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 <thomas@monjalon.net>
> ---
> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-stable] [PATCH v3 5/5] net/mlx: fix overlinking with meson and glue dlopen
2020-02-11 11:32 ` Bruce Richardson
@ 2020-02-11 11:34 ` Thomas Monjalon
0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2020-02-11 11:34 UTC (permalink / raw)
To: Bruce Richardson
Cc: dev, stable, Matan Azrad, Shahaf Shuler, Viacheslav Ovsiienko,
Nélio Laranjeiro
11/02/2020 12:32, Bruce Richardson:
> 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 <thomas@monjalon.net>
> > ---
> > 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.
Great, thank you!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-02-11 11:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20200127154402.4008069-1-thomas@monjalon.net>
[not found] ` <20200211011942.1569573-1-thomas@monjalon.net>
2020-02-11 1:19 ` [dpdk-stable] [PATCH v3 5/5] net/mlx: fix overlinking with meson and glue dlopen Thomas Monjalon
2020-02-11 11:32 ` Bruce Richardson
2020-02-11 11:34 ` Thomas Monjalon
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).