DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas.monjalon@6wind.com>
To: Panu Matilainen <pmatilai@redhat.com>
Cc: dev@dpdk.org
Subject: [dpdk-dev] [PATCH v2 2/2] mk: fix shared library dependencies of drivers
Date: Sun,  6 Dec 2015 19:46:06 +0100	[thread overview]
Message-ID: <1449427566-15782-2-git-send-email-thomas.monjalon@6wind.com> (raw)
In-Reply-To: <1449427566-15782-1-git-send-email-thomas.monjalon@6wind.com>

From: Panu Matilainen <pmatilai@redhat.com>

Similar to commit 113c8e13c4201eee207723571f83aaf285277d75, but
for bnx2x, pcap, sze2data and xenvirt PMDs.

Requiring applications to know about library internal details like
dependencies to external helper libraries is a limitation of
static linkage, shared libraries should always know their own
dependencies for sane operation. This is especially highlighted
with dlopen()'ed items, having applications link against about plugin
internal dependencies goes on the side of absurd.

Note that linking with a shared combined library still requires to
know the internal dependencies.

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
 drivers/net/bnx2x/Makefile    |  1 +
 drivers/net/pcap/Makefile     |  1 +
 drivers/net/szedata2/Makefile |  1 +
 drivers/net/xenvirt/Makefile  |  1 +
 mk/rte.app.mk                 | 12 ++++--------
 5 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/net/bnx2x/Makefile b/drivers/net/bnx2x/Makefile
index 87f31b6..d895d8c 100644
--- a/drivers/net/bnx2x/Makefile
+++ b/drivers/net/bnx2x/Makefile
@@ -8,6 +8,7 @@ LIB = librte_pmd_bnx2x.a
 CFLAGS += -O3 -g
 CFLAGS += $(WERROR_FLAGS)
 CFLAGS += -DZLIB_CONST
+LDLIBS += -lz
 
 EXPORT_MAP := rte_pmd_bnx2x_version.map
 
diff --git a/drivers/net/pcap/Makefile b/drivers/net/pcap/Makefile
index 48be913..b41d8a2 100644
--- a/drivers/net/pcap/Makefile
+++ b/drivers/net/pcap/Makefile
@@ -39,6 +39,7 @@ LIB = librte_pmd_pcap.a
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+LDLIBS += -lpcap
 
 EXPORT_MAP := rte_pmd_pcap_version.map
 
diff --git a/drivers/net/szedata2/Makefile b/drivers/net/szedata2/Makefile
index c3c42e5..963a8d6 100644
--- a/drivers/net/szedata2/Makefile
+++ b/drivers/net/szedata2/Makefile
@@ -38,6 +38,7 @@ LIB = librte_pmd_szedata2.a
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+LDLIBS += -lsze2
 
 EXPORT_MAP := rte_pmd_szedata2_version.map
 
diff --git a/drivers/net/xenvirt/Makefile b/drivers/net/xenvirt/Makefile
index 9c521d5..1d05b71 100644
--- a/drivers/net/xenvirt/Makefile
+++ b/drivers/net/xenvirt/Makefile
@@ -38,6 +38,7 @@ LIB = librte_pmd_xenvirt.a
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+LDLIBS += -lxenstore
 
 EXPORT_MAP := rte_eth_xenvirt_version.map
 
diff --git a/mk/rte.app.mk b/mk/rte.app.mk
index 3f56852..90ec33d 100644
--- a/mk/rte.app.mk
+++ b/mk/rte.app.mk
@@ -90,10 +90,6 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST)          += -lrte_vhost
 
 endif # ! CONFIG_RTE_BUILD_COMBINE_LIBS
 
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_PCAP)       += -lpcap
-
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_SZEDATA2)   += -lsze2
-
 ifeq ($(CONFIG_RTE_LIBRTE_VHOST_NUMA),y)
 _LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST)          += -lnuma
 endif
@@ -106,13 +102,13 @@ endif
 # The combined library fails also to store this information.
 # So linking with static or combined library requires explicit dependencies.
 ifneq ($(CONFIG_RTE_BUILD_COMBINE_LIBS)$(CONFIG_RTE_BUILD_SHARED_LIB),ny)
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_PCAP)       += -lpcap
+_LDLIBS-$(CONFIG_RTE_LIBRTE_BNX2X_PMD)      += -lz
 _LDLIBS-$(CONFIG_RTE_LIBRTE_MLX4_PMD)       += -libverbs
 _LDLIBS-$(CONFIG_RTE_LIBRTE_MLX5_PMD)       += -libverbs
-endif # CONFIG_RTE_BUILD_COMBINE_LIBS or not CONFIG_RTE_BUILD_SHARED_LIBS
-
-_LDLIBS-$(CONFIG_RTE_LIBRTE_BNX2X_PMD)      += -lz
-
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_SZEDATA2)   += -lsze2
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT)    += -lxenstore
+endif # CONFIG_RTE_BUILD_COMBINE_LIBS or not CONFIG_RTE_BUILD_SHARED_LIBS
 
 _LDLIBS-y += --start-group
 
-- 
2.5.2

  reply	other threads:[~2015-12-06 18:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-21 14:18 [dpdk-dev] [PATCH] drivers: fix shared library dependencies to external libraries Panu Matilainen
2015-10-21 16:30 ` Nicolas Pernas Maradei
2015-10-22  4:44   ` Panu Matilainen
2015-12-06 18:46 ` [dpdk-dev] [PATCH v2 1/2] mk: prepare dependencies in shared libraries not combined Thomas Monjalon
2015-12-06 18:46   ` Thomas Monjalon [this message]
2015-12-06 21:13     ` [dpdk-dev] [PATCH v2 2/2] mk: fix shared library dependencies of drivers Thomas Monjalon

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=1449427566-15782-2-git-send-email-thomas.monjalon@6wind.com \
    --to=thomas.monjalon@6wind.com \
    --cc=dev@dpdk.org \
    --cc=pmatilai@redhat.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).