DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [RFC PATCH] build: use libpcap only from pkg-config
@ 2020-10-08 17:05 Bruce Richardson
  2020-10-08 17:08 ` Bruce Richardson
  2020-10-09 14:19 ` [dpdk-dev] [PATCH v2] build: skip detecting libpcap via pcap-config Bruce Richardson
  0 siblings, 2 replies; 12+ messages in thread
From: Bruce Richardson @ 2020-10-08 17:05 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

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'
-- 
2.25.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [dpdk-dev] [RFC PATCH] build: use libpcap only from pkg-config
  2020-10-08 17:05 [dpdk-dev] [RFC PATCH] build: use libpcap only from pkg-config Bruce Richardson
@ 2020-10-08 17:08 ` Bruce Richardson
  2020-10-09  9:09   ` Luca Boccassi
  2020-10-09 14:19 ` [dpdk-dev] [PATCH v2] build: skip detecting libpcap via pcap-config Bruce Richardson
  1 sibling, 1 reply; 12+ messages in thread
From: Bruce Richardson @ 2020-10-08 17:08 UTC (permalink / raw)
  To: dev; +Cc: bluca

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [dpdk-dev] [RFC PATCH] build: use libpcap only from pkg-config
  2020-10-08 17:08 ` Bruce Richardson
@ 2020-10-09  9:09   ` Luca Boccassi
  2020-10-09 10:32     ` Bruce Richardson
  0 siblings, 1 reply; 12+ messages in thread
From: Luca Boccassi @ 2020-10-09  9:09 UTC (permalink / raw)
  To: Bruce Richardson, dev

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?

-- 
Kind regards,
Luca Boccassi

[1] http://changelogs.ubuntu.com/changelogs/pool/main/libp/libpcap/libpcap_1.8.1-6ubuntu1.18.04.2/changelog
[2] https://metadata.ftp-master.debian.org/changelogs//main/libp/libpcap/libpcap_1.9.1-4_changelog

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [dpdk-dev] [RFC PATCH] build: use libpcap only from pkg-config
  2020-10-09  9:09   ` Luca Boccassi
@ 2020-10-09 10:32     ` Bruce Richardson
  2020-10-09 12:51       ` Luca Boccassi
  0 siblings, 1 reply; 12+ messages in thread
From: Bruce Richardson @ 2020-10-09 10:32 UTC (permalink / raw)
  To: Luca Boccassi; +Cc: dev

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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [dpdk-dev] [RFC PATCH] build: use libpcap only from pkg-config
  2020-10-09 10:32     ` Bruce Richardson
@ 2020-10-09 12:51       ` Luca Boccassi
  2020-10-09 13:39         ` Bruce Richardson
  0 siblings, 1 reply; 12+ messages in thread
From: Luca Boccassi @ 2020-10-09 12:51 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [dpdk-dev] [RFC PATCH] build: use libpcap only from pkg-config
  2020-10-09 12:51       ` Luca Boccassi
@ 2020-10-09 13:39         ` Bruce Richardson
  0 siblings, 0 replies; 12+ messages in thread
From: Bruce Richardson @ 2020-10-09 13:39 UTC (permalink / raw)
  To: Luca Boccassi; +Cc: 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 <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?
> 
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.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [dpdk-dev] [PATCH v2] build: skip detecting libpcap via pcap-config
  2020-10-08 17:05 [dpdk-dev] [RFC PATCH] build: use libpcap only from pkg-config Bruce Richardson
  2020-10-08 17:08 ` Bruce Richardson
@ 2020-10-09 14:19 ` Bruce Richardson
  2020-10-09 14:54   ` Luca Boccassi
                     ` (2 more replies)
  1 sibling, 3 replies; 12+ messages in thread
From: Bruce Richardson @ 2020-10-09 14:19 UTC (permalink / raw)
  To: dev; +Cc: bluca, Bruce Richardson

When compiling for a slightly different architecture, e.g. 32-bit on 64-bit
systems using CFLAGS rather than a cross-file, the pcap-config utility can
often return parameters that are unusable for the build in question, i.e.
providing the native 64-bit library paths rather than checking for 32-bit
equivalent.

Since many distros now include a version of libpcap with a
pkg-config file, and for those that don't find-library should work ok as a
fallback, we can explicitly just use pkg-config in the dependency search,
causing meson to skip trying to use pcap-config.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 config/meson.build | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/config/meson.build b/config/meson.build
index 69f2aeb60..9fb903c9b 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -163,11 +163,9 @@ 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 = 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
 if pcap_dep.found() and cc.has_header('pcap.h', dependencies: pcap_dep)
