From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id DC9FDA053B; Thu, 6 Feb 2020 12:38:56 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3E46D1C0C0; Thu, 6 Feb 2020 12:38:56 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 138A41C0BC for ; Thu, 6 Feb 2020 12:38:54 +0100 (CET) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Feb 2020 03:38:53 -0800 X-IronPort-AV: E=Sophos;i="5.70,409,1574150400"; d="scan'208";a="235938776" Received: from bricha3-mobl.ger.corp.intel.com ([10.237.221.79]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 06 Feb 2020 03:38:52 -0800 Date: Thu, 6 Feb 2020 11:38:49 +0000 From: Bruce Richardson To: Dmitry Kozlyuk Cc: dev@dpdk.org, Thomas Monjalon Message-ID: <20200206113849.GB767@bricha3-MOBL.ger.corp.intel.com> References: <20200206064426.45697-1-dmitry.kozliuk@gmail.com> <20200206064426.45697-6-dmitry.kozliuk@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200206064426.45697-6-dmitry.kozliuk@gmail.com> User-Agent: Mutt/1.12.1 (2019-06-15) Subject: Re: [dpdk-dev] [PATCH v2 5/7] build: MinGW-w64 support for Meson X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Thu, Feb 06, 2020 at 09:44:24AM +0300, Dmitry Kozlyuk wrote: > 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 > --- > config/meson.build | 14 ++++++++++++++ > lib/librte_eal/meson.build | 3 +++ > lib/meson.build | 8 ++++++-- > 3 files changed, 23 insertions(+), 2 deletions(-) > > diff --git a/config/meson.build b/config/meson.build > index 28a57f56f..9b955f9ef 100644 > --- a/config/meson.build > +++ b/config/meson.build > @@ -14,6 +14,10 @@ foreach env:supported_exec_envs > set_variable('is_' + env, exec_env == env) > endforeach > > +# MS linker requires special treatment. > +# FIXME: use cc.get_linker_id() with Meson >= 0.54 > +is_ms_linker = is_windows and (cc.get_id() == 'clang') > + > # set the major version, which might be used by drivers and libraries > # depending on the configuration options > pver = meson.project_version().split('.') > @@ -241,6 +245,16 @@ if is_freebsd > add_project_arguments('-D__BSD_VISIBLE', language: 'c') > endif > > +if is_windows > + # Minimum supported API is Windows 7. > + add_project_arguments('-D_WIN32_WINNT=0x0601', language: 'c') > + > + # Use MinGW-w64 stdio, because DPDK assumes ANSI-compliant formatting. > + if cc.get_id() == 'gcc' > + add_project_arguments('-D__USE_MINGW_ANSI_STDIO', language: 'c') > + endif > +endif > + > if get_option('b_lto') > if cc.has_argument('-ffat-lto-objects') > add_project_arguments('-ffat-lto-objects', language: 'c') > diff --git a/lib/librte_eal/meson.build b/lib/librte_eal/meson.build > index 4be5118ce..eae8c2ba8 100644 > --- a/lib/librte_eal/meson.build > +++ b/lib/librte_eal/meson.build > @@ -20,6 +20,9 @@ endif > if cc.has_function('getentropy', prefix : '#include ') > cflags += '-DRTE_LIBEAL_USE_GETENTROPY' > endif > +if cc.get_id() == 'gcc' > + cflags += '-D__USE_MINGW_ANSI_STDIO' > +endif Is this snippet still needed, given you add this as a project arg above?