<div dir="auto">Not sure. Working around busted packages in DPDK is a bad idea.</div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Wed, Jul 8, 2026, 08:38 Maayan Kashani <<a href="mailto:mkashani@nvidia.com">mkashani@nvidia.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi, Bruce, <br>
we encountered DPDK build issue on Tencent 4.6.<br>
It is not expected; the package/image appears corrupted. <br>
RPM verification confirms the headers differ from the packaged contents. <br>
The DPDK change is still valid because optional dependency detection should <br>
test for usable declarations, not just file existence and library presence.”<br>
<br>
Regards,<br>
Maayan Kashani<br>
<br>
> -----Original Message-----<br>
> From: Bruce Richardson <<a href="mailto:bruce.richardson@intel.com" target="_blank" rel="noreferrer">bruce.richardson@intel.com</a>><br>
> Sent: Tuesday, 7 July 2026 17:16<br>
> To: Maayan Kashani <<a href="mailto:mkashani@nvidia.com" target="_blank" rel="noreferrer">mkashani@nvidia.com</a>><br>
> Cc: <a href="mailto:dev@dpdk.org" target="_blank" rel="noreferrer">dev@dpdk.org</a>; Raslan Darawsheh <<a href="mailto:rasland@nvidia.com" target="_blank" rel="noreferrer">rasland@nvidia.com</a>>;<br>
> <a href="mailto:stable@dpdk.org" target="_blank" rel="noreferrer">stable@dpdk.org</a>; David Marchand <<a href="mailto:david.marchand@redhat.com" target="_blank" rel="noreferrer">david.marchand@redhat.com</a>>; Stephen<br>
> Hemminger <<a href="mailto:stephen@networkplumber.org" target="_blank" rel="noreferrer">stephen@networkplumber.org</a>><br>
> Subject: Re: [PATCH] build: fix libpcap detection with unusable header<br>
> <br>
> External email: Use caution opening links or attachments<br>
> <br>
> <br>
> On Tue, Jul 07, 2026 at 04:30:28PM +0300, Maayan Kashani wrote:<br>
> > The libpcap detection only checked that the library was present, that<br>
> > <pcap.h> could be included, and that a trivial program links. None of<br>
> > these fail when a distribution ships a libpcap-devel package whose<br>
> > <pcap.h> is empty (present but declaring nothing) while libpcap.so is<br>
> > installed: has_header() passes on an empty file and the link test does<br>
> > not reference any pcap symbol. RTE_HAS_LIBPCAP was then set and the<br>
> > pcap-dependent code (bpf_convert.c, port source/sink, dumpcap) failed<br>
> > to build with errors such as:<br>
> ><br>
> <br>
> Why would a distribution ship a devel package with an empty header file for<br>
> pcap.h? Is that expected behaviour in some scenario that I'm unaware of,<br>
> because it seems strange to me?<br>
> <br>
> /Bruce<br>
> <br>
> >   bpf_convert.c: error: invalid use of undefined type<br>
> >                  'const struct bpf_insn'<br>
> ><br>
> > Require an actual pcap declaration (pcap_create) to be visible in the<br>
> > header before enabling libpcap support, so a broken or empty header<br>
> > disables the optional pcap features instead of breaking the build.<br>
> ><br>
> > Fixes: d6024c0a6757 ("build: cleanup libpcap dependent components")<br>
> > Cc: <a href="mailto:stable@dpdk.org" target="_blank" rel="noreferrer">stable@dpdk.org</a><br>
> ><br>
> > Signed-off-by: Maayan Kashani <<a href="mailto:mkashani@nvidia.com" target="_blank" rel="noreferrer">mkashani@nvidia.com</a>><br>
> > ---<br>
> >  config/meson.build | 5 ++++-<br>
> >  1 file changed, 4 insertions(+), 1 deletion(-)<br>
> ><br>
> > diff --git a/config/meson.build b/config/meson.build index<br>
> > d7f5e55c18f..4bfb8535781 100644<br>
> > --- a/config/meson.build<br>
> > +++ b/config/meson.build<br>
> > @@ -290,7 +290,10 @@ if not pcap_dep.found()<br>
> >      # pcap got a pkg-config file only in 1.9.0<br>
> >      pcap_dep = cc.find_library(pcap_lib, required: false)  endif -if<br>
> > (pcap_dep.found() and cc.has_header('pcap.h', dependencies: pcap_dep)<br>
> > +# has_header() passes even when pcap.h is empty; require a real<br>
> declaration.<br>
> > +if (pcap_dep.found()<br>
> > +        and cc.has_header_symbol('pcap.h', 'pcap_create', dependencies:<br>
> pcap_dep,<br>
> > +                args: '-D_GNU_SOURCE')<br>
> >          and cc.links(min_c_code, dependencies: pcap_dep))<br>
> >      dpdk_conf.set('RTE_HAS_LIBPCAP', 1)<br>
> >      dpdk_extra_ldflags += '-l@0@'.format(pcap_lib)<br>
> > --<br>
> > 2.21.0<br>
> ><br>
</blockquote></div>