Message ID | 20200131030744.19596-1-dmitry.kozliuk@gmail.com (mailing list archive) |
---|---|
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 58B4DA0524; Fri, 31 Jan 2020 04:07:53 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 912661C065; Fri, 31 Jan 2020 04:07:52 +0100 (CET) Received: from mail-lj1-f194.google.com (mail-lj1-f194.google.com [209.85.208.194]) by dpdk.org (Postfix) with ESMTP id B5FAC1C030 for <dev@dpdk.org>; Fri, 31 Jan 2020 04:07:51 +0100 (CET) Received: by mail-lj1-f194.google.com with SMTP id o15so58694ljg.6 for <dev@dpdk.org>; Thu, 30 Jan 2020 19:07:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=iuZrD1k/CDNT1limuHw5HX5g76sH/+h/w4RiozMEIAI=; b=uYubEw7hT0JtYabBU+jQFlrKTkcly+H5tDJ3TNqWN95e+EQOczKoig3Qw6tXVSpH7V VyyjhYCuAiXfOd/TbKA+gbEdqcaqSlowDns6NXhBPGw61srjqYwneBg4sPYN3t6PTpvo DKAWCQYPrwcT/p8mczXY0i9nFGuK/y++JFdKriGDav5HLb7M0pi+PCYA1MrX6Cswqe00 vAgsDpL8dM5AiRGrXAbxlrq2+rYcrMSonhSnORSXUEd3HXKjF0fDTzwlwxPKOhhvkQ0I NDn4UQiyFbliHkvMfmhq3kGhBQ30zUD8wvksC4QxNBBfU9LsT0vtH/X21utrNuoOpMAY In8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=iuZrD1k/CDNT1limuHw5HX5g76sH/+h/w4RiozMEIAI=; b=MPX0l+k8d9R9/FsQfMfbn4tY/TQuGQkyAuCFs/YH7XKS0mXfroPIOVDxRUDEo0kBWQ KQY0V4AWBrxENbQ/CDMzrQNI7r+EoMHgQS9jh7NMOH3/5/+j5DP5PzGfNkm9AYRQxXJr 9E7MI2gsWuhuyjpC/XtP+2WpER+hRnj8N0JwEbmPUWMHK5CXXvLNYizW3yXjTbgMqaF1 14XO4FMpc2tHV+93jhgewG82StaGCiw2M9WzF3PEp/GRjm+3crch6x5wGx0+T7qQif1D 71qwsVlH36IADBvTWc3F3ZXhubjP9I0BKxaKNnKS7BBG+nm7/PPjQBY2I7FNMJve/uSv iSBQ== X-Gm-Message-State: APjAAAVdhZ8vrmqHRpOhXCdhISUJoBU83zAkU+vj+870YsnDZHpwBmZY sLrcI9+7rd62HkPJSP9Nxh4i41HL9iKXJQ== X-Google-Smtp-Source: APXvYqyz4usgU0ZmRgl+xm+Ql/eAU/v1xiQwp4RU6X9rqZGDs8w2xMmgoyDHXA64kQtXzmzk0wCtsg== X-Received: by 2002:a2e:8eda:: with SMTP id e26mr4770014ljl.65.1580440070919; Thu, 30 Jan 2020 19:07:50 -0800 (PST) Received: from localhost.localdomain (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.googlemail.com with ESMTPSA id e12sm3630332lfc.70.2020.01.30.19.07.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jan 2020 19:07:50 -0800 (PST) From: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com> To: dev@dpdk.org Cc: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>, Bruce Richardson <bruce.richardson@intel.com>, Thomas Monjalon <thomas@monjalon.net>, Olivier Matz <olivier.matz@6wind.com>, Harini Ramakrishnan <harini.ramakrishnan@microsoft.com>, Omar Cardona <ocardona@microsoft.com>, Pallavi Kadam <pallavi.kadam@intel.com>, Ranjit Menon <ranjit.menon@intel.com>, John McNamara <john.mcnamara@intel.com>, Marko Kovacevic <marko.kovacevic@intel.com> Date: Fri, 31 Jan 2020 06:07:38 +0300 Message-Id: <20200131030744.19596-1-dmitry.kozliuk@gmail.com> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 0/6] MinGW-w64 support X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Series | MinGW-w64 support | |
Message
Dmitry Kozlyuk
Jan. 31, 2020, 3:07 a.m. UTC
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 Dmitry Kozlyuk (6): eal: introduce portable format attribute eal: use portable format attribute cmdline: use portable format attribute 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 +++++ doc/guides/windows_gsg/build_dpdk.rst | 57 +++++++++++++++++---- 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/meson.build | 8 ++- meson_mingw.txt | 14 +++++ 10 files changed, 108 insertions(+), 17 deletions(-) create mode 100644 meson_mingw.txt
Comments
Hi Dmitry,
Thanks for the patches! I was able to compile and run natively, after applying the Meson patch that you mentioned.
I'm having some trouble with cross-compilation:
python3 meson.py -Dexamples=helloworld ../../dpdk/build ../../dpdk --cross-file ../../dpdk/meson_mingw.txt
The Meson build system
Version: 0.53.1
Source dir: /mnt/d/dpdk
Build dir: /mnt/d/dpdk/build
Build type: cross build
Program cat found: YES (/bin/cat)
Project name: DPDK
Project version: 20.02.0-rc1
C compiler for the build machine: cc (gcc 7.4.0 "cc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0")
C linker for the build machine: cc GNU ld.bfd 2.30
meson.build:4:0: ERROR: Unable to determine dynamic linker
Any ideas on how to fix this issue?
Thanks,
Narcisa Vasile
-----Original Message-----
From: dev <dev-bounces@dpdk.org> On Behalf Of Dmitry Kozlyuk
Sent: Thursday, January 30, 2020 7:08 PM
To: dev@dpdk.org
Cc: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>; Bruce Richardson <bruce.richardson@intel.com>; Thomas Monjalon <thomas@monjalon.net>; Olivier Matz <olivier.matz@6wind.com>; Harini Ramakrishnan <Harini.Ramakrishnan@microsoft.com>; Omar Cardona <ocardona@microsoft.com>; Pallavi Kadam <pallavi.kadam@intel.com>; Ranjit Menon <ranjit.menon@intel.com>; John McNamara <john.mcnamara@intel.com>; Marko Kovacevic <marko.kovacevic@intel.com>
Subject: [EXTERNAL] [dpdk-dev] [PATCH 0/6] MinGW-w64 support
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]: https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmingw-w64.org&data=02%7C01%7CNarcisa.Vasile%40microsoft.com%7C9ecc756fe41941539c3208d7a5fac686%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637160368803628802&sdata=GcrGNIMkp0PjfmOXoKkbdA4ttMYQLv3cB24riDfPx%2Fk%3D&reserved=0
Dmitry Kozlyuk (6):
eal: introduce portable format attribute
eal: use portable format attribute
cmdline: use portable format attribute
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 +++++
doc/guides/windows_gsg/build_dpdk.rst | 57 +++++++++++++++++----
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/meson.build | 8 ++-
meson_mingw.txt | 14 +++++
10 files changed, 108 insertions(+), 17 deletions(-) create mode 100644 meson_mingw.txt
--
2.25.0
Hi Narcisa, > I'm having some trouble with cross-compilation: > > python3 meson.py -Dexamples=helloworld ../../dpdk/build ../../dpdk --cross-file ../../dpdk/meson_mingw.txt > The Meson build system > Version: 0.53.1 > Source dir: /mnt/d/dpdk > Build dir: /mnt/d/dpdk/build > Build type: cross build > Program cat found: YES (/bin/cat) > Project name: DPDK > Project version: 20.02.0-rc1 > C compiler for the build machine: cc (gcc 7.4.0 "cc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0") > C linker for the build machine: cc GNU ld.bfd 2.30 > > meson.build:4:0: ERROR: Unable to determine dynamic linker > > Any ideas on how to fix this issue? Use Meson 0.52, version 0.53 introduced this regression among others: https://github.com/mesonbuild/meson/issues/6431 DPDK CI also has Meson version pinned to 0.52, see http://mails.dpdk.org/archives/dev/2020-January/154357.html I find it handy to switch Meson versions via pip3. Here's Meson 0.52 output: > $ meson --cross-file meson_mingw.txt build/cross/mingw > The Meson build system > Version: 0.52.0 > Source dir: /home/dmitry/src/dpdk.clean > Build dir: /home/dmitry/src/dpdk.clean/build/cross/mingw > Build type: cross build > Program cat found: YES (/usr/bin/cat) > Project name: DPDK > Project version: 20.02.0-rc1 > C compiler for the build machine: cc (gcc 9.2.0 "cc (GCC) 9.2.0") > C linker for the build machine: GNU ld.bfd 2.33.1 > C compiler for the host machine: /usr/bin/x86_64-w64-mingw32-gcc (gcc 9.2.0 > "x86_64-w64-mingw32-gcc (GCC) 9.2.0") > C linker for the host machine: GNU ld.bfd 2.33.1 As you can see, it correctly picks up CC and LD for host machine, unlike 0.53.
On Wed, Feb 5, 2020 at 6:43 AM Dmitry Kozlyuk <dmitry.kozliuk@gmail.com> wrote: > > Hi Narcisa, > > > I'm having some trouble with cross-compilation: > > > > python3 meson.py -Dexamples=helloworld ../../dpdk/build ../../dpdk --cross-file ../../dpdk/meson_mingw.txt > > The Meson build system > > Version: 0.53.1 > > Source dir: /mnt/d/dpdk > > Build dir: /mnt/d/dpdk/build > > Build type: cross build > > Program cat found: YES (/bin/cat) > > Project name: DPDK > > Project version: 20.02.0-rc1 > > C compiler for the build machine: cc (gcc 7.4.0 "cc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0") > > C linker for the build machine: cc GNU ld.bfd 2.30 > > > > meson.build:4:0: ERROR: Unable to determine dynamic linker > > > > Any ideas on how to fix this issue? > > Use Meson 0.52, version 0.53 introduced this regression among others: > https://github.com/mesonbuild/meson/issues/6431 > DPDK CI also has Meson version pinned to 0.52, see > http://mails.dpdk.org/archives/dev/2020-January/154357.html > I find it handy to switch Meson versions via pip3. Err, we decided to pin to 0.47.1 as it is the documented minimal supported version. http://inbox.dpdk.org/dev/20200108110251.20916-1-david.marchand@redhat.com/ So the CI is stuck to the 0.47.1 version, not 0.52. Do you need something from a newer meson for Windows support? That would have to be documented. -- David Marchand
> > Use Meson 0.52, version 0.53 introduced this regression among others: > > https://github.com/mesonbuild/meson/issues/6431 > > DPDK CI also has Meson version pinned to 0.52, see > > http://mails.dpdk.org/archives/dev/2020-January/154357.html > > I find it handy to switch Meson versions via pip3. > > Err, we decided to pin to 0.47.1 as it is the documented minimal > supported version. > http://inbox.dpdk.org/dev/20200108110251.20916-1-david.marchand@redhat.com/ > > So the CI is stuck to the 0.47.1 version, not 0.52. > Do you need something from a newer meson for Windows support? That > would have to be documented. My bad, can't tell why I decided that 0.52 was pinned. I verified building with Meson 0.47.1, both cross and native, and it works well. Apologies to Narcisa for misguidance.
On 2/5/2020 12:59 PM, Dmitry Kozlyuk wrote: Use Meson 0.52, version 0.53 introduced this regression among others: https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmesonbuild%2Fmeson%2Fissues%2F6431&data=02%7C01%7CNarcisa.Vasile%40microsoft.com%7C3a156299509a4e20c63108d7aa7e5cf0%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637165332017516796&sdata=eOx4P6FJLWzC7pmpS%2F0xvA2VzjFJ0YCrxRc7ris%2BKhU%3D&reserved=0 DPDK CI also has Meson version pinned to 0.52, see https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmails.dpdk.org%2Farchives%2Fdev%2F2020-January%2F154357.html&data=02%7C01%7CNarcisa.Vasile%40microsoft.com%7C3a156299509a4e20c63108d7aa7e5cf0%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637165332017516796&sdata=Z87jGpDhGqBVdYWXg0b66kTuOr5x0byCPM9TUel5dZ0%3D&reserved=0 I find it handy to switch Meson versions via pip3. Err, we decided to pin to 0.47.1 as it is the documented minimal supported version. https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Finbox.dpdk.org%2Fdev%2F20200108110251.20916-1-david.marchand%40redhat.com%2F&data=02%7C01%7CNarcisa.Vasile%40microsoft.com%7C3a156299509a4e20c63108d7aa7e5cf0%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637165332017516796&sdata=361djaQtaBeKN%2B9Fjg5IjuQ2dhfjCg0eMlHBVZA3aqw%3D&reserved=0 So the CI is stuck to the 0.47.1 version, not 0.52. Do you need something from a newer meson for Windows support? That would have to be documented. My bad, can't tell why I decided that 0.52 was pinned. I verified building with Meson 0.47.1, both cross and native, and it works well. Apologies to Narcisa for misguidance. No worries, I also cross-compiled using both 0.47.1 and 0.52.0. I was able to generate the helloworld executable and ran it successfully. Thanks! I did have to apply your patch "eal/windows: refine public interface" before applying the "MinGW-w64 support" patch set, to avoid the errors caused by including "Windows.h" in rte_os.h. So, I guess this patch needs to come first and then the patchset for mingw can be applied.
> I did have to apply your patch "eal/windows: refine public interface" before applying the "MinGW-w64 support" patch set, to avoid the errors caused by including "Windows.h" in rte_os.h. So, I guess this patch needs to come first and then the patchset for mingw can be applied.
The cause of the error you've encountered is case-dependent Linux filesystem.
Existing code includes <Windows.h> (capital W), but MinGW-w64 on Linux
packages <windows.h> (lowercase W). I missed it because Windows.h is manually
symlinked to windows.h on my system. Same goes for <BaseTsd.h>.
Thanks for pointing this out, I think it's more appropriate to change
filename case in this patchset v2, because the need for this change is caused
by adding MinGW cross-compilation capability.