[dpdk-dev] [PATCH 4/6] build: MinGW-w64 support for Meson

Bruce Richardson bruce.richardson at intel.com
Wed Feb 5 15:30:50 CET 2020


On Wed, Feb 05, 2020 at 01:41:24AM +0100, Thomas Monjalon wrote:
> 05/02/2020 00:21, Dmitry Kozlyuk:
> > > I really like this patch.
> > > So both GCC (with MinGW) and native clang are supported?
> > 
> > Thanks. Yes, I tested both toolchains.
> > 
> > > [...]
> > > > +# 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?
> > 
> > It will work for any Meson version, I meant that Meson 0.54 will introduce a
> > better way to determine linker ID. Can you suggest a better wording?
> 
> FIXME: use cc.get_linker_id() with Meson >= 0.54
> 
> 
> > > > +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?
> > 
> > Yes, Windows 7 and above is need for already existing code in eal_lcore.c,
> > specifically for GetLogicalProcessorInformation() call.
> > 
> > When including <windows.h>, one must define minimum API version the
> > application is compiled against [0]. MSVC and Clang default to the version of
> > platform SDK (that is, maximum supported). MinGW defaults to Windows XP, so
> > this definition must be either in <rte_os.h> before #include <windows.h> or
> > here. Because other files may include <windows.h>, I'd prefer to have a
> > global definition via compiler command-line.
> > 
> > [0]:
> > https://docs.microsoft.com/en-us/windows/win32/WinProg/using-the-windows-headers
> 
> OK, thanks.
> Please reword the comment with something like
> 	"Minimum supported API is Windows 7."
> 
For this, as an alternative to putting it as a project argument, you can just
add it to dpdk_conf which means it will end up as a define in the global
rte_build_config.h and so be directly included in each compilation unit
ahead of any other headers. (rte_config.h includes rte_build_config.h)

/Bruce


More information about the dev mailing list