* [PATCH dpdk 0/2] Fix dynamic link of driver symbols with pkgconf
@ 2026-10-15 10:09 Robin Jarry
2026-10-15 10:09 ` [PATCH dpdk 1/2] meson: rename static drivers list Robin Jarry
` (3 more replies)
0 siblings, 4 replies; 14+ messages in thread
From: Robin Jarry @ 2026-10-15 10:09 UTC (permalink / raw)
To: dev
When building against dynamic libraries using pkg-config, linking fails
because symbols exposed by drivers are not found:
/usr/bin/x86_64-linux-gnu-ld.bfd: ....o:(.data.rel.ro+0x148):
undefined reference to `rte_pci_dump'
That symbol is in librte_bus_pci.so which is *not* listed in the libs
section of the pkg-config file.
This series is about fixing this.
Robin Jarry (2):
meson: rename static drivers list
meson: add drivers to dynamic libraries
app/meson.build | 2 +-
buildtools/pkg-config/meson.build | 2 +-
buildtools/subproject/meson.build | 2 +-
drivers/meson.build | 5 ++++-
examples/meson.build | 2 +-
meson.build | 2 +-
6 files changed, 9 insertions(+), 6 deletions(-)
--
2.56.0
^ permalink raw reply [flat|nested] 14+ messages in thread* [PATCH dpdk 1/2] meson: rename static drivers list 2026-10-15 10:09 [PATCH dpdk 0/2] Fix dynamic link of driver symbols with pkgconf Robin Jarry @ 2026-10-15 10:09 ` Robin Jarry 2026-10-15 10:36 ` Bruce Richardson 2026-10-15 10:09 ` [PATCH dpdk 2/2] meson: add drivers to dynamic libraries Robin Jarry ` (2 subsequent siblings) 3 siblings, 1 reply; 14+ messages in thread From: Robin Jarry @ 2026-10-15 10:09 UTC (permalink / raw) To: dev, Bruce Richardson This list contains a list of *static* driver libraries. Reflect that in its name. Signed-off-by: Robin Jarry <rjarry@redhat.com> --- app/meson.build | 2 +- buildtools/pkg-config/meson.build | 2 +- buildtools/subproject/meson.build | 2 +- drivers/meson.build | 2 +- examples/meson.build | 2 +- meson.build | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/meson.build b/app/meson.build index 451568847132..f4c3f5a5ccd5 100644 --- a/app/meson.build +++ b/app/meson.build @@ -107,7 +107,7 @@ foreach app:apps dpdk_apps_enabled += app link_libs = [] if get_option('default_library') == 'static' - link_libs = dpdk_static_libraries + dpdk_drivers + link_libs = dpdk_static_libraries + dpdk_static_drivers endif exec = executable('dpdk-' + name, diff --git a/buildtools/pkg-config/meson.build b/buildtools/pkg-config/meson.build index a0a265ad92c7..14ea3097c461 100644 --- a/buildtools/pkg-config/meson.build +++ b/buildtools/pkg-config/meson.build @@ -49,7 +49,7 @@ Note that CFLAGS might contain an -march flag higher than typical baseline. This is required for a number of static inline functions in the public headers.''', requires: ['libdpdk-libs'], libraries_private: ['-Wl,--whole-archive'] + - dpdk_drivers + dpdk_static_libraries + + dpdk_static_drivers + dpdk_static_libraries + ['-Wl,--no-whole-archive'] + platform_flags ) diff --git a/buildtools/subproject/meson.build b/buildtools/subproject/meson.build index 8ae081e1698a..57022f07be7c 100644 --- a/buildtools/subproject/meson.build +++ b/buildtools/subproject/meson.build @@ -13,7 +13,7 @@ if get_option('default_library') == 'static' compile_args: subproject_cflags, # static library deps in DPDK build don't include "link_with" parameters, # so explicitly link-in both libs and drivers - link_whole: dpdk_static_libraries + dpdk_drivers, + link_whole: dpdk_static_libraries + dpdk_static_drivers, link_args: dpdk_extra_ldflags) else dpdk_dep = declare_dependency( diff --git a/drivers/meson.build b/drivers/meson.build index 102a8262e588..7146f036c4c9 100644 --- a/drivers/meson.build +++ b/drivers/meson.build @@ -404,7 +404,7 @@ foreach subpath:subdirs include_directories: includes, dependencies: static_deps) - dpdk_drivers += static_lib + dpdk_static_drivers += static_lib set_variable('shared_@0@'.format(lib_name), shared_dep) set_variable('static_@0@'.format(lib_name), static_dep) diff --git a/examples/meson.build b/examples/meson.build index 544ec5eadd82..4c142a010d48 100644 --- a/examples/meson.build +++ b/examples/meson.build @@ -3,7 +3,7 @@ link_whole_libs = [] if get_option('default_library') == 'static' - link_whole_libs = dpdk_static_libraries + dpdk_drivers + link_whole_libs = dpdk_static_libraries + dpdk_static_drivers endif # list of all example apps. Keep 1-3 per line, in alphabetical order. diff --git a/meson.build b/meson.build index 6b8cfa8b2e90..554ba33e9c66 100644 --- a/meson.build +++ b/meson.build @@ -44,7 +44,7 @@ dpdk_headers = [] dpdk_indirect_headers = [] dpdk_drivers_headers = [] dpdk_driver_classes = [] -dpdk_drivers = [] +dpdk_static_drivers = [] dpdk_extra_ldflags = [] dpdk_libs_deprecated = [] dpdk_apps_disabled = [] -- 2.56.0 ^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH dpdk 1/2] meson: rename static drivers list 2026-10-15 10:09 ` [PATCH dpdk 1/2] meson: rename static drivers list Robin Jarry @ 2026-10-15 10:36 ` Bruce Richardson 0 siblings, 0 replies; 14+ messages in thread From: Bruce Richardson @ 2026-10-15 10:36 UTC (permalink / raw) To: Robin Jarry; +Cc: dev On Thu, Oct 15, 2026 at 12:09:23PM +0200, Robin Jarry wrote: > This list contains a list of *static* driver libraries. Reflect that in > its name. > > Signed-off-by: Robin Jarry <rjarry@redhat.com> > --- > app/meson.build | 2 +- > buildtools/pkg-config/meson.build | 2 +- > buildtools/subproject/meson.build | 2 +- > drivers/meson.build | 2 +- > examples/meson.build | 2 +- > meson.build | 2 +- > 6 files changed, 6 insertions(+), 6 deletions(-) Acked-by: Bruce Richardson <bruce.richardson@intel.com> ^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH dpdk 2/2] meson: add drivers to dynamic libraries 2026-10-15 10:09 [PATCH dpdk 0/2] Fix dynamic link of driver symbols with pkgconf Robin Jarry 2026-10-15 10:09 ` [PATCH dpdk 1/2] meson: rename static drivers list Robin Jarry @ 2026-10-15 10:09 ` Robin Jarry 2026-10-15 10:40 ` Bruce Richardson 2026-10-15 10:41 ` [PATCH dpdk 0/2] Fix dynamic link of driver symbols with pkgconf Bruce Richardson 2026-10-15 11:26 ` [PATCH dpdk v2 " Robin Jarry 3 siblings, 1 reply; 14+ messages in thread From: Robin Jarry @ 2026-10-15 10:09 UTC (permalink / raw) To: dev dpdk_shared_lib_deps only collects library dependencies, so DPDK built as a meson subproject with shared libraries never links against drivers that install public headers (e.g. bus/pci, bus/vdev). Add these drivers to dpdk_shared_lib_deps as well, mirroring what is already done for libraries in lib/meson.build. Signed-off-by: Robin Jarry <rjarry@redhat.com> --- drivers/meson.build | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/meson.build b/drivers/meson.build index 7146f036c4c9..37b152979109 100644 --- a/drivers/meson.build +++ b/drivers/meson.build @@ -405,6 +405,9 @@ foreach subpath:subdirs dependencies: static_deps) dpdk_static_drivers += static_lib + if headers.length() > 0 + dpdk_shared_lib_deps += shared_dep + endif set_variable('shared_@0@'.format(lib_name), shared_dep) set_variable('static_@0@'.format(lib_name), static_dep) -- 2.56.0 ^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH dpdk 2/2] meson: add drivers to dynamic libraries 2026-10-15 10:09 ` [PATCH dpdk 2/2] meson: add drivers to dynamic libraries Robin Jarry @ 2026-10-15 10:40 ` Bruce Richardson 0 siblings, 0 replies; 14+ messages in thread From: Bruce Richardson @ 2026-10-15 10:40 UTC (permalink / raw) To: Robin Jarry; +Cc: dev On Thu, Oct 15, 2026 at 12:09:24PM +0200, Robin Jarry wrote: > dpdk_shared_lib_deps only collects library dependencies, so DPDK built > as a meson subproject with shared libraries never links against > drivers that install public headers (e.g. bus/pci, bus/vdev). Add > these drivers to dpdk_shared_lib_deps as well, mirroring what is > already done for libraries in lib/meson.build. > > Signed-off-by: Robin Jarry <rjarry@redhat.com> > --- > drivers/meson.build | 3 +++ > 1 file changed, 3 insertions(+) > Acked-by: Bruce Richardson <bruce.richardson@intel.com> > diff --git a/drivers/meson.build b/drivers/meson.build > index 7146f036c4c9..37b152979109 100644 > --- a/drivers/meson.build > +++ b/drivers/meson.build > @@ -405,6 +405,9 @@ foreach subpath:subdirs > dependencies: static_deps) > > dpdk_static_drivers += static_lib > + if headers.length() > 0 > + dpdk_shared_lib_deps += shared_dep > + endif > > set_variable('shared_@0@'.format(lib_name), shared_dep) > set_variable('static_@0@'.format(lib_name), static_dep) > -- > 2.56.0 > ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH dpdk 0/2] Fix dynamic link of driver symbols with pkgconf 2026-10-15 10:09 [PATCH dpdk 0/2] Fix dynamic link of driver symbols with pkgconf Robin Jarry 2026-10-15 10:09 ` [PATCH dpdk 1/2] meson: rename static drivers list Robin Jarry 2026-10-15 10:09 ` [PATCH dpdk 2/2] meson: add drivers to dynamic libraries Robin Jarry @ 2026-10-15 10:41 ` Bruce Richardson 2026-10-15 11:27 ` Robin Jarry 2026-10-15 11:26 ` [PATCH dpdk v2 " Robin Jarry 3 siblings, 1 reply; 14+ messages in thread From: Bruce Richardson @ 2026-10-15 10:41 UTC (permalink / raw) To: Robin Jarry; +Cc: dev On Thu, Oct 15, 2026 at 12:09:22PM +0200, Robin Jarry wrote: > When building against dynamic libraries using pkg-config, linking fails > because symbols exposed by drivers are not found: > > /usr/bin/x86_64-linux-gnu-ld.bfd: ....o:(.data.rel.ro+0x148): > undefined reference to `rte_pci_dump' > > That symbol is in librte_bus_pci.so which is *not* listed in the libs > section of the pkg-config file. > > This series is about fixing this. > While the changes in the two patches are ok, I don't see how they affect pkg-config. The first patch just renames a variable for clarity, and the second only affects applications linking using a meson subproject rather than a .pc file. /Bruce ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH dpdk 0/2] Fix dynamic link of driver symbols with pkgconf 2026-10-15 10:41 ` [PATCH dpdk 0/2] Fix dynamic link of driver symbols with pkgconf Bruce Richardson @ 2026-10-15 11:27 ` Robin Jarry 0 siblings, 0 replies; 14+ messages in thread From: Robin Jarry @ 2026-10-15 11:27 UTC (permalink / raw) To: Bruce Richardson; +Cc: dev Bruce Richardson, Oct 15, 2026 at 12:41: > While the changes in the two patches are ok, I don't see how they affect > pkg-config. The first patch just renames a variable for clarity, and the > second only affects applications linking using a meson subproject rather > than a .pc file. Indeed, I had forgotten about updating the correct variable. v2 should be good. -- Robin # To order, call toll-free. ^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH dpdk v2 0/2] Fix dynamic link of driver symbols with pkgconf 2026-10-15 10:09 [PATCH dpdk 0/2] Fix dynamic link of driver symbols with pkgconf Robin Jarry ` (2 preceding siblings ...) 2026-10-15 10:41 ` [PATCH dpdk 0/2] Fix dynamic link of driver symbols with pkgconf Bruce Richardson @ 2026-10-15 11:26 ` Robin Jarry 2026-10-15 11:26 ` [PATCH dpdk v2 1/2] meson: rename static drivers list Robin Jarry 2026-10-15 11:26 ` [PATCH dpdk v2 2/2] meson: add drivers to dynamic libraries Robin Jarry 3 siblings, 2 replies; 14+ messages in thread From: Robin Jarry @ 2026-10-15 11:26 UTC (permalink / raw) To: dev When building against dynamic libraries using pkg-config, linking fails because symbols exposed by drivers are not found: /usr/bin/x86_64-linux-gnu-ld.bfd: ....o:(.data.rel.ro+0x148): undefined reference to `rte_pci_dump' That symbol is in librte_bus_pci.so which is *not* listed in the libs section of the pkg-config file. This series is about fixing this. v2: Added missing update to dpdk_libraries for pkg-config Robin Jarry (2): meson: rename static drivers list meson: add drivers to dynamic libraries app/meson.build | 2 +- buildtools/pkg-config/meson.build | 2 +- buildtools/subproject/meson.build | 2 +- drivers/meson.build | 6 +++++- examples/meson.build | 2 +- meson.build | 2 +- 6 files changed, 10 insertions(+), 6 deletions(-) -- 2.56.0 ^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH dpdk v2 1/2] meson: rename static drivers list 2026-10-15 11:26 ` [PATCH dpdk v2 " Robin Jarry @ 2026-10-15 11:26 ` Robin Jarry 2026-10-15 11:26 ` [PATCH dpdk v2 2/2] meson: add drivers to dynamic libraries Robin Jarry 1 sibling, 0 replies; 14+ messages in thread From: Robin Jarry @ 2026-10-15 11:26 UTC (permalink / raw) To: dev, Bruce Richardson This list contains a list of *static* driver libraries. Reflect that in its name. Signed-off-by: Robin Jarry <rjarry@redhat.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com> --- app/meson.build | 2 +- buildtools/pkg-config/meson.build | 2 +- buildtools/subproject/meson.build | 2 +- drivers/meson.build | 2 +- examples/meson.build | 2 +- meson.build | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/meson.build b/app/meson.build index 451568847132..f4c3f5a5ccd5 100644 --- a/app/meson.build +++ b/app/meson.build @@ -107,7 +107,7 @@ foreach app:apps dpdk_apps_enabled += app link_libs = [] if get_option('default_library') == 'static' - link_libs = dpdk_static_libraries + dpdk_drivers + link_libs = dpdk_static_libraries + dpdk_static_drivers endif exec = executable('dpdk-' + name, diff --git a/buildtools/pkg-config/meson.build b/buildtools/pkg-config/meson.build index a0a265ad92c7..14ea3097c461 100644 --- a/buildtools/pkg-config/meson.build +++ b/buildtools/pkg-config/meson.build @@ -49,7 +49,7 @@ Note that CFLAGS might contain an -march flag higher than typical baseline. This is required for a number of static inline functions in the public headers.''', requires: ['libdpdk-libs'], libraries_private: ['-Wl,--whole-archive'] + - dpdk_drivers + dpdk_static_libraries + + dpdk_static_drivers + dpdk_static_libraries + ['-Wl,--no-whole-archive'] + platform_flags ) diff --git a/buildtools/subproject/meson.build b/buildtools/subproject/meson.build index 8ae081e1698a..57022f07be7c 100644 --- a/buildtools/subproject/meson.build +++ b/buildtools/subproject/meson.build @@ -13,7 +13,7 @@ if get_option('default_library') == 'static' compile_args: subproject_cflags, # static library deps in DPDK build don't include "link_with" parameters, # so explicitly link-in both libs and drivers - link_whole: dpdk_static_libraries + dpdk_drivers, + link_whole: dpdk_static_libraries + dpdk_static_drivers, link_args: dpdk_extra_ldflags) else dpdk_dep = declare_dependency( diff --git a/drivers/meson.build b/drivers/meson.build index 102a8262e588..7146f036c4c9 100644 --- a/drivers/meson.build +++ b/drivers/meson.build @@ -404,7 +404,7 @@ foreach subpath:subdirs include_directories: includes, dependencies: static_deps) - dpdk_drivers += static_lib + dpdk_static_drivers += static_lib set_variable('shared_@0@'.format(lib_name), shared_dep) set_variable('static_@0@'.format(lib_name), static_dep) diff --git a/examples/meson.build b/examples/meson.build index 544ec5eadd82..4c142a010d48 100644 --- a/examples/meson.build +++ b/examples/meson.build @@ -3,7 +3,7 @@ link_whole_libs = [] if get_option('default_library') == 'static' - link_whole_libs = dpdk_static_libraries + dpdk_drivers + link_whole_libs = dpdk_static_libraries + dpdk_static_drivers endif # list of all example apps. Keep 1-3 per line, in alphabetical order. diff --git a/meson.build b/meson.build index 6b8cfa8b2e90..554ba33e9c66 100644 --- a/meson.build +++ b/meson.build @@ -44,7 +44,7 @@ dpdk_headers = [] dpdk_indirect_headers = [] dpdk_drivers_headers = [] dpdk_driver_classes = [] -dpdk_drivers = [] +dpdk_static_drivers = [] dpdk_extra_ldflags = [] dpdk_libs_deprecated = [] dpdk_apps_disabled = [] -- 2.56.0 ^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH dpdk v2 2/2] meson: add drivers to dynamic libraries 2026-10-15 11:26 ` [PATCH dpdk v2 " Robin Jarry 2026-10-15 11:26 ` [PATCH dpdk v2 1/2] meson: rename static drivers list Robin Jarry @ 2026-10-15 11:26 ` Robin Jarry 2026-10-15 11:52 ` Bruce Richardson 1 sibling, 1 reply; 14+ messages in thread From: Robin Jarry @ 2026-10-15 11:26 UTC (permalink / raw) To: dev; +Cc: Bruce Richardson dpdk_shared_lib_deps only collects library dependencies, so DPDK built as a meson subproject with shared libraries never links against drivers that install public headers (e.g. bus/pci, bus/vdev). Add these drivers to dpdk_shared_lib_deps as well, mirroring what is already done for libraries in lib/meson.build. Signed-off-by: Robin Jarry <rjarry@redhat.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com> --- Notes: v2: added driver shared libs to the list for pkg-config drivers/meson.build | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/meson.build b/drivers/meson.build index 7146f036c4c9..0e8e69798bdf 100644 --- a/drivers/meson.build +++ b/drivers/meson.build @@ -405,6 +405,10 @@ foreach subpath:subdirs dependencies: static_deps) dpdk_static_drivers += static_lib + if headers.length() > 0 + dpdk_libraries += shared_lib + dpdk_shared_lib_deps += shared_dep + endif set_variable('shared_@0@'.format(lib_name), shared_dep) set_variable('static_@0@'.format(lib_name), static_dep) -- 2.56.0 ^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH dpdk v2 2/2] meson: add drivers to dynamic libraries 2026-10-15 11:26 ` [PATCH dpdk v2 2/2] meson: add drivers to dynamic libraries Robin Jarry @ 2026-10-15 11:52 ` Bruce Richardson 2026-10-15 12:06 ` Robin Jarry 0 siblings, 1 reply; 14+ messages in thread From: Bruce Richardson @ 2026-10-15 11:52 UTC (permalink / raw) To: Robin Jarry; +Cc: dev On Thu, Oct 15, 2026 at 01:26:10PM +0200, Robin Jarry wrote: > dpdk_shared_lib_deps only collects library dependencies, so DPDK built > as a meson subproject with shared libraries never links against > drivers that install public headers (e.g. bus/pci, bus/vdev). Add > these drivers to dpdk_shared_lib_deps as well, mirroring what is > already done for libraries in lib/meson.build. > > Signed-off-by: Robin Jarry <rjarry@redhat.com> > Acked-by: Bruce Richardson <bruce.richardson@intel.com> > --- > > Notes: > v2: added driver shared libs to the list for pkg-config > > drivers/meson.build | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/meson.build b/drivers/meson.build > index 7146f036c4c9..0e8e69798bdf 100644 > --- a/drivers/meson.build > +++ b/drivers/meson.build > @@ -405,6 +405,10 @@ foreach subpath:subdirs > dependencies: static_deps) > > dpdk_static_drivers += static_lib > + if headers.length() > 0 > + dpdk_libraries += shared_lib > + dpdk_shared_lib_deps += shared_dep > + endif > 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. /Bruce ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH dpdk v2 2/2] meson: add drivers to dynamic libraries 2026-10-15 11:52 ` Bruce Richardson @ 2026-10-15 12:06 ` Robin Jarry 2026-10-15 12:18 ` Bruce Richardson 0 siblings, 1 reply; 14+ messages in thread From: Robin Jarry @ 2026-10-15 12:06 UTC (permalink / raw) To: Bruce Richardson; +Cc: dev 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. What do you think? -- Robin # Do not try this at home. ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH dpdk v2 2/2] meson: add drivers to dynamic libraries 2026-10-15 12:06 ` Robin Jarry @ 2026-10-15 12:18 ` Bruce Richardson 2026-10-15 14:47 ` Robin Jarry 0 siblings, 1 reply; 14+ messages in thread From: Bruce Richardson @ 2026-10-15 12:18 UTC (permalink / raw) To: Robin Jarry; +Cc: dev 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 ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH dpdk v2 2/2] meson: add drivers to dynamic libraries 2026-10-15 12:18 ` Bruce Richardson @ 2026-10-15 14:47 ` Robin Jarry 0 siblings, 0 replies; 14+ messages in thread From: Robin Jarry @ 2026-10-15 14:47 UTC (permalink / raw) To: Bruce Richardson; +Cc: dev Bruce Richardson, Oct 15, 2026 at 14:18: > 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] Thanks. I will see what I can do. ^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2026-10-15 14:47 UTC | newest] Thread overview: 14+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-10-15 10:09 [PATCH dpdk 0/2] Fix dynamic link of driver symbols with pkgconf Robin Jarry 2026-10-15 10:09 ` [PATCH dpdk 1/2] meson: rename static drivers list Robin Jarry 2026-10-15 10:36 ` Bruce Richardson 2026-10-15 10:09 ` [PATCH dpdk 2/2] meson: add drivers to dynamic libraries Robin Jarry 2026-10-15 10:40 ` Bruce Richardson 2026-10-15 10:41 ` [PATCH dpdk 0/2] Fix dynamic link of driver symbols with pkgconf Bruce Richardson 2026-10-15 11:27 ` Robin Jarry 2026-10-15 11:26 ` [PATCH dpdk v2 " Robin Jarry 2026-10-15 11:26 ` [PATCH dpdk v2 1/2] meson: rename static drivers list Robin Jarry 2026-10-15 11:26 ` [PATCH dpdk v2 2/2] meson: add drivers to dynamic libraries Robin Jarry 2026-10-15 11:52 ` Bruce Richardson 2026-10-15 12:06 ` Robin Jarry 2026-10-15 12:18 ` Bruce Richardson 2026-10-15 14:47 ` Robin Jarry
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.