All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas.monjalon-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
To: Neil Horman <nhorman-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
Cc: dev-VfR2kkLFssw@public.gmane.org
Subject: Re: [PATCH v2] mk: fix build with shared pcap pmd
Date: Tue, 16 Dec 2014 15:39:56 +0100	[thread overview]
Message-ID: <78819532.f064i2G3g0@xps13> (raw)
In-Reply-To: <20141216135822.GC13806-B26myB8xz7F8NnZeBjwnZQMhkBWG/bsMQH7oEaQurus@public.gmane.org>

2014-12-16 08:58, Neil Horman:
> On Tue, Dec 16, 2014 at 12:04:44AM +0100, Thomas Monjalon wrote:
> > Some applications doesn't have the pcap link flag
> > when shared libraries are enabled.
> > Indeed in such case, pcap PMD must not be linked but pcap library should.
> > 
> > Actually -lpcap is always needed if pcap PMD is used,
> > and -lrte_pmd_pcap must be set only with static PMD library.
> > So the flags -lrte_pmd_pcap and -lpcap are enabled separately.
> > 
> > Workarounds in test-pmd/ and test-pipeline/ can be removed.
> > 
> > Reported-by: Stepan Sojka <stepan.sojka-ZIwQ0BidGjIAKGZpT+uQAtBPR1lH4CV8@public.gmane.org>
> > Signed-off-by: Thomas Monjalon <thomas.monjalon-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
[...]
> > --- a/mk/rte.app.mk
> > +++ b/mk/rte.app.mk
> > @@ -119,6 +119,10 @@ LDLIBS += -lm
> >  LDLIBS += -lrt
> >  endif
> >  
> > +ifeq ($(CONFIG_RTE_LIBRTE_PMD_PCAP),y)
> > +LDLIBS += -lpcap
> > +endif
> > +
> >  LDLIBS += --start-group
> >  
> >  ifeq ($(CONFIG_RTE_LIBRTE_KVARGS),y)
> > @@ -207,7 +211,7 @@ LDLIBS += -lrte_pmd_ring
> >  endif
> >  
> >  ifeq ($(CONFIG_RTE_LIBRTE_PMD_PCAP),y)
> > -LDLIBS += -lrte_pmd_pcap -lpcap
> > +LDLIBS += -lrte_pmd_pcap
> >  endif
> >  
> >  ifeq ($(CONFIG_RTE_LIBRTE_PMD_AF_PACKET),y)
> 
> Actually, what if we just add $(LDFLAGS) to the O_TO_S rule in mk/rte.lib.mk?
> Then in lib/librte_pmd_pcap/Makefile, we can just add LDFLAGS+=-lpcap, and the
> loading of the pcap pmd will itself require the loading of libpcap.  That would
> be a nice clean implementation that allows applications to just link the pmd and
> not have to worry about dependencies.  It would also allow us to clean up other
> dependencies like the xenvirt pmd and vhost.

Yes it makes sense. Could you test it please?
What about applying my patch (which keep the existing logic) as a first
fix/clean-up and then move -lpcap in PMD as a second step?
Proceeding this way would allow to integrate a safe fix for 1.8.0.
Maybe that linking pcap in the PMD could unveil new bugs with some distributions,
so it would need some time to validate it.

-- 
Thomas

  parent reply	other threads:[~2014-12-16 14:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-06 23:14 [pcap PATCH] pcap: fix build of all-in-one shared library stepan
     [not found] ` <kzlhosux2e.fsf-ZIwQ0BidGjIAKGZpT+uQAtBPR1lH4CV8@public.gmane.org>
2014-12-08 14:49   ` [dpdk-dev, pcap] " Neil Horman
     [not found]     ` <20141208144910.GE3237-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2014-12-15 22:42       ` Thomas Monjalon
2014-12-15 23:04         ` [PATCH v2] mk: fix build with shared pcap pmd Thomas Monjalon
     [not found]           ` <1418684684-23642-1-git-send-email-thomas.monjalon-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2014-12-16 13:58             ` Neil Horman
     [not found]               ` <20141216135822.GC13806-B26myB8xz7F8NnZeBjwnZQMhkBWG/bsMQH7oEaQurus@public.gmane.org>
2014-12-16 14:39                 ` Thomas Monjalon [this message]
2014-12-16 21:42                   ` Neil Horman
     [not found]                     ` <20141216214213.GF13806-B26myB8xz7F8NnZeBjwnZQMhkBWG/bsMQH7oEaQurus@public.gmane.org>
2014-12-16 23:37                       ` 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=78819532.f064i2G3g0@xps13 \
    --to=thomas.monjalon-pdr9zngts4eavxtiumwx3w@public.gmane.org \
    --cc=dev-VfR2kkLFssw@public.gmane.org \
    --cc=nhorman-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.