Skip to content

Commit

Permalink
build: fix MS linker flag with meson 0.54
Browse files Browse the repository at this point in the history
[ upstream commit 52a7cb0 ]

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.

Fixes: 77cca7c ("build: fix drivers library path on Windows")

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>
Acked-by: Khoa To <khot@microsoft.com>
  • Loading branch information
nconnolly1 authored and bluca committed Nov 16, 2020
1 parent ae83227 commit 4162bc3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions drivers/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,10 @@ foreach class:dpdk_driver_classes
lk_deps = [version_map, def_file]
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 = []
endif
Expand Down
6 changes: 4 additions & 2 deletions lib/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,10 @@ foreach l:libraries
output: 'rte_@0@_exports.def'.format(name))

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
lk_args = ['-Wl,--version-script=' + version_map]
endif
Expand Down

0 comments on commit 4162bc3

Please sign in to comment.