DPDK patches and discussions
 help / color / mirror / Atom feed
From: Luca Boccassi <bluca@debian.org>
To: Bruce Richardson <bruce.richardson@intel.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [RFC PATCH] build: use libpcap only from pkg-config
Date: Fri, 09 Oct 2020 13:51:35 +0100
Message-ID: <4ba7d93db044cb820b89f20ef7cea8abe7a75404.camel@debian.org> (raw)
In-Reply-To: <20201009103202.GA1474@bricha3-MOBL.ger.corp.intel.com>

On Fri, 2020-10-09 at 11:32 +0100, Bruce Richardson wrote:
> On Fri, Oct 09, 2020 at 10:09:11AM +0100, Luca Boccassi wrote:
> > On Thu, 2020-10-08 at 18:08 +0100, Bruce Richardson wrote:
> > > On Thu, Oct 08, 2020 at 06:05:36PM +0100, Bruce Richardson wrote:
> > > > All recent linux distro's - including RHEL 8 and Ubuntu 18.04 - provide a
> > > > pkg-config file for libpcap, and using other methods of finding the library
> > > > can cause issues when cross-compiling, so we can limit build support for
> > > > pcap versions without a .pc file.
> > > > 
> > > > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > > > ---
> > > >  config/meson.build | 8 +-------
> > > >  1 file changed, 1 insertion(+), 7 deletions(-)
> > > > 
> > > > diff --git a/config/meson.build b/config/meson.build
> > > > index 69f2aeb60..edc6c195a 100644
> > > > --- a/config/meson.build
> > > > +++ b/config/meson.build
> > > > @@ -163,13 +163,7 @@ if libbsd.found()
> > > >  endif
> > > >  
> > > >  # check for pcap
> > > > -pcap_dep = dependency('pcap', required: false)
> > > > -if pcap_dep.found()
> > > > -	# pcap got a pkg-config file only in 1.9.0 and before that meson uses
> > > > -	# an internal pcap-config finder, which is not compatible with
> > > > -	# cross-compilation, so try to fallback to find_library
> > > > -	pcap_dep = cc.find_library('pcap', required: false)
> > > > -endif
> > > > +pcap_dep = dependency('libpcap', required: false, method: 'pkg-config')
> > > >  if pcap_dep.found() and cc.has_header('pcap.h', dependencies: pcap_dep)
> > > >  	dpdk_conf.set('RTE_PORT_PCAP', 1)
> > > >  	dpdk_extra_ldflags += '-lpcap'
> > > 
> > > Just sending this as an RFC for consideration, since I hit problems with
> > > the pcap code when testing 32-bit (x32) builds, and remembered having hit
> > > it previously too.
> > > 
> > > Does anyone see an issue with limiting our pcap detection to pkg-config
> > > only in this case?
> > > 
> > > /Bruce
> > 
> > Sadly it's not yet available in Debian stable:
> > 
> > https://packages.debian.org/buster/amd64/libpcap0.8-dev/filelist
> > 
> > Also for Ubuntu 18.04, it's only available with the bionic-updates
> > repository, and only for the past month - it shipped without it.
> > 
> > I'm absolutely keen on using only pkg-config (so much that I did the
> > packaging changes myself to ship it in libpcap-dev [1][2]) but perhaps
> > in the interest of compatibility it's better to wait next year, so that
> > the new Debian stable supports it, and the Ubuntu 18.04 LTS fix had the
> > chance to rollout everywhere?
> > 
> 
> Thanks, that's exactly the sort of feedback I was looking for!
> 
> It seems to be the pcap-config support in meson which causes cross-building
> issues, so I wonder would it still work ok if we changed this to only use
> pkg-config for the initial search and then use find-library if that failed?
> 
>  # check for pcap
> -pcap_dep = dependency('pcap', required: false)
> -if pcap_dep.found()
> -       # pcap got a pkg-config file only in 1.9.0 and before that meson uses
> -       # an internal pcap-config finder, which is not compatible with
> -       # cross-compilation, so try to fallback to find_library
> +pcap_dep = dependency('libpcap', required: false, method: 'pkg-config')
> +if not pcap_dep.found()
> +       # pcap got a pkg-config file only in 1.9.0
>         pcap_dep = cc.find_library('pcap', required: false)
>  endif

That would be fine - is the 'method' option supported in the minimum
version we support right now?

-- 
Kind regards,
Luca Boccassi

  reply	other threads:[~2020-10-09 12:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-08 17:05 Bruce Richardson
2020-10-08 17:08 ` Bruce Richardson
2020-10-09  9:09   ` Luca Boccassi
2020-10-09 10:32     ` Bruce Richardson
2020-10-09 12:51       ` Luca Boccassi [this message]
2020-10-09 13:39         ` Bruce Richardson
2020-10-09 14:19 ` [dpdk-dev] [PATCH v2] build: skip detecting libpcap via pcap-config Bruce Richardson
2020-10-09 14:54   ` Luca Boccassi
2020-10-12 15:12     ` David Marchand
2020-10-12 12:02   ` David Marchand
2020-10-12 12:47     ` Bruce Richardson
2020-10-12 12:48   ` Bruce Richardson

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=4ba7d93db044cb820b89f20ef7cea8abe7a75404.camel@debian.org \
    --to=bluca@debian.org \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.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

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git