patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Yuanhan Liu <yuanhan.liu@linux.intel.com>
To: Olivier Matz <olivier.matz@6wind.com>
Cc: Yuanhan Liu <yuanhan.liu@linux.intel.com>,
	Thomas Monjalon <thomas.monjalon@6wind.com>,
	dpdk stable <stable@dpdk.org>
Subject: [dpdk-stable] patch 'mk: fix lib filtering when linking app' has been queued to LTS release 16.11.2
Date: Fri,  7 Apr 2017 16:12:00 +0800	[thread overview]
Message-ID: <1491552724-3034-43-git-send-email-yuanhan.liu@linux.intel.com> (raw)
In-Reply-To: <1491552724-3034-1-git-send-email-yuanhan.liu@linux.intel.com>

Hi,

FYI, your patch has been queued to LTS release 16.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable
yet. It will be pushed if I get no objections before 04/11/17.
So please shout if anyone has objections.

Thanks.

	--yliu

---
>From 5d23520c8e6388b684b0c82fe636ee4148af7f6e Mon Sep 17 00:00:00 2001
From: Olivier Matz <olivier.matz@6wind.com>
Date: Thu, 6 Apr 2017 16:14:55 +0200
Subject: [PATCH] mk: fix lib filtering when linking app

[ upstream commit ab338eb44ebb79840dab1de2742c07070ae3bf0e ]

I get the following error when linking the test application:
  build/lib/librte_pmd_thunderx_nicvf.a(nicvf_hw.o):
  In function `nicvf_qsize_regbit':
  drivers/net/thunderx/base/nicvf_hw.c:451: undefined reference to `log2'
  build/lib/librte_pmd_thunderx_nicvf.a(nicvf_hw.o):
  In function `nicvf_rss_reta_update':
  drivers/net/thunderx/base/nicvf_hw.c:804: undefined reference to `log2'
  build/lib/librte_pmd_thunderx_nicvf.a(nicvf_hw.o):
  In function `nicvf_rss_reta_query':
  drivers/net/thunderx/base/nicvf_hw.c:825: undefined reference to `log2'

While I don't know why it does not happen for a default build, the error
can be explained. The link command line is:

   gcc -o test ... *.o ... -Wl,-lm ... -Wl,-lrte_pmd_thunderx_nicvf ...

rte_pmd_thunderx_nicvf needs the math library, and it should be
added after. This is not the case because the test application also
adds the math library.

The makefile already filters the libraries, but it keeps the first
occurrence of the lib. Instead, the last one should be kept.

Fixes: edf4d331dcdb ("mk: eliminate duplicates from libraries list")

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
 mk/rte.app.mk | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/mk/rte.app.mk b/mk/rte.app.mk
index f75f0e2..725e01d 100644
--- a/mk/rte.app.mk
+++ b/mk/rte.app.mk
@@ -168,10 +168,21 @@ _LDLIBS-y += $(EXECENV_LDLIBS)
 
 LDLIBS += $(_LDLIBS-y) $(CPU_LDLIBS) $(EXTRA_LDLIBS)
 
-# Eliminate duplicates without sorting
-LDLIBS := $(shell echo $(LDLIBS) | \
-	awk '{for (i = 1; i <= NF; i++) { \
-		if ($$i !~ /^-l.*/ || !seen[$$i]++) print $$i }}')
+# all the words except the first one
+allbutfirst = $(wordlist 2,$(words $(1)),$(1))
+
+# Eliminate duplicates without sorting, only keep the last occurrence
+filter-libs = \
+	$(if $(1),$(strip\
+		$(if \
+			$(and \
+				$(filter $(firstword $(1)),$(call allbutfirst,$(1))),\
+				$(filter -l%,$(firstword $(1)))),\
+			,\
+			$(firstword $(1))) \
+		$(call filter-libs,$(call allbutfirst,$(1)))))
+
+LDLIBS := $(call filter-libs,$(LDLIBS))
 
 ifeq ($(RTE_DEVEL_BUILD)$(CONFIG_RTE_BUILD_SHARED_LIB),yy)
 LDFLAGS += -rpath=$(RTE_SDK_BIN)/lib
-- 
1.9.0

  parent reply	other threads:[~2017-04-07  8:15 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-07  8:11 [dpdk-stable] patch 'pci: fix device registration on FreeBSD' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'kni: fix build with kernel 4.11' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'vfio: fix disabling INTx' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'vfio: fix secondary process start' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'nic_uio: fix device binding at boot' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'eal/linux: fix build with glibc 2.25' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'examples/ip_fragmentation: fix check of packet type' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'kni: fix build on Suse 12 SP3' " Yuanhan Liu
2017-04-10 10:01   ` Nirmoy Das
2017-04-11 12:38     ` Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'net/i40e: fix TC bitmap of VEB' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'net/mlx5: fix VLAN stripping indication' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'net/i40e: fix compile error' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'net/bnx2x: fix transmit queue free threshold' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'net/e1000/base: fix multicast setting in VF' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'net/mlx5: fix supported packets types' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'net/ixgbe/base: fix build error' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'net/ixgbe: fix Rx queue blocking issue' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'net/ixgbe: fix all queues drop setting of DCB' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'net/ixgbe: fix multi-queue mode check in SRIOV mode' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'app/testpmd: fix init config for multi-queue " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'app/testpmd: fix TC mapping in DCB init config' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'net/i40e: fix incorrect packet index reference' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'net/ixgbevf: set xstats id values' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'net/pcap: fix using mbuf after freeing it' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'net/ena: fix return of hash control flushing' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'net/thunderx: fix 32-bit build' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'net/thunderx: fix build on FreeBSD' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'net/mlx4: update link status upon probing with LSC' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'net/i40e/base: fix potential out of bound array access' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'net/mlx5: fix reusing Rx/Tx queues' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'net/ixgbe: fix TC bandwidth setting' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'net/mlx4: fix returned values upon failed probing' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'net/mlx5: " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'net/fm10k: fix pointer cast' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'net/qede: fix missing UDP protocol in RSS offload types' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'net/mlx5: fix Tx when first segment size is too short' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'vhost: change log levels in client mode' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'vhost: fix multiple queue not enabled for old kernels' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'vhost: fix max queues' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'vhost: fix false sharing' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'vhost: fix fd leaks for vhost-user server mode' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'net/mlx5: fix an uninitialized variable' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'mk: fix shell errors when building with clang' " Yuanhan Liu
2017-04-07  8:12 ` Yuanhan Liu [this message]
2017-04-07  8:12 ` [dpdk-stable] patch 'examples/quota_watermark: fix requirement for 2M pages' " Yuanhan Liu
2017-04-07  8:12 ` [dpdk-stable] patch 'net/vmxnet3: fix queue size changes' " Yuanhan Liu
2017-04-07  8:12 ` [dpdk-stable] patch 'net/virtio-user: fix overflow' " Yuanhan Liu
2017-04-07  8:12 ` [dpdk-stable] patch 'net/virtio: disable LSC interrupt if MSIX not enabled' " Yuanhan Liu

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=1491552724-3034-43-git-send-email-yuanhan.liu@linux.intel.com \
    --to=yuanhan.liu@linux.intel.com \
    --cc=olivier.matz@6wind.com \
    --cc=stable@dpdk.org \
    --cc=thomas.monjalon@6wind.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).