From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0A81BA04BC; Fri, 9 Oct 2020 15:39:15 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E07F01C2A9; Fri, 9 Oct 2020 15:39:13 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 9A33C1C229 for ; Fri, 9 Oct 2020 15:39:11 +0200 (CEST) IronPort-SDR: FK2ncRGj+PnstFyxc2Dx4DQqtCNLj4BvXoeCVCyJq58cMdgVGaxeAo3ron0ltZ5tZsy3H+y0+U +QRZWCOI5GAg== X-IronPort-AV: E=McAfee;i="6000,8403,9768"; a="152403345" X-IronPort-AV: E=Sophos;i="5.77,355,1596524400"; d="scan'208";a="152403345" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Oct 2020 06:39:09 -0700 IronPort-SDR: pnErNpPlZWthgs2eMhgNyCDsTq41UosJywZey/UWVAbM8KKCiDCZh8g28Djz8xRmDacO+KBwGX TZhjqhzyJD+g== X-IronPort-AV: E=Sophos;i="5.77,355,1596524400"; d="scan'208";a="355758985" Received: from bricha3-mobl.ger.corp.intel.com ([10.213.3.76]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 09 Oct 2020 06:39:08 -0700 Date: Fri, 9 Oct 2020 14:39:04 +0100 From: Bruce Richardson To: Luca Boccassi Cc: dev@dpdk.org Message-ID: <20201009133904.GD1474@bricha3-MOBL.ger.corp.intel.com> References: <20201008170536.124111-1-bruce.richardson@intel.com> <20201008170805.GF1106@bricha3-MOBL.ger.corp.intel.com> <4e40d3fa1af950ab760995828c46125211f5960b.camel@debian.org> <20201009103202.GA1474@bricha3-MOBL.ger.corp.intel.com> <4ba7d93db044cb820b89f20ef7cea8abe7a75404.camel@debian.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4ba7d93db044cb820b89f20ef7cea8abe7a75404.camel@debian.org> Subject: Re: [dpdk-dev] [RFC PATCH] build: use libpcap only from pkg-config X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Fri, Oct 09, 2020 at 01:51:35PM +0100, Luca Boccassi wrote: > 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 > > > > > --- > > > > > 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? > I tried building with meson 0.47 and didn't get any errors so it should be ok, though the reference guide doesn't explicitly say what version it's supported in. I think even if unsupported in 0.47, the keyword arg would just be ignored. I'll do up a non-RFC v2 so.