DPDK patches and discussions
 help / color / mirror / Atom feed
From: Panu Matilainen <pmatilai@redhat.com>
To: dev@dpdk.org
Cc: ferruh.yigit@intel.com, thomas.monjalon@6wind.com
Subject: [dpdk-dev] [PATCH 1/2] mk: Eliminate possible duplicates from LDLIBS
Date: Mon, 21 Mar 2016 13:33:57 +0200	[thread overview]
Message-ID: <233492f10ac71dd9f6902eaa4bca425febc5d2c0.1458560038.git.pmatilai@redhat.com> (raw)

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

             reply	other threads:[~2016-03-21 11:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-21 11:33 Panu Matilainen [this message]
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

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=233492f10ac71dd9f6902eaa4bca425febc5d2c0.1458560038.git.pmatilai@redhat.com \
    --to=pmatilai@redhat.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --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).