[v2] windows: minor build fixes

Message ID 20201031064455.991-1-nick.connolly@mayadata.io (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series [v2] windows: minor build fixes |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/Intel-compilation success Compilation OK
ci/travis-robot success Travis build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS

Commit Message

Nick Connolly Oct. 31, 2020, 6:44 a.m. UTC
  Meson versions >= 0.54.0 include support for handling /implib
with msvc link. Specifying it explicitly causes failures when
linking against the dll. Tested using Link 14.27.29112.0 and
Clang 11.0.0.

There were a number of changes to the way that import libraries
are handled between 0.47.1 and 0.54.0. Only make the change
for >= 0.54.0, leaving the behaviour unchanged for earlier
versions.

Signed-off-by: Nick Connolly <nick.connolly@mayadata.io>
Tested-by: Ranjit Menon <ranjit.menon@intel.com>
Acked-by: Ranjit Menon <ranjit.menon@intel.com>
---
v2:
* split out config/meson.build change

 drivers/meson.build | 6 ++++--
 lib/meson.build     | 6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)
  

Comments

Khoa To Nov. 6, 2020, 6:51 p.m. UTC | #1
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Nick Connolly
> Sent: Friday, October 30, 2020 11:45 PM
> Cc: dev@dpdk.org; bruce.richardson@intel.com; Nick Connolly
> <nick.connolly@mayadata.io>; ranjit.menon <ranjit.menon@intel.com>
> Subject: [EXTERNAL] [dpdk-dev] [PATCH v2] windows: minor build fixes
> 
> Meson versions >= 0.54.0 include support for handling /implib
> with msvc link. Specifying it explicitly causes failures when
> linking against the dll. Tested using Link 14.27.29112.0 and
> Clang 11.0.0.
> 
> There were a number of changes to the way that import libraries
> are handled between 0.47.1 and 0.54.0. Only make the change
> for >= 0.54.0, leaving the behaviour unchanged for earlier
> versions.
> 
> Signed-off-by: Nick Connolly <nick.connolly@mayadata.io>
> Tested-by: Ranjit Menon <ranjit.menon@intel.com>
> Acked-by: Ranjit Menon <ranjit.menon@intel.com>
> ---
> v2:
> * split out config/meson.build change
> 

Acked-by: Khoa To <khot@microsoft.com>
  
Thomas Monjalon Nov. 13, 2020, 2:16 p.m. UTC | #2
> > Meson versions >= 0.54.0 include support for handling /implib
> > with msvc link. Specifying it explicitly causes failures when
> > linking against the dll. Tested using Link 14.27.29112.0 and
> > Clang 11.0.0.
> > 
> > There were a number of changes to the way that import libraries
> > are handled between 0.47.1 and 0.54.0. Only make the change
> > for >= 0.54.0, leaving the behaviour unchanged for earlier
> > versions.
> > 
> > Signed-off-by: Nick Connolly <nick.connolly@mayadata.io>
> > Tested-by: Ranjit Menon <ranjit.menon@intel.com>
> > Acked-by: Ranjit Menon <ranjit.menon@intel.com>
> > ---
> > v2:
> > * split out config/meson.build change
> 
> Acked-by: Khoa To <khot@microsoft.com>

Applied, thanks
  

Patch

diff --git a/drivers/meson.build b/drivers/meson.build
index 4bb7e9218..6b50f7238 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -186,8 +186,10 @@  foreach subpath:subdirs
 			lk_deps = [version_map, def_file, mingw_map]
 			if is_windows
 				if is_ms_linker
-					lk_args = ['-Wl,/def:' + def_file.full_path(),
-						'-Wl,/implib:drivers\\' + implib]
+					lk_args = ['-Wl,/def:' + def_file.full_path()]
+					if meson.version().version_compare('<0.54.0')
+						lk_args += ['-Wl,/implib:drivers\\' + implib]
+					endif
 				else
 					lk_args = ['-Wl,--version-script=' + mingw_map.full_path()]
 				endif
diff --git a/lib/meson.build b/lib/meson.build
index 1bb019720..ed00f8914 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -157,8 +157,10 @@  foreach l:libraries
 				output: '@0@_mingw.map'.format(libname))
 
 			if is_ms_linker
-				lk_args = ['-Wl,/def:' + def_file.full_path(),
-					'-Wl,/implib:lib\\' + implib]
+				lk_args = ['-Wl,/def:' + def_file.full_path()]
+				if meson.version().version_compare('<0.54.0')
+					lk_args += ['-Wl,/implib:lib\\' + implib]
+				endif
 			else
 				if is_windows
 					lk_args = ['-Wl,--version-script=' + mingw_map.full_path()]