meson: link static libs with whole-archive in subproject

Message ID 20240129124717.24852-2-rjarry@redhat.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series meson: link static libs with whole-archive in subproject |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-abi-testing success Testing PASS
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-compile-arm64-testing success Testing PASS

Commit Message

Robin Jarry Jan. 29, 2024, 12:47 p.m. UTC
  When DPDK is used as a subproject, declare static libs to be linked with
-Wl,--whole-archive along with the drivers. This is already done this
way in pkg-config.

Fixes: f93a605f2d6e ("build: add definitions for use as Meson subproject")
Cc: stable@dpdk.org

Signed-off-by: Robin Jarry <rjarry@redhat.com>
---
 buildtools/subproject/meson.build | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
  

Comments

David Marchand Jan. 29, 2024, 12:55 p.m. UTC | #1
On Mon, Jan 29, 2024 at 1:47 PM Robin Jarry <rjarry@redhat.com> wrote:
>
> When DPDK is used as a subproject, declare static libs to be linked with
> -Wl,--whole-archive along with the drivers. This is already done this
> way in pkg-config.
>
> Fixes: f93a605f2d6e ("build: add definitions for use as Meson subproject")
> Cc: stable@dpdk.org
>
> Signed-off-by: Robin Jarry <rjarry@redhat.com>
Tested-by: David Marchand <david.marchand@redhat.com>
  
Bruce Richardson Jan. 29, 2024, 1:17 p.m. UTC | #2
On Mon, Jan 29, 2024 at 01:55:36PM +0100, David Marchand wrote:
> On Mon, Jan 29, 2024 at 1:47 PM Robin Jarry <rjarry@redhat.com> wrote:
> >
> > When DPDK is used as a subproject, declare static libs to be linked with
> > -Wl,--whole-archive along with the drivers. This is already done this
> > way in pkg-config.
> >
> > Fixes: f93a605f2d6e ("build: add definitions for use as Meson subproject")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Robin Jarry <rjarry@redhat.com>
> Tested-by: David Marchand <david.marchand@redhat.com>
> 
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
  
Thomas Monjalon Feb. 18, 2024, 5:46 p.m. UTC | #3
29/01/2024 14:17, Bruce Richardson:
> On Mon, Jan 29, 2024 at 01:55:36PM +0100, David Marchand wrote:
> > On Mon, Jan 29, 2024 at 1:47 PM Robin Jarry <rjarry@redhat.com> wrote:
> > >
> > > When DPDK is used as a subproject, declare static libs to be linked with
> > > -Wl,--whole-archive along with the drivers. This is already done this
> > > way in pkg-config.
> > >
> > > Fixes: f93a605f2d6e ("build: add definitions for use as Meson subproject")
> > > Cc: stable@dpdk.org
> > >
> > > Signed-off-by: Robin Jarry <rjarry@redhat.com>
> > Tested-by: David Marchand <david.marchand@redhat.com>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>

Applied, thanks.
  

Patch

diff --git a/buildtools/subproject/meson.build b/buildtools/subproject/meson.build
index 985ce76a9384..aa28f5fae152 100644
--- a/buildtools/subproject/meson.build
+++ b/buildtools/subproject/meson.build
@@ -8,8 +8,7 @@  if get_option('default_library') == 'static'
             dependencies: dpdk_static_lib_deps,
             # static library deps in DPDK build don't include "link_with" parameters,
             # so explicitly link-in both libs and drivers
-            link_with: dpdk_static_libraries,
-            link_whole: dpdk_drivers,
+            link_whole: dpdk_static_libraries + dpdk_drivers,
             link_args: dpdk_extra_ldflags)
 else
     dpdk_dep = declare_dependency(