DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/2] mk: Eliminate possible duplicates from LDLIBS
@ 2016-03-21 11:33 Panu Matilainen
  2016-03-21 11:33 ` [dpdk-dev] [PATCH 2/2] mk: fix two more missing libm dependencies Panu Matilainen
  0 siblings, 1 reply; 4+ messages in thread
From: Panu Matilainen @ 2016-03-21 11:33 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, thomas.monjalon

Duplicates in LDLIBS can cause link failures from multiply defined
symbols, ensure all libraries are only mentioned once. Can't use
sorting for duplicate elimination as order is critical so awk one-liner
is used.

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
---
 mk/rte.app.mk | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/mk/rte.app.mk b/mk/rte.app.mk
index a1cd9a3..f4eb5e8 100644
--- a/mk/rte.app.mk
+++ b/mk/rte.app.mk
@@ -174,6 +174,9 @@ _LDLIBS-y += --no-whole-archive
 
 LDLIBS += $(_LDLIBS-y) $(CPU_LDLIBS) $(EXTRA_LDLIBS)
 
+# Eliminate duplicates without sorting
+LDLIBS := $(shell echo $(LDLIBS) | awk '{for (i = 1; i <= NF; i++) { if (!seen[$$i]++) print $$i }}')
+
 .PHONY: all
 all: install
 
-- 
2.5.0

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

* [dpdk-dev] [PATCH 2/2] mk: fix two more missing libm dependencies
  2016-03-21 11:33 [dpdk-dev] [PATCH 1/2] mk: Eliminate possible duplicates from LDLIBS Panu Matilainen
@ 2016-03-21 11:33 ` Panu Matilainen
  2016-03-21 11:48   ` Ferruh Yigit
  0 siblings, 1 reply; 4+ messages in thread
From: Panu Matilainen @ 2016-03-21 11:33 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, thomas.monjalon

Commit e86a699cf6b1 missed two further libm dependencies: ceil() used by
librte_meter is typically inlined so the missing dependency does not
actually cause failures, and librte_pmd_nfp is not built by default
so its easy to miss.

This causes duplicates in LDLIBS in many configurations so its vital
they are removed before passing to linker.

Fixes: e86a699cf6b1 ("mk: fix shared library dependencies on libm and librt")

Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
---
 drivers/net/nfp/Makefile  | 2 ++
 lib/librte_meter/Makefile | 2 ++
 mk/rte.app.mk             | 2 ++
 3 files changed, 6 insertions(+)

diff --git a/drivers/net/nfp/Makefile b/drivers/net/nfp/Makefile
index ef7a13d..1dddd1f 100644
--- a/drivers/net/nfp/Makefile
+++ b/drivers/net/nfp/Makefile
@@ -39,6 +39,8 @@ LIB = librte_pmd_nfp.a
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 
+LDLIBS += -lm
+
 EXPORT_MAP := rte_pmd_nfp_version.map
 
 LIBABIVER := 1
diff --git a/lib/librte_meter/Makefile b/lib/librte_meter/Makefile
index 8765881..f07fced 100644
--- a/lib/librte_meter/Makefile
+++ b/lib/librte_meter/Makefile
@@ -39,6 +39,8 @@ LIB = librte_meter.a
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 
+LDLIBS += -lm
+
 EXPORT_MAP := rte_meter_version.map
 
 LIBABIVER := 1
diff --git a/mk/rte.app.mk b/mk/rte.app.mk
index f4eb5e8..2f9bafe 100644
--- a/mk/rte.app.mk
+++ b/mk/rte.app.mk
@@ -85,6 +85,7 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST)          += -lrte_vhost
 ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),n)
 _LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED)          += -lm
 _LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED)          += -lrt
+_LDLIBS-$(CONFIG_RTE_LIBRTE_METER)          += -lm
 ifeq ($(CONFIG_RTE_LIBRTE_VHOST_NUMA),y)
 _LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST)          += -lnuma
 endif
@@ -101,6 +102,7 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_MLX5_PMD)       += -libverbs
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_SZEDATA2)   += -lsze2
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT)    += -lxenstore
 _LDLIBS-$(CONFIG_RTE_LIBRTE_MPIPE_PMD)      += -lgxio
+_LDLIBS-$(CONFIG_RTE_LIBRTE_NFP_PMD)        += -lm
 # QAT / AESNI GCM PMDs are dependent on libcrypto (from openssl)
 # for calculating HMAC precomputes
 ifeq ($(CONFIG_RTE_LIBRTE_PMD_QAT),y)
-- 
2.5.0

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

* Re: [dpdk-dev] [PATCH 2/2] mk: fix two more missing libm dependencies
  2016-03-21 11:33 ` [dpdk-dev] [PATCH 2/2] mk: fix two more missing libm dependencies Panu Matilainen
@ 2016-03-21 11:48   ` Ferruh Yigit
  2016-03-22 19:39     ` Thomas Monjalon
  0 siblings, 1 reply; 4+ messages in thread
From: Ferruh Yigit @ 2016-03-21 11:48 UTC (permalink / raw)
  To: Panu Matilainen, dev; +Cc: thomas.monjalon

On 3/21/2016 11:33 AM, Panu Matilainen wrote:
> Commit e86a699cf6b1 missed two further libm dependencies: ceil() used by
> librte_meter is typically inlined so the missing dependency does not
> actually cause failures, and librte_pmd_nfp is not built by default
> so its easy to miss.
> 
> This causes duplicates in LDLIBS in many configurations so its vital
> they are removed before passing to linker.
> 
> Fixes: e86a699cf6b1 ("mk: fix shared library dependencies on libm and librt")
> 
> Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
> Signed-off-by: Panu Matilainen <pmatilai@redhat.com>

Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>

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

* Re: [dpdk-dev] [PATCH 2/2] mk: fix two more missing libm dependencies
  2016-03-21 11:48   ` Ferruh Yigit
@ 2016-03-22 19:39     ` Thomas Monjalon
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2016-03-22 19:39 UTC (permalink / raw)
  To: Panu Matilainen; +Cc: dev, Ferruh Yigit

2016-03-21 11:48, Ferruh Yigit:
> On 3/21/2016 11:33 AM, Panu Matilainen wrote:
> > Commit e86a699cf6b1 missed two further libm dependencies: ceil() used by
> > librte_meter is typically inlined so the missing dependency does not
> > actually cause failures, and librte_pmd_nfp is not built by default
> > so its easy to miss.
> > 
> > This causes duplicates in LDLIBS in many configurations so its vital
> > they are removed before passing to linker.
> > 
> > Fixes: e86a699cf6b1 ("mk: fix shared library dependencies on libm and librt")
> > 
> > Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
> > Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
> 
> Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>

Applied, thanks

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

end of thread, other threads:[~2016-03-22 19:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-21 11:33 [dpdk-dev] [PATCH 1/2] mk: Eliminate possible duplicates from LDLIBS Panu Matilainen
2016-03-21 11:33 ` [dpdk-dev] [PATCH 2/2] mk: fix two more missing libm dependencies Panu Matilainen
2016-03-21 11:48   ` Ferruh Yigit
2016-03-22 19:39     ` 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).