[PATCH dpdk v2 2/2] meson: add drivers to dynamic libraries

Bruce Richardson bruce.richardson at intel.com
Thu Oct 15 14:18:24 CEST 2026


On Thu, Oct 15, 2026 at 02:06:00PM +0200, Robin Jarry wrote:
> Bruce Richardson, Oct 15, 2026 at 13:52:
> > I think this changes significantly how out pkg-config files are working, vs
> > our original intention, so I think it actually needs more discussion.
> > 
> > As originally designed, when dynamically linking against DPDK the pkg-config
> > --libs libdpdk call was only meant to list out the libraries, with drivers
> > being dynamically loaded at runtime. Since drivers were never meant to have
> > a public API that was generally used, I believe the idea was that anyone
> > using driver-specific APIs was required themselves to pass the driver
> > explicitly to the linker. Otherwise everyone who does not use that driver
> > could end up (depending on their linker flags) with a dependency on that
> > unused driver. This change modifies that assumption and, while it makes it
> > easier for those using driver-specific APIs, it does change how things have
> > worked up till now.
> > 
> > On my system using a default build, this adds 33 drivers to the list of
> > libraries to link against when using pkg-config --libs.
> 
> But since these libraries are preceded by -Wl,--as-needed, only ones
> that expose symbols that your binary uses will be linked. I don't think
> it would change anything in the final result.
> 
> Also, this aligns with what the static build is doing: list all drivers
> as well albeit with -Wl,--whole-archive and *without* -Wl,--as-needed.
> 
Yes, static builds link in everything, and that was always the design since
static builds don't load drivers at runtime, everything has to be linked
into the final object.

Personally, I don't that strongly object to the change because - as you
point out - the as-needed flag should prevent overlinking. If we do this,
I'd suggest making both drivers and libs full lists, rather than
distinguishing between drivers with public headers and those without,
because that should allow us to simplify our package config files. Right
now we have this strange split into two .pc files, as that was the only way
I could find to get correct behaviour for both static and shared builds,
where static included everything and shared was libs only. [IIRC, the
complication was that, when you pass --static to pkg-config, the extra link
args from the pc file get listed *after* the normal libs, while they need to get
listed *before* in order to satisfy the dependencies drivers have on the
libs]

/Bruce


More information about the dev mailing list