* [dpdk-dev] [PATCH v2 0/2] mk: fix build with shared library
@ 2019-07-26 16:36 Stephen Hemminger
2019-07-26 16:36 ` [dpdk-dev] [PATCH v2 1/2] bus: fix missing pci bus with shared library build Stephen Hemminger
2019-07-26 16:36 ` [dpdk-dev] [PATCH v2 2/2] mk: fix missing mempool driver registration Stephen Hemminger
0 siblings, 2 replies; 3+ messages in thread
From: Stephen Hemminger @ 2019-07-26 16:36 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
If RTE_BUILD_SHARED_LIB is enabled, infrastruture libraries
that use registration API's need to always be included.
v2 - fix typo in Cc: for second patch
Stephen Hemminger (2):
bus: fix missing pci bus with shared library build
mk: fix missing mempool driver registration
mk/rte.app.mk | 9 +++++++++
1 file changed, 9 insertions(+)
--
2.20.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [dpdk-dev] [PATCH v2 1/2] bus: fix missing pci bus with shared library build
2019-07-26 16:36 [dpdk-dev] [PATCH v2 0/2] mk: fix build with shared library Stephen Hemminger
@ 2019-07-26 16:36 ` Stephen Hemminger
2019-07-26 16:36 ` [dpdk-dev] [PATCH v2 2/2] mk: fix missing mempool driver registration Stephen Hemminger
1 sibling, 0 replies; 3+ messages in thread
From: Stephen Hemminger @ 2019-07-26 16:36 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, stable
If DPDK is built as a shared library, then any application linked
with rte.app.mk will not find any buses (including PCI devices).
This is because the linker will not call the initializers
of the bus libraries since they are not directly called by
application or EAL.
Bugzilla ID: 333
Fixes: c752998b5e2e ("pci: introduce library and driver")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
mk/rte.app.mk | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/mk/rte.app.mk b/mk/rte.app.mk
index a277c808ed8e..3b3156bfcf09 100644
--- a/mk/rte.app.mk
+++ b/mk/rte.app.mk
@@ -123,6 +123,10 @@ ifneq (,$(findstring y,$(MVEP-y)))
_LDLIBS-y += -lrte_common_mvep -L$(LIBMUSDK_PATH)/lib -lmusdk
endif
+# Bus devices use constructors to register and therefore
+# need to be always linked in (--whole-archive already enabled)
+_LDLIBS-y += --no-as-needed
+
ifeq ($(CONFIG_RTE_LIBRTE_DPAA_BUS),y)
_LDLIBS-$(CONFIG_RTE_LIBRTE_COMMON_DPAAX) += -lrte_common_dpaax
endif
@@ -137,6 +141,9 @@ ifeq ($(CONFIG_RTE_EAL_VFIO),y)
_LDLIBS-$(CONFIG_RTE_LIBRTE_FSLMC_BUS) += -lrte_bus_fslmc
endif
+# drivers are as-needed
+_LDLIBS-y += --as-needed
+
ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),n)
# plugins (link only if static libraries)
--
2.20.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [dpdk-dev] [PATCH v2 2/2] mk: fix missing mempool driver registration
2019-07-26 16:36 [dpdk-dev] [PATCH v2 0/2] mk: fix build with shared library Stephen Hemminger
2019-07-26 16:36 ` [dpdk-dev] [PATCH v2 1/2] bus: fix missing pci bus with shared library build Stephen Hemminger
@ 2019-07-26 16:36 ` Stephen Hemminger
1 sibling, 0 replies; 3+ messages in thread
From: Stephen Hemminger @ 2019-07-26 16:36 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, stable
Since mempool driver is now registered during constructor, the
mempool driver must always be linked in during shared library
build. Otherwise, application will fail because of missing default
mbuf pool operations.
Fixes: c6b3570f9e14 ("mk: link app with ring mempool by default")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
mk/rte.app.mk | 2 ++
1 file changed, 2 insertions(+)
diff --git a/mk/rte.app.mk b/mk/rte.app.mk
index 3b3156bfcf09..3e4580a2594c 100644
--- a/mk/rte.app.mk
+++ b/mk/rte.app.mk
@@ -87,7 +87,9 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_RAWDEV) += -lrte_rawdev
_LDLIBS-$(CONFIG_RTE_LIBRTE_TIMER) += -lrte_timer
_LDLIBS-$(CONFIG_RTE_LIBRTE_MEMPOOL) += -lrte_mempool
_LDLIBS-$(CONFIG_RTE_LIBRTE_STACK) += -lrte_stack
+_LDLIBS-$(CONFIG_RTE_DRIVER_MEMPOOL_RING) += --no-as-needed
_LDLIBS-$(CONFIG_RTE_DRIVER_MEMPOOL_RING) += -lrte_mempool_ring
+_LDLIBS-$(CONFIG_RTE_DRIVER_MEMPOOL_RING) += --as-needed
_LDLIBS-$(CONFIG_RTE_LIBRTE_OCTEONTX2_MEMPOOL) += -lrte_mempool_octeontx2
_LDLIBS-$(CONFIG_RTE_LIBRTE_RING) += -lrte_ring
_LDLIBS-$(CONFIG_RTE_LIBRTE_PCI) += -lrte_pci
--
2.20.1
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-07-26 16:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-26 16:36 [dpdk-dev] [PATCH v2 0/2] mk: fix build with shared library Stephen Hemminger
2019-07-26 16:36 ` [dpdk-dev] [PATCH v2 1/2] bus: fix missing pci bus with shared library build Stephen Hemminger
2019-07-26 16:36 ` [dpdk-dev] [PATCH v2 2/2] mk: fix missing mempool driver registration Stephen Hemminger
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).