Skip to contentSkip to conversation

windows: minor build fixes

PATCH Superseded Nick Connolly 3 participants 6 messages Oct 31, 2020 – Nov 15, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 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.

---
v2:
* split out config/meson.build change

 drivers/meson.build | 6 ++++--
 lib/meson.build     | 6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)
drivers/meson.build +4 -2
index 4bb7e9218..6b50f7238 100644
@@ -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
lib/meson.build +4 -2
index 1bb019720..ed00f8914 100644
@@ -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()]
Signature · 1 line
2.25.1
#1 lore raw

PATCH v2 1/1 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.

---
v2:
* split out config/meson.build change

 drivers/meson.build | 6 ++++--
 lib/meson.build     | 6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)
drivers/meson.build +4 -2
index 4bb7e9218..6b50f7238 100644
@@ -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
lib/meson.build +4 -2
index 1bb019720..ed00f8914 100644
@@ -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()]
Signature · 1 line
2.25.1
#2 lore raw

Missing / incorrect '--in-reply-to'. Please ignore - still learning the process!

Quoted 55 lines · Nick Connolly

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.

---
v2:
* split out config/meson.build change

  drivers/meson.build | 6 ++++--
  lib/meson.build     | 6 ++++--
  2 files changed, 8 insertions(+), 4 deletions(-)
drivers/meson.build +4 -2
index 4bb7e9218..6b50f7238 100644
@@ -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
lib/meson.build +4 -2
index 1bb019720..ed00f8914 100644
@@ -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()]
#3 lore raw
Quoted 10 lines

Subject: Re: [dpdk-dev] [PATCH v2] windows: minor build fixes

Missing / incorrect '--in-reply-to'. Please ignore - still learning the process!

Quoted 4 lines · Nick Connolly

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.

How can we verify this behavior change in 0.54 is intentional? I cannot find it in the versions' release notes:

https://mesonbuild.com/Release-notes-for-0-54-0.html

Quoted 51 lines
Quoted 21 lines

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.

---
v2:
* split out config/meson.build change

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

4bb7e9218..6b50f7238 100644

drivers/meson.build +0 -0
@@ -186,8 +186,10 @@ foreach subpath:subdirs
                      lk_deps = [version_map, def_file, mingw_map]

drivers/meson.build foreach subpath:subdirs · line 194

Quoted 10 lines
drivers/meson.build +4 -2
                      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()]

Quoted 19 lines
drivers/meson.build +0 -0
                              endif
lib/meson.build index renamed from lib/meson.build +0 -0

1bb019720..ed00f8914 100644

lib/meson.build +4 -2
@@ -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()]

#4 lore raw

12/11/2020 22:35, Tal Shnaiderman:

Quoted 10 lines
Quoted 9 lines

Subject: Re: [dpdk-dev] [PATCH v2] windows: minor build fixes

Missing / incorrect '--in-reply-to'. Please ignore - still learning the process!

Quoted 4 lines · Nick Connolly

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.

Quoted 4 lines

How can we verify this behavior change in 0.54 is intentional? I cannot find it in the versions' release notes:

https://mesonbuild.com/Release-notes-for-0-54-0.html

I've found 2 commits touching implib in meson 0.54:
https://github.com/mesonbuild/meson/commit/cace70c64eab4
https://github.com/mesonbuild/meson/commit/06bbf6cf9353f6

#5 lore raw
Quoted 39 lines

Subject: Re: [dpdk-dev] [PATCH v2] windows: minor build fixes

External email: Use caution opening links or attachments

12/11/2020 22:35, Tal Shnaiderman:

Quoted 4 lines
Quoted 4 lines

Subject: Re: [dpdk-dev] [PATCH v2] windows: minor build fixes

Missing / incorrect '--in-reply-to'. Please ignore - still learning the process!

Quoted 10 lines
Quoted 5 lines · Nick Connolly
Quoted 4 lines

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.

How can we verify this behavior change in 0.54 is intentional? I cannot find it in the versions' release notes:

https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmes
o

Quoted 1 line

nbuild.com%2FRelease-notes-for-0-54-

0.html&amp;data=04%7C01%7Ctalshn%4

Quoted 1 line

0nvidia.com%7C958236d4a61f4a12411808d887dcd2b7%7C43083d15727340c1 b7db3

Quoted 1 line

9efd9ccc17a%7C0%7C0%7C637408729782053998%7CUnknown%7CTWFpbGZs b3d8eyJWI

Quoted 1 line

joiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1 000&a

Quoted 1 line

mp;sdata=21h2QD1OJQt88icTM0kd%2FbkuFzlBq4J5tMJRsh4x9LY%3D&amp;r eserved

Quoted 1 line

=0

Quoted 16 lines

I've found 2 commits touching implib in meson 0.54:
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgith
ub.com%2Fmesonbuild%2Fmeson%2Fcommit%2Fcace70c64eab4&amp;data =04%7C01%7Ctalshn%40nvidia.com%7C958236d4a61f4a12411808d887dcd2b7 %7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C637408729782053998 %7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiL CJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=w9k3%2FvRIWT8Jb Bm0HXYGZSqW2i0%2BZfq05jzloobNdyc%3D&amp;reserved=0
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgith
ub.com%2Fmesonbuild%2Fmeson%2Fcommit%2F06bbf6cf9353f6&amp;data =04%7C01%7Ctalshn%40nvidia.com%7C958236d4a61f4a12411808d887dcd2b7 %7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C637408729782063987 %7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiL CJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=62PcG42%2FiD3n8s 5%2BD7H6iYEvxS8hAGZFta1vR8suGSM%3D&amp;reserved=0

Thanks Thomas, I assume it's part of their changes in that area.

Quoted 1 line