-- 
2.25.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [dpdk-dev] [PATCH v2] build: skip detecting libpcap via pcap-config
  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:48   ` Bruce Richardson
  2 siblings, 1 reply; 12+ messages in thread
From: Luca Boccassi @ 2020-10-09 14:54 UTC (permalink / raw)
  To: Bruce Richardson, dev

On Fri, 2020-10-09 at 15:19 +0100, Bruce Richardson wrote:
> When compiling for a slightly different architecture, e.g. 32-bit on 64-bit
> systems using CFLAGS rather than a cross-file, the pcap-config utility can
> often return parameters that are unusable for the build in question, i.e.
> providing the native 64-bit library paths rather than checking for 32-bit
> equivalent.
> 
> Since many distros now include a version of libpcap with a
> pkg-config file, and for those that don't find-library should work ok as a
> fallback, we can explicitly just use pkg-config in the dependency search,
> causing meson to skip trying to use pcap-config.
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
>  config/meson.build | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/config/meson.build b/config/meson.build
> index 69f2aeb60..9fb903c9b 100644
> --- a/config/meson.build
> +++ b/config/meson.build
> @@ -163,11 +163,9 @@ 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 = 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
>  if pcap_dep.found() and cc.has_header('pcap.h', dependencies: pcap_dep)

Reviewed-by: Luca Boccassi <bluca@debian.org>

-- 
Kind regards,
Luca Boccassi

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [dpdk-dev] [PATCH v2] build: skip detecting libpcap via pcap-config
  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 12:02   ` David Marchand
  2020-10-12 12:47     ` Bruce Richardson
  2020-10-12 12:48   ` Bruce Richardson
  2 siblings, 1 reply; 12+ messages in thread
From: David Marchand @ 2020-10-12 12:02 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev, Luca Boccassi

On Fri, Oct 9, 2020 at 4:19 PM Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> When compiling for a slightly different architecture, e.g. 32-bit on 64-bit
> systems using CFLAGS rather than a cross-file, the pcap-config utility can
> often return parameters that are unusable for the build in question, i.e.
> providing the native 64-bit library paths rather than checking for 32-bit
> equivalent.
>
> Since many distros now include a version of libpcap with a
> pkg-config file, and for those that don't find-library should work ok as a
> fallback, we can explicitly just use pkg-config in the dependency search,
> causing meson to skip trying to use pcap-config.
>
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>

I also hit (this?) issue on a fc32 with both 32-bit and 64-bit pcap installed.
Can you confirm?

If so, we might want to backport this as I get the same problem with v19.11.4.


# rpm -q libpcap
libpcap-1.9.1-3.fc32.x86_64
libpcap-1.9.1-3.fc32.i686
# rpm -q meson
meson-0.55.3-1.fc32.noarch

