[dpdk-stable] patch 'build: fix linker flags on Windows' has been queued to stable release 19.11.7
Christian Ehrhardt
christian.ehrhardt at canonical.com
Thu Feb 4 12:29:43 CET 2021
Hi,
FYI, your patch has been queued to stable release 19.11.7
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/06/21. So please
shout if anyone has objections.
Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.
Queued patches are on a temporary branch at:
https://github.com/cpaelzer/dpdk-stable-queue
This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/4a2baf099901166d83f3cd1ad77223cdec29842b
Thanks.
Christian Ehrhardt <christian.ehrhardt at canonical.com>
---
>From 4a2baf099901166d83f3cd1ad77223cdec29842b Mon Sep 17 00:00:00 2001
From: Dmitry Kozlyuk <dmitry.kozliuk at gmail.com>
Date: Tue, 12 Jan 2021 03:36:02 +0300
Subject: [PATCH] build: fix linker flags on Windows
[ upstream commit da042bcfc6c870fd067329a22e4084c4b2c4be2a ]
The --export-dynamic linker option is only applicable to ELF.
On Windows, where COFF is used, it causes warnings:
x86_64-w64-mingw32-ld: warning: --export-dynamic is not supported
for PE+ targets, did you mean --export-all-symbols? (MinGW)
LINK : warning LNK4044: unrecognized option '/-export-dynamic';
ignored (clang)
Don't add --export-dynamic on Windows anywhere.
Fixes: b031e13d7f0d ("build: fix plugin load on static build")
Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk at gmail.com>
Acked-by: Ranjit Menon <ranjit.menon at intel.com>
---
app/meson.build | 2 +-
buildtools/pkg-config/meson.build | 6 +++++-
examples/meson.build | 2 +-
3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/app/meson.build b/app/meson.build
index 95c0ecae65..c7f689eb79 100644
--- a/app/meson.build
+++ b/app/meson.build
@@ -23,7 +23,7 @@ lib_execinfo = cc.find_library('execinfo', required: false)
default_cflags = machine_args
default_ldflags = []
-if get_option('default_library') == 'static'
+if get_option('default_library') == 'static' and not is_windows
default_ldflags += ['-Wl,--export-dynamic']
endif
diff --git a/buildtools/pkg-config/meson.build b/buildtools/pkg-config/meson.build
index 168ee08e58..39a8fd1c8e 100644
--- a/buildtools/pkg-config/meson.build
+++ b/buildtools/pkg-config/meson.build
@@ -37,6 +37,10 @@ Use libdpdk.pc instead of this file to query DPDK compile/link arguments''',
libraries: ['-Wl,--as-needed'] + dpdk_libraries,
libraries_private: dpdk_extra_ldflags)
+platform_flags = []
+if not is_windows
+ platform_flags += ['-Wl,--export-dynamic'] # ELF only
+endif
pkg.generate(name: 'DPDK', # main DPDK pkgconfig file
filebase: 'libdpdk',
version: meson.project_version(),
@@ -47,7 +51,7 @@ This is required for a number of static inline functions in the public headers.'
# if libbsd is not enabled, then this is blank
libraries_private: ['-Wl,--whole-archive'] +
dpdk_drivers + dpdk_static_libraries +
- ['-Wl,--no-whole-archive', '-Wl,--export-dynamic']
+ ['-Wl,--no-whole-archive'] + platform_flags
)
# For static linking with dependencies as shared libraries,
diff --git a/examples/meson.build b/examples/meson.build
index 25a23dc5da..9e081f3fb7 100644
--- a/examples/meson.build
+++ b/examples/meson.build
@@ -63,7 +63,7 @@ if cc.has_argument('-Wno-format-truncation')
default_cflags += '-Wno-format-truncation'
endif
default_ldflags = dpdk_extra_ldflags
-if get_option('default_library') == 'static'
+if get_option('default_library') == 'static' and not is_windows
default_ldflags += ['-Wl,--export-dynamic']
endif
--
2.30.0
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2021-02-04 12:04:33.240844680 +0100
+++ 0128-build-fix-linker-flags-on-Windows.patch 2021-02-04 12:04:28.194789887 +0100
@@ -1 +1 @@
-From da042bcfc6c870fd067329a22e4084c4b2c4be2a Mon Sep 17 00:00:00 2001
+From 4a2baf099901166d83f3cd1ad77223cdec29842b Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit da042bcfc6c870fd067329a22e4084c4b2c4be2a ]
+
@@ -18 +19,0 @@
-Cc: stable at dpdk.org
@@ -29 +30 @@
-index fd72d7da68..903117b866 100644
+index 95c0ecae65..c7f689eb79 100644
@@ -32 +33 @@
-@@ -26,7 +26,7 @@ lib_execinfo = cc.find_library('execinfo', required: false)
+@@ -23,7 +23,7 @@ lib_execinfo = cc.find_library('execinfo', required: false)
@@ -34 +35 @@
- default_cflags = machine_args + ['-DALLOW_EXPERIMENTAL_API']
+ default_cflags = machine_args
@@ -66 +67 @@
-index f643ec1bad..b9ab24223f 100644
+index 25a23dc5da..9e081f3fb7 100644
@@ -69 +70 @@
-@@ -64,7 +64,7 @@ if cc.has_argument('-Wno-format-truncation')
+@@ -63,7 +63,7 @@ if cc.has_argument('-Wno-format-truncation')
More information about the stable
mailing list