DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: thomas@monjalon.net, bluca@debian.org, david.marchand@redhat.com,
	ktraynor@redhat.com,
	Bruce Richardson <bruce.richardson@intel.com>
Subject: [dpdk-dev] [PATCH 1/7] build: always link-whole DPDK static libraries
Date: Wed, 29 Apr 2020 11:08:25 +0100	[thread overview]
Message-ID: <20200429100831.398-2-bruce.richardson@intel.com> (raw)
In-Reply-To: <20200429100831.398-1-bruce.richardson@intel.com>

To ensure all constructors are included in static build, we need to pass
the --whole-archive flag when linking, which is used with the
"link_whole" meson option. Since we use link_whole for all libs, we no
longer need to track the lib as part of the static dependency, just the
path to the headers for compiling.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 app/test/meson.build | 2 +-
 drivers/meson.build  | 2 +-
 examples/meson.build | 6 +++---
 lib/meson.build      | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/app/test/meson.build b/app/test/meson.build
index fc60acbe7..5f2c803d6 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -400,7 +400,7 @@ test_dep_objs += cc.find_library('execinfo', required: false)
 
 link_libs = []
 if get_option('default_library') == 'static'
-	link_libs = dpdk_drivers
+	link_libs = dpdk_static_libraries + dpdk_drivers
 endif
 
 dpdk_test = executable('dpdk-test',
diff --git a/drivers/meson.build b/drivers/meson.build
index dc293b270..53c2ff0f3 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -196,7 +196,7 @@ foreach class:dpdk_driver_classes
 			shared_dep = declare_dependency(link_with: shared_lib,
 					include_directories: includes,
 					dependencies: shared_deps)
-			static_dep = declare_dependency(link_with: static_lib,
+			static_dep = declare_dependency(
 					include_directories: includes,
 					dependencies: static_deps)
 
diff --git a/examples/meson.build b/examples/meson.build
index 1f2b6f516..ec6bd5a08 100644
--- a/examples/meson.build
+++ b/examples/meson.build
@@ -1,9 +1,9 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017-2019 Intel Corporation
 
-driver_libs = []
+link_whole_libs = []
 if get_option('default_library') == 'static'
-	driver_libs = dpdk_drivers
+	link_whole_libs = dpdk_static_libraries + dpdk_drivers
 endif
 
 execinfo = cc.find_library('execinfo', required: false)
@@ -99,7 +99,7 @@ foreach example: examples
 		endif
 		executable('dpdk-' + name, sources,
 			include_directories: includes,
-			link_whole: driver_libs,
+			link_whole: link_whole_libs,
 			link_args: dpdk_extra_ldflags,
 			c_args: cflags,
 			dependencies: dep_objs)
diff --git a/lib/meson.build b/lib/meson.build
index 07a65a625..44b850033 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -128,7 +128,7 @@ foreach l:libraries
 					dependencies: static_deps,
 					include_directories: includes,
 					install: true)
-			static_dep = declare_dependency(link_with: static_lib,
+			static_dep = declare_dependency(
 					include_directories: includes,
 					dependencies: static_deps)
 
-- 
2.20.1


  reply	other threads:[~2020-04-29 10:13 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-29 10:08 [dpdk-dev] [PATCH 0/7] improve DPDK static builds with meson Bruce Richardson
2020-04-29 10:08 ` Bruce Richardson [this message]
2020-04-29 10:18   ` [dpdk-dev] [PATCH 1/7] build: always link-whole DPDK static libraries Thomas Monjalon
2020-04-29 10:42     ` Bruce Richardson
2020-04-29 10:49       ` Thomas Monjalon
2020-04-29 14:04   ` Andrzej Ostruszka [C]
2020-04-29 10:08 ` [dpdk-dev] [PATCH 2/7] build: remove unnecessary variable Bruce Richardson
2020-04-29 10:19   ` Thomas Monjalon
2020-04-29 10:29     ` Bruce Richardson
2020-04-29 10:08 ` [dpdk-dev] [PATCH 3/7] devtools/test-meson-builds.sh: add pkg-config static builds Bruce Richardson
2020-04-29 10:08 ` [dpdk-dev] [PATCH 4/7] build: move pkg-config creation to separate file Bruce Richardson
2020-04-29 10:08 ` [dpdk-dev] [PATCH 5/7] build/pkg-config: output driver libs first for static build Bruce Richardson
2020-04-29 10:30   ` Thomas Monjalon
2020-04-29 10:54     ` Bruce Richardson
2020-04-29 10:40   ` Luca Boccassi
2020-04-29 11:03     ` Bruce Richardson
2020-04-29 11:12       ` Luca Boccassi
2020-04-29 10:08 ` [dpdk-dev] [PATCH 6/7] build/pkg-config: improve static linking flags Bruce Richardson
2020-04-29 10:32   ` Thomas Monjalon
2020-04-29 10:56     ` Bruce Richardson
2020-04-29 10:57       ` Thomas Monjalon
2020-04-29 10:37   ` Luca Boccassi
2020-04-29 10:58     ` Bruce Richardson
2020-04-29 11:10       ` Luca Boccassi
2020-04-29 10:08 ` [dpdk-dev] [PATCH 7/7] build/pkg-config: prevent overlinking Bruce Richardson
2020-04-29 10:34   ` Thomas Monjalon
2020-04-29 11:00     ` Bruce Richardson
2020-05-01 13:53 ` [dpdk-dev] [PATCH v2 0/7] improve DPDK static builds with meson Bruce Richardson
2020-05-01 13:53   ` [dpdk-dev] [PATCH v2 1/7] build: always link-whole DPDK static libraries Bruce Richardson
2020-05-01 13:53   ` [dpdk-dev] [PATCH v2 2/7] build: remove unnecessary variable Bruce Richardson
2020-05-01 13:53   ` [dpdk-dev] [PATCH v2 3/7] devtools/test-meson-builds.sh: add pkg-config static builds Bruce Richardson
2020-05-01 13:53   ` [dpdk-dev] [PATCH v2 4/7] build: move pkg-config creation to separate file Bruce Richardson
2020-05-01 13:53   ` [dpdk-dev] [PATCH v2 5/7] build/pkg-config: output driver libs first for static build Bruce Richardson
2020-05-01 13:54   ` [dpdk-dev] [PATCH v2 6/7] build/pkg-config: improve static linking flags Bruce Richardson
2020-05-01 13:54   ` [dpdk-dev] [PATCH v2 7/7] build/pkg-config: prevent overlinking Bruce Richardson
2020-05-01 14:02   ` [dpdk-dev] [PATCH v2 0/7] improve DPDK static builds with meson Luca Boccassi
2020-06-30 13:25   ` Pai G, Sunil
2020-06-30 16:37     ` Stokes, Ian
2020-07-01 17:29       ` Thomas Monjalon
2020-07-02 10:46         ` Stokes, Ian
2020-06-30 14:14 ` [dpdk-dev] [PATCH v3 " Bruce Richardson
2020-06-30 14:14   ` [dpdk-dev] [PATCH v3 1/7] build: always link-whole DPDK static libraries Bruce Richardson
2020-07-01 14:19     ` Thomas Monjalon
2020-06-30 14:14   ` [dpdk-dev] [PATCH v3 2/7] build: remove unnecessary variable Bruce Richardson
2020-06-30 14:14   ` [dpdk-dev] [PATCH v3 3/7] devtools/test-meson-builds.sh: add pkg-config static builds Bruce Richardson
2020-06-30 14:14   ` [dpdk-dev] [PATCH v3 4/7] build: move pkg-config creation to separate file Bruce Richardson
2020-06-30 14:14   ` [dpdk-dev] [PATCH v3 5/7] build/pkg-config: output driver libs first for static build Bruce Richardson
2020-07-01  7:50     ` Thomas Monjalon
2020-07-01  8:43       ` Bruce Richardson
2020-07-01 14:42     ` Thomas Monjalon
2020-07-01 15:16       ` Bruce Richardson
2020-07-01 15:36         ` Thomas Monjalon
2020-07-01 15:45           ` Bruce Richardson
2020-07-01 16:04             ` Thomas Monjalon
2020-06-30 14:14   ` [dpdk-dev] [PATCH v3 6/7] build/pkg-config: improve static linking flags Bruce Richardson
2020-07-01 14:30     ` Thomas Monjalon
2020-07-01 14:33       ` Thomas Monjalon
2020-07-01 14:36         ` Bruce Richardson
2020-07-01 14:45           ` Thomas Monjalon
2020-06-30 14:14   ` [dpdk-dev] [PATCH v3 7/7] build/pkg-config: prevent overlinking Bruce Richardson
2020-07-01  7:56     ` Thomas Monjalon
2020-07-01  8:58       ` Bruce Richardson
2020-07-01 17:33   ` [dpdk-dev] [PATCH v3 0/7] improve DPDK static builds with meson Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200429100831.398-2-bruce.richardson@intel.com \
    --to=bruce.richardson@intel.com \
    --cc=bluca@debian.org \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=ktraynor@redhat.com \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).