patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>, stable@dpdk.org
Subject: [dpdk-stable] [PATCH v2 1/2] bus: fix missing pci bus with shared library build
Date: Fri, 26 Jul 2019 09:36:16 -0700	[thread overview]
Message-ID: <20190726163617.29701-2-stephen@networkplumber.org> (raw)
In-Reply-To: <20190726163617.29701-1-stephen@networkplumber.org>

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


       reply	other threads:[~2019-07-26 16:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190726163617.29701-1-stephen@networkplumber.org>
2019-07-26 16:36 ` Stephen Hemminger [this message]
2019-07-26 16:36 ` [dpdk-stable] [PATCH v2 2/2] mk: fix missing mempool driver registration Stephen Hemminger

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=20190726163617.29701-2-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    /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).