# meson --reconfigure build
The Meson build system
Version: 0.55.3
Source dir: /root/dpdk
Build dir: /root/dpdk/build
Build type: native build
Program cat found: YES
Project name: DPDK
Project version: 20.11.0-rc0
C compiler for the host machine: cc (gcc 10.2.1 "cc (GCC) 10.2.1
20200723 (Red Hat 10.2.1-1)")
C linker for the host machine: cc ld.bfd 2.34-5
Host machine cpu family: x86_64
Host machine cpu: x86_64
Program pkg-config found: YES
Program gen-pmdinfo-cfile.sh found: YES
Program list-dir-globs.py found: YES
Program check-symbols.sh found: YES
Program options-ibverbs-static.sh found: YES
Program binutils-avx512-check.sh found: YES
Program python3 found: YES (/usr/bin/python3)
Program cat found: YES
Program ../buildtools/symlink-drivers-solibs.sh found: YES (/bin/sh
/root/dpdk/config/../buildtools/symlink-drivers-solibs.sh)
Checking for size of "void *" : 8
Library m found: YES
Library numa found: NO
Library libfdt found: NO
Found pkg-config: /usr/bin/pkg-config (1.6.3)
Found CMake: /usr/bin/cmake (3.17.4)
Run-time dependency libbsd found: NO (tried pkgconfig and cmake)
pcap-config found: YES (/usr/bin/pcap-config)

config/meson.build:166:0: ERROR: Could not get return value of
pcap_lib_version()

A full log can be found at /root/dpdk/build/meson-logs/meson-log.txt


# cat /root/dpdk/build/meson-logs/meson-log.txt
[...]
Determining dependency 'libpcap' with pkg-config executable
'/usr/bin/pkg-config'
PKG_CONFIG_PATH:
Called `/usr/bin/pkg-config --modversion libpcap` -> 1

pcap-config binary missing from cross or native file, or env var undefined.
Trying a default pcap-config fallback at pcap-config
pcap-config found: YES (/usr/bin/pcap-config)
None of 'CC_LD' are defined in the environment, not changing global flags.
Running compile:
Working directory:  /root/dpdk/build/meson-private/tmp15ks2yx6
Command line:  cc
/root/dpdk/build/meson-private/tmp15ks2yx6/testfile.c -o
/root/dpdk/build/meson-private/tmp15ks2yx6/output.exe -pipe
-D_FILE_OFFSET_BITS=64 -O0 -Wl,--start-group -lpcap -Wl,--end-group

Code:
 #include <pcap.h>
        #include <stdio.h>
        int main(void) {
            printf ("%s", (char*) pcap_lib_version());
            return 0;
        }
Compiler stdout:

Compiler stderr:
 /usr/bin/ld: skipping incompatible
/usr/lib/gcc/x86_64-redhat-linux/10/../../../libpcap.so when searching
for -lpcap
/usr/bin/ld: skipping incompatible /lib/libpcap.so when searching for -lpcap
/usr/bin/ld: skipping incompatible /usr/lib/libpcap.so when searching for -lpcap
/usr/bin/ld: cannot find -lpcap
collect2: error: ld returned 1 exit status

Could not compile test file
/root/dpdk/build/meson-private/tmp15ks2yx6/testfile.c: 1


config/meson.build:166:0: ERROR: Could not get return value of
pcap_lib_version()



-- 
David Marchand


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [dpdk-dev] [PATCH v2] build: skip detecting libpcap via pcap-config
  2020-10-12 12:02   ` David Marchand
@ 2020-10-12 12:47     ` Bruce Richardson
  0 siblings, 0 replies; 12+ messages in thread
From: Bruce Richardson @ 2020-10-12 12:47 UTC (permalink / raw)
  To: David Marchand; +Cc: dev, Luca Boccassi

On Mon, Oct 12, 2020 at 02:02:19PM +0200, David Marchand wrote:
> On Fri, Oct 9, 2020 at 4:19 PM Bruce Richardson
> <bruce.richardson@intel.com> wrote:
> >
> > When compiling for a slightly different architecture, e.g. 32-bit on 64-bit
> > systems using CFLAGS rather than a cross-file, the pcap-config utility can
> > often return parameters that are unusable for the build in question, i.e.
> > providing the native 64-bit library paths rather than checking for 32-bit
> > equivalent.
> >
> > Since many distros now include a version of libpcap with a
> > pkg-config file, and for those that don't find-library should work ok as a
> > fallback, we can explicitly just use pkg-config in the dependency search,
> > causing meson to skip trying to use pcap-config.
> >
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> 
> I also hit (this?) issue on a fc32 with both 32-bit and 64-bit pcap installed.
> Can you confirm?
> 

It looks to be the same general issue. Does adding this patch fix things?
When compiling 32-bit on 64-bit you generally need to be sure to set
PKG_CONFIG_LIBDIR in your environment to point to the appropriate path. It
might also serve to fix things in this instance, if not set.

> If so, we might want to backport this as I get the same problem with v19.11.4.
> 

Good idea, I don't think it will break anything.

/Bruce

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [dpdk-dev] [PATCH v2] build: skip detecting libpcap via pcap-config
  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 12:02   ` David Marchand
@ 2020-10-12 12:48   ` Bruce Richardson
  2 siblings, 0 replies; 12+ messages in thread
From: Bruce Richardson @ 2020-10-12 12:48 UTC (permalink / raw)
  To: dev; +Cc: bluca, stable

+CC stable for consideration

On Fri, Oct 09, 2020 at 03:19:14PM +0100, Bruce Richardson wrote:
> When compiling for a slightly different architecture, e.g. 32-bit on 64-bit
> systems using CFLAGS rather than a cross-file, the pcap-config utility can
> often return parameters that are unusable for the build in question, i.e.
> providing the native 64-bit library paths rather than checking for 32-bit
> equivalent.
> 
> Since many distros now include a version of libpcap with a
> pkg-config file, and for those that don't find-library should work ok as a
> fallback, we can explicitly just use pkg-config in the dependency search,
> causing meson to skip trying to use pcap-config.
> 

CC: stable@dpdk.org

> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
>  config/meson.build | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/config/meson.build b/config/meson.build
> index 69f2aeb60..9fb903c9b 100644
> --- a/config/meson.build
> +++ b/config/meson.build
> @@ -163,11 +163,9 @@ 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 = 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
>  if pcap_dep.found() and cc.has_header('pcap.h', dependencies: pcap_dep)
> -- 
> 2.25.1
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [dpdk-dev] [PATCH v2] build: skip detecting libpcap via pcap-config
  2020-10-09 14:54   ` Luca Boccassi
@ 2020-10-12 15:12     ` David Marchand
  0 siblings, 0 replies; 12+ messages in thread
From: David Marchand @ 2020-10-12 15:12 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev, Luca Boccassi, dpdk stable

On Fri, Oct 9, 2020 at 4:54 PM Luca Boccassi <bluca@debian.org> wrote:
>
> On Fri, 2020-10-09 at 15:19 +0100, Bruce Richardson wrote:
> > When compiling for a slightly different architecture, e.g. 32-bit on 64-bit
> > systems using CFLAGS rather than a cross-file, the pcap-config utility can
> > often return parameters that are unusable for the build in question, i.e.
> > providing the native 64-bit library paths rather than checking for 32-bit
> > equivalent.
> >
> > Since many distros now include a version of libpcap with a
> > pkg-config file, and for those that don't find-library should work ok as a
> > fallback, we can explicitly just use pkg-config in the dependency search,
> > causing meson to skip trying to use pcap-config.
> >

CC: stable@dpdk.org

> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> Reviewed-by: Luca Boccassi <bluca@debian.org>
Tested-by: David Marchand <david.marchand@redhat.com>


Applied, thanks.

-- 
David Marchand


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-10-12 15:12 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-08 17:05 [dpdk-dev] [RFC PATCH] build: use libpcap only from pkg-config 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
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

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).