patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH 19.11] net/mlx5: fix build with separate glue lib for dlopen
@ 2020-06-06 10:08 Thomas Monjalon
  2020-06-08  7:59 ` Luca Boccassi
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Monjalon @ 2020-06-06 10:08 UTC (permalink / raw)
  To: stable; +Cc: bluca, Matan Azrad, Shahaf Shuler, Viacheslav Ovsiienko

If building with option RTE_IBVERBS_LINK_DLOPEN (make)
or ibverbs_link=dlopen (meson), the glue is a separate library
which can be dlopen.
In such case, the object mlx5_glue must be allocated in two places:
one in the glue, and one outside of the glue to be assigned when
loading the glue with dlopen/dlsym.

When backporting the allocation split for gcc 10, both allocations
were made inside the glue. As a consequence, the symbol is undefined
outside of the glue:
	drivers/net/mlx5/mlx5.c: undefined reference to 'mlx5_glue'

The second allocation is restored outside of the glue, in mlx5.c.

Fixes: b3e01cd3e46f ("common/mlx5: fix build with -fno-common")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 drivers/net/mlx5/mlx5.c      | 4 ++++
 drivers/net/mlx5/mlx5_glue.c | 4 ----
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 9161114978..8879df317d 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -187,6 +187,10 @@ struct mlx5_dev_spawn_data {
 	struct rte_pci_device *pci_dev; /**< Backend PCI device. */
 };
 
+#ifdef MLX5_GLUE
+const struct mlx5_glue *mlx5_glue;
+#endif
+
 static LIST_HEAD(, mlx5_ibv_shared) mlx5_ibv_list = LIST_HEAD_INITIALIZER();
 static pthread_mutex_t mlx5_ibv_list_mutex = PTHREAD_MUTEX_INITIALIZER;
 
diff --git a/drivers/net/mlx5/mlx5_glue.c b/drivers/net/mlx5/mlx5_glue.c
index c2dd0392d0..44f63116a8 100644
--- a/drivers/net/mlx5/mlx5_glue.c
+++ b/drivers/net/mlx5/mlx5_glue.c
@@ -30,10 +30,6 @@
 #include "mlx5_autoconf.h"
 #include "mlx5_glue.h"
 
-#ifdef MLX5_GLUE
-const struct mlx5_glue *mlx5_glue;
-#endif
-
 static int
 mlx5_glue_fork_init(void)
 {
-- 
2.26.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-06-08  7:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-06 10:08 [dpdk-stable] [PATCH 19.11] net/mlx5: fix build with separate glue lib for dlopen Thomas Monjalon
2020-06-08  7:59 ` Luca Boccassi

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).