DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] mk: fix linking with static ibverbs libraries
@ 2020-04-29 12:11 Bing Zhao
  2020-05-06 22:01 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: Bing Zhao @ 2020-04-29 12:11 UTC (permalink / raw)
  To: thomas, matan; +Cc: dev, stable

When building a target application with static linking mode via
makefiles and enable linking to ibverbs libs by setting
"CONFIG_RTE_IBVERBS_LINK_STATIC=y". The libibverbs.pc will be
chosen and all the libs listed in the file will be linked
by default. Some static lib archives may contain the same files
and common interfaces inside.
The "--no-whole-archive" needs to be enabled for the linker to
discard the useless symbols and resolve the symbols redefinition
error.

Fixes: 95276abaaf0a ("vdpa/mlx5: introduce Mellanox vDPA driver")
Cc: matan@mellanox.com
Cc: stable@dpdk.org

Signed-off-by: Bing Zhao <bingz@mellanox.com>
---
 mk/rte.app.mk | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/mk/rte.app.mk b/mk/rte.app.mk
index 77161c7..15ef28b 100644
--- a/mk/rte.app.mk
+++ b/mk/rte.app.mk
@@ -207,7 +207,9 @@ ifeq ($(CONFIG_RTE_IBVERBS_LINK_DLOPEN),y)
 _LDLIBS-y                                   += -ldl
 else ifeq ($(CONFIG_RTE_IBVERBS_LINK_STATIC),y)
 LIBS_IBVERBS_STATIC = $(shell $(RTE_SDK)/buildtools/options-ibverbs-static.sh)
+_LDLIBS-y                                   += --no-whole-archive
 _LDLIBS-y                                   += $(LIBS_IBVERBS_STATIC)
+_LDLIBS-y                                   += --whole-archive
 else
 ifeq ($(findstring y,$(CONFIG_RTE_LIBRTE_MLX5_PMD)$(CONFIG_RTE_LIBRTE_MLX5_VDPA_PMD)),y)
 _LDLIBS-y                                   += -libverbs -lmlx5
-- 
1.8.3.1


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

* Re: [dpdk-dev] [PATCH] mk: fix linking with static ibverbs libraries
  2020-04-29 12:11 [dpdk-dev] [PATCH] mk: fix linking with static ibverbs libraries Bing Zhao
@ 2020-05-06 22:01 ` Thomas Monjalon
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Monjalon @ 2020-05-06 22:01 UTC (permalink / raw)
  To: Bing Zhao; +Cc: matan, dev, stable

29/04/2020 14:11, Bing Zhao:
> When building a target application with static linking mode via
> makefiles and enable linking to ibverbs libs by setting
> "CONFIG_RTE_IBVERBS_LINK_STATIC=y". The libibverbs.pc will be
> chosen and all the libs listed in the file will be linked
> by default. Some static lib archives may contain the same files
> and common interfaces inside.
> The "--no-whole-archive" needs to be enabled for the linker to
> discard the useless symbols and resolve the symbols redefinition
> error.
> 
> Fixes: 95276abaaf0a ("vdpa/mlx5: introduce Mellanox vDPA driver")

The origin is older than vdpa PMD.
It is when introducing ibverbs static linking:
Fixes: 2c0dd7b69fb0 ("config: add static linkage of mlx dependency")

> Cc: stable@dpdk.org
> 
> Signed-off-by: Bing Zhao <bingz@mellanox.com>

Acked-by: Thomas Monjalon <thomas@monjalon.net>

Applied, thanks



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

end of thread, other threads:[~2020-05-06 22:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-29 12:11 [dpdk-dev] [PATCH] mk: fix linking with static ibverbs libraries Bing Zhao
2020-05-06 22:01 ` 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).