patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: stable@dpdk.org
Cc: bluca@debian.org, Matan Azrad <matan@mellanox.com>,
	Shahaf Shuler <shahafs@mellanox.com>,
	Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Subject: [dpdk-stable] [PATCH 19.11] net/mlx5: fix build with separate glue lib for dlopen
Date: Sat,  6 Jun 2020 12:08:56 +0200	[thread overview]
Message-ID: <20200606100856.2073664-1-thomas@monjalon.net> (raw)

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


             reply	other threads:[~2020-06-06 10:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-06 10:08 Thomas Monjalon [this message]
2020-06-08  7:59 ` Luca Boccassi

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=20200606100856.2073664-1-thomas@monjalon.net \
    --to=thomas@monjalon.net \
    --cc=bluca@debian.org \
    --cc=matan@mellanox.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).