[ upstream commit e21492a5175af31ae568fa5fabef1f4b22706962 ]
If enable_driver_mlx_glue=true, 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")
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
buildtools/meson.build | 2 ++
drivers/net/mlx4/meson.build | 8 +++++++-
drivers/net/mlx5/meson.build | 9 ++++++++-
3 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/buildtools/meson.build b/buildtools/meson.build
index cdd38ed24e..7e06445d89 100644
--- a/buildtools/meson.build
+++ b/buildtools/meson.build
@@ -1,6 +1,8 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2017 Intel Corporation
+pkgconf = find_program('pkg-config', 'pkgconf', required: false)
+
subdir('pmdinfogen')
pmdinfo = find_program('gen-pmdinfo-cfile.sh')
diff --git a/drivers/net/mlx4/meson.build b/drivers/net/mlx4/meson.build
index ebad30a04a..a6837bc823 100644
--- a/drivers/net/mlx4/meson.build
+++ b/drivers/net/mlx4/meson.build
@@ -28,12 +28,18 @@ libs = [
foreach lib:libs
if not lib.found()
build = false
+ elif not pmd_dlopen
+ ext_deps += lib
endif
endforeach
+if pmd_dlopen
+ # Build without adding shared libs to Libs.private
+ ibv_cflags = run_command(pkgconf, '--cflags', 'libibverbs').stdout()
+ ext_deps += declare_dependency(compile_args: ibv_cflags.split())
+endif
if build
allow_experimental_apis = true
- ext_deps += libs
sources = files(
'mlx4.c',
'mlx4_ethdev.c',
diff --git a/drivers/net/mlx5/meson.build b/drivers/net/mlx5/meson.build
index 87b267a254..34759c7dbc 100644
--- a/drivers/net/mlx5/meson.build
+++ b/drivers/net/mlx5/meson.build
@@ -29,12 +29,19 @@ libs = [
foreach lib:libs
if not lib.found()
build = false
+ elif not pmd_dlopen
+ ext_deps += lib
endif
endforeach
+if pmd_dlopen
+ ext_deps += libs[0] # libmnl
+ # Build without adding ibverbs libs to Libs.private
+ ibv_cflags = run_command(pkgconf, '--cflags', 'libibverbs').stdout()
+ ext_deps += declare_dependency(compile_args: ibv_cflags.split())
+endif
if build
allow_experimental_apis = true
- ext_deps += libs
sources = files(
'mlx5.c',
'mlx5_ethdev.c',
--
2.29.2