Re: [dpdk-dev] [PATCH 4/6] build: MinGW-w64 support for Meson
From: Thomas Monjalon <hidden>
Date: 2020-02-04 22:08:53
31/01/2020 04:07, Dmitry Kozlyuk:
MinGW-w64 linker does not mimic MS linker options, so the build system must differentiate between linkers on Windows. Use GNU linker options with GCC and MS linker options with Clang. MinGW-w64 by default uses MSVCRT stdio, which does not comply to ANSI, most notably its formatting and string handling functions. MinGW-w64 support for the Universal CRT (UCRT) is ongoing, but the toolchain provides its own standard-complying implementation of stdio. The latter is used in the patch to support formatting in DPDK. Signed-off-by: Dmitry Kozlyuk <redacted>
I really like this patch. So both GCC (with MinGW) and native clang are supported? [...]
+# MS linker requires special treatment. +# FIXME: use cc.get_linker_id() after upgrading to Meson >=0.53.
What does it mean? It won't work with meson 0.53?
+is_ms_linker = is_windows and (cc.get_id() == 'clang')
[...]
+if is_windows
+ # Require platform SDK for Windows 7 and above.
+ add_project_arguments('-D_WIN32_WINNT=0x0601', language: 'c')Please explain. Why Windows 7 is needed? What this define is doing? [...]
- if is_windows + + if is_ms_linker lk_args = ['-Wl,/def:' + def_file.full_path(), '-Wl,/implib:lib\\' + implib] else lk_args = ['-Wl,--version-script=' + version_map] + endif
Looks good.