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 77F78A0541; Thu, 6 Feb 2020 21:23:23 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B72731C1C0; Thu, 6 Feb 2020 21:23:22 +0100 (CET) Received: from mail-qt1-f194.google.com (mail-qt1-f194.google.com [209.85.160.194]) by dpdk.org (Postfix) with ESMTP id 2C8D91C1B0 for ; Thu, 6 Feb 2020 21:23:21 +0100 (CET) Received: by mail-qt1-f194.google.com with SMTP id d5so145778qto.0 for ; Thu, 06 Feb 2020 12:23:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Iub4ly50wW6nG+N45ygLVp57WdeDqBTQbhGmhJyspWE=; b=WFgqczUgrreBaGUMT4Ppn4xDyVfJVmlcM770tJ0DSKuYVuEzhD+3X1m+h2uGSiUub1 Zc2dz/JFuuJpj+o6u2F2YM+3fxx8iwDz/XDnYf6Je7ELPcbad/5kxcQkTzRZu1xQKQIM AWT6TyxpTE/SubeVlfl7SaeQcOytMR5+fm+s9kIbPnd1QJYrrcd4xMq/Xo85kPYpt/YB yHuBtMTFd53Q2ph5WXZG8gStpdHQyFUQUzQqGZy42MxRVmvX/QPJYjEZrJ+CWkFG5hJ9 emwg4w0IjUEeDRNy5wG9drIwOcBNWUtwtMAH0tPb2VygQwjKY225rxJmt/P+BEWki3fS BB5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Iub4ly50wW6nG+N45ygLVp57WdeDqBTQbhGmhJyspWE=; b=DL5AitF8Y3fJWxQ/Kjng/RWVMuMVIAO74369FHlHD1Z81epCpEIMee1bz8X5qcG78M MxGA+vo3Tl3ruqO+TJ62OY5rBRYfsxd+HZZqLVvrSKFHLdlc68K3aQamVGCUry3ZeEiJ jexIJ/ytzGHE6odHZ5WbLsVNSIkQCTuRFPak7LtP0aPmbJ799mr4+CgtRGmwZJYimCl7 vAIMQAJSia3bFPc/Ix/WOYu55YjPc6snrGTCKk8zfc0Lg5u3pZMguq3JyIjHGcGmaUhz ZqYmGZ/S4IsuoCV0oyYpscSShWbqpumNUzTvtZNYLtBW+zyRgizygqygwCeuQLVAiIu/ xf/g== X-Gm-Message-State: APjAAAX1AUs/qn/l6Iw1pZ/d7gQkc6s62AK3JANcvZnsCbCt+22ZJK91 E+CkWb4qONKDBxc7A0y1g+DPeb4ul6l0QjkCZmE= X-Google-Smtp-Source: APXvYqxlDtBtXS5LQP3nV7WlQmdba92Su7+r+1M0ZCf14zuZD7hwOzlmC4cer1ceYJutCJc1+TYCJEhu4ScfryaI9AA= X-Received: by 2002:aed:2e03:: with SMTP id j3mr4318447qtd.365.1581020600254; Thu, 06 Feb 2020 12:23:20 -0800 (PST) MIME-Version: 1.0 References: <20200206064426.45697-1-dmitry.kozliuk@gmail.com> In-Reply-To: <20200206064426.45697-1-dmitry.kozliuk@gmail.com> From: William Tu Date: Thu, 6 Feb 2020 12:22:44 -0800 Message-ID: To: Dmitry Kozlyuk Cc: dev@dpdk.org, Bruce Richardson , Thomas Monjalon , Olivier Matz , Harini Ramakrishnan , Omar Cardona , Pallavi Kadam , Ranjit Menon , John McNamara , Marko Kovacevic Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v2 0/7] MinGW-w64 support 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 Wed, Feb 5, 2020 at 10:44 PM Dmitry Kozlyuk wrote: > > This patch series add support for building DPDK using MinGW-w64. > > MinGW-w64 provides GNU toolchain and independent platform SDK on > Windows. It also supports cross-compilation to Windows from POSIX > systems by providing cross tollchains and libraries [0]. It does NOT > emulate a full POSIX environment, like Cygwin or MSYS do. > > There are advantages in using MinGW-w64 in addition to Clang: > > 1. Cross-compilation out-of-the-box. MinGW-w64 is provides a pthread > implementation, GNU getopt, and Windows platform SDK. > > 2. Easier porting of POSIX applications using DPDK to Windows, because > application code can use the same benefits as mentioned above. > > 3. Having both primary compilers enabled on Windows provides more > diagnostics and generally prevents non-portable code. > > [0]: http://mingw-w64.org > > v2 Changes: > > Add patch to use lowercase system header filenames. > Move Meson cross-file for x86 to arch directory. > Change wording in comments. > Add Meson version warning in documentation. > > Dmitry Kozlyuk (7): > eal: introduce portable format attribute > eal: use portable format attribute > cmdline: use portable format attribute > eal/windows: use lowercase filenames for system headers > build: MinGW-w64 support for Meson > build: add cross-file for MinGW-w64 > doc: guide for Windows build using MinGW-w64 > > config/meson.build | 14 +++++ > config/x86/meson_mingw.txt | 14 +++++ > doc/guides/windows_gsg/build_dpdk.rst | 65 ++++++++++++++++++--- > lib/librte_cmdline/cmdline.h | 4 +- > lib/librte_eal/common/include/rte_common.h | 17 +++++- > lib/librte_eal/common/include/rte_debug.h | 2 +- > lib/librte_eal/common/include/rte_devargs.h | 2 +- > lib/librte_eal/common/include/rte_log.h | 4 +- > lib/librte_eal/meson.build | 3 + > lib/librte_eal/windows/eal/include/rte_os.h | 4 +- > lib/meson.build | 8 ++- > 11 files changed, 118 insertions(+), 19 deletions(-) > create mode 100644 config/x86/meson_mingw.txt > > -- > 2.25.0 > Hi Dmitry, I applied your v2 patch and I did a native build on windows 10. Hit an error showing ../lib/librte_eal/windows/eal/eal_lcore.c:54:2: error: 'for' loop initial declarations are only allowed in C99 mode for (unsigned int socket = 0; socket < ^ ../lib/librte_eal/windows/eal/eal_lcore.c:54:2: note: use option -std=c99 or -std=gnu99 to compile your code Then I fixed them by having separate declaration out side for loop. then $ ninja -C build works However the output looks weird: C:\dpdk\build\examples>dpdk-helloworld.exe EAL: Detected 2 lcore(s) EAL: Detected 1 NUMA nodes hehello fllo frorom cm core 1 ore 0 Regards, William --- more detailed --- C:\dpdk>meson -v 0.53.999 C:\dpdk>gcc -v Reading specs from c:/mingw-w64/bin/../lib64/gcc/x86_64-w64-mingw32/4.8.3/specs COLLECT_GCC=gcc C:\dpdk>meson --reconfigure -Dexamples=helloworld build The Meson build system Version: 0.53.999 Source dir: C:\dpdk Build dir: C:\dpdk\build Build type: native build Program cat found: NO Program more found: YES (C:\WINDOWS\system32\more.COM) Project name: DPDK Project version: 20.02.0-rc2 C compiler for the host machine: cc (gcc 4.8.3 "cc (GCC) 4.8.3") C linker for the host machine: cc GNU ld.bfd 2.24 Host machine cpu family: x86_64 Host machine cpu: x86_64 Program cat found: NO Program more found: YES (C:\WINDOWS\system32\more.COM) Program ../buildtools/symlink-drivers-solibs.sh found: YES (sh C:\dpdk\config\../buildtools/symlink-drivers-so libs.sh) Checking for size of "void *" : 8 Library m found: YES Library numa found: NO Found pkg-config: C:\mingw-w64\bin\pkg-config.EXE (0.25)