* [dpdk-stable] [PATCH] build: fix using ELF-only linker flags with COFF
@ 2021-01-12 0:36 Dmitry Kozlyuk
2021-01-13 20:27 ` [dpdk-stable] [dpdk-dev] " Ranjit Menon
0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Kozlyuk @ 2021-01-12 0:36 UTC (permalink / raw)
To: dev; +Cc: Olivier Matz, Bruce Richardson, Dmitry Kozlyuk, stable
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")
Cc: stable@dpdk.org
Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
---
Using TLS variables with DLLs is problematic on Windows for now,
so not attempting to check or solve the issue with plugin load.
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 fd72d7da6..903117b86 100644
--- a/app/meson.build
+++ b/app/meson.build
@@ -26,7 +26,7 @@ lib_execinfo = cc.find_library('execinfo', required: false)
default_cflags = machine_args + ['-DALLOW_EXPERIMENTAL_API']
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 168ee08e5..39a8fd1c8 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 f643ec1ba..b9ab24223 100644
--- a/examples/meson.build
+++ b/examples/meson.build
@@ -64,7 +64,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.29.2
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-stable] [dpdk-dev] [PATCH] build: fix using ELF-only linker flags with COFF
2021-01-12 0:36 [dpdk-stable] [PATCH] build: fix using ELF-only linker flags with COFF Dmitry Kozlyuk
@ 2021-01-13 20:27 ` Ranjit Menon
2021-01-13 20:55 ` Thomas Monjalon
0 siblings, 1 reply; 4+ messages in thread
From: Ranjit Menon @ 2021-01-13 20:27 UTC (permalink / raw)
To: Dmitry Kozlyuk, dev; +Cc: Olivier Matz, Bruce Richardson, stable
On 1/11/2021 4:36 PM, Dmitry Kozlyuk wrote:
> 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")
> Cc: stable@dpdk.org
>
> Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
> ---
> Using TLS variables with DLLs is problematic on Windows for now,
> so not attempting to check or solve the issue with plugin load.
>
> app/meson.build | 2 +-
> buildtools/pkg-config/meson.build | 6 +++++-
> examples/meson.build | 2 +-
> 3 files changed, 7 insertions(+), 3 deletions(-)
Acked-by: Ranjit Menon <ranjit.menon@intel.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-stable] [dpdk-dev] [PATCH] build: fix using ELF-only linker flags with COFF
2021-01-13 20:27 ` [dpdk-stable] [dpdk-dev] " Ranjit Menon
@ 2021-01-13 20:55 ` Thomas Monjalon
2021-01-14 9:27 ` Tal Shnaiderman
0 siblings, 1 reply; 4+ messages in thread
From: Thomas Monjalon @ 2021-01-13 20:55 UTC (permalink / raw)
To: Dmitry Kozlyuk
Cc: dev, stable, Olivier Matz, Bruce Richardson, Ranjit Menon, Aaron
13/01/2021 21:27, Ranjit Menon:
> On 1/11/2021 4:36 PM, Dmitry Kozlyuk wrote:
> > 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")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
> > ---
> > Using TLS variables with DLLs is problematic on Windows for now,
> > so not attempting to check or solve the issue with plugin load.
>
> Acked-by: Ranjit Menon <ranjit.menon@intel.com>
Applied, thanks
Why we didn't catch it in advance in CI?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-stable] [dpdk-dev] [PATCH] build: fix using ELF-only linker flags with COFF
2021-01-13 20:55 ` Thomas Monjalon
@ 2021-01-14 9:27 ` Tal Shnaiderman
0 siblings, 0 replies; 4+ messages in thread
From: Tal Shnaiderman @ 2021-01-14 9:27 UTC (permalink / raw)
To: NBU-Contact-Thomas Monjalon, Dmitry Kozlyuk
Cc: dev, stable, Olivier Matz, Bruce Richardson, Ranjit Menon, Aaron
> Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH] build: fix using ELF-only linker
> flags with COFF
>
> External email: Use caution opening links or attachments
>
>
> 13/01/2021 21:27, Ranjit Menon:
> > On 1/11/2021 4:36 PM, Dmitry Kozlyuk wrote:
> > > 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")
> > > Cc: stable@dpdk.org
> > >
> > > Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
> > > ---
> > > Using TLS variables with DLLs is problematic on Windows for now, so
> > > not attempting to check or solve the issue with plugin load.
> >
> > Acked-by: Ranjit Menon <ranjit.menon@intel.com>
>
> Applied, thanks
>
> Why we didn't catch it in advance in CI?
>
I think Windows CI still passes on builds with warnings, maybe we can change it now that we cleared all of them.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-01-14 9:27 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-12 0:36 [dpdk-stable] [PATCH] build: fix using ELF-only linker flags with COFF Dmitry Kozlyuk
2021-01-13 20:27 ` [dpdk-stable] [dpdk-dev] " Ranjit Menon
2021-01-13 20:55 ` Thomas Monjalon
2021-01-14 9:27 ` Tal Shnaiderman
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).