DPDK patches and discussions
 help / color / mirror / Atom feed
From: Nick Connolly <nick.connolly@mayadata.io>
To: Tal Shnaiderman <talshn@nvidia.com>,
	Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>,
	Narcisa Ana Maria Vasile <navasile@linux.microsoft.com>,
	Dmitry Malloy <dmitrym@microsoft.com>,
	Pallavi Kadam <pallavi.kadam@intel.com>,
	Tal Shnaiderman <talshn@mellanox.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] eal/windows: fix link error with MinGW
Date: Fri, 20 Nov 2020 23:43:33 +0000	[thread overview]
Message-ID: <a3ca2e1f-4e1f-ef18-6533-1b8ab42fb054@mayadata.io> (raw)
In-Reply-To: <CY4PR1201MB2548FFAD5F49FE9FC8D62A41A4FF0@CY4PR1201MB2548.namprd12.prod.outlook.com>


> I can't seem to reproduce the link error you've mentioned (I'm building hello_world on master).
> can you share more information on how to reproduce it? (MinGW version, build env variables, build OS).
>
> Thanks,
>
> Tal.

Hi Tal,

Sure - latest MinGW-w64 (v8.0.0 I believe, but the versioning isn't too 
clear to me!).  gcc -v reports:

> C:\Users\Nick>c:\MinGW\mingw64\bin\gcc -v
> Using built-in specs.
> COLLECT_GCC=c:\MinGW\mingw64\bin\gcc
> COLLECT_LTO_WRAPPER=c:/MinGW/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/8.1.0/lto-wrapper.exe
> Target: x86_64-w64-mingw32
> Configured with: ../../../src/gcc-8.1.0/configure 
> --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 
> --target=x86_64-w64-mingw32 --prefix=/mingw64 
> --with-sysroot=/c/mingw810/x86_64-810-win32-seh-rt_v6-rev0/mingw64 
> --enable-shared --enable-static --disable-multilib 
> --enable-languages=c,c++,fortran,lto --enable-libstdcxx-time=yes 
> --enable-threads=win32 --enable-libgomp --enable-libatomic 
> --enable-lto --enable-graphite --enable-checking=release 
> --enable-fully-dynamic-string --enable-version-specific-runtime-libs 
> --disable-libstdcxx-pch --disable-libstdcxx-debug --enable-bootstrap 
> --disable-rpath --disable-win32-registry --disable-nls 
> --disable-werror --disable-symvers --with-gnu-as --with-gnu-ld 
> --with-arch=nocona --with-tune=core2 --with-libiconv 
> --with-system-zlib 
> --with-gmp=/c/mingw810/prerequisites/x86_64-w64-mingw32-static 
> --with-mpfr=/c/mingw810/prerequisites/x86_64-w64-mingw32-static 
> --with-mpc=/c/mingw810/prerequisites/x86_64-w64-mingw32-static 
> --with-isl=/c/mingw810/prerequisites/x86_64-w64-mingw32-static 
> --with-pkgversion='x86_64-win32-seh-rev0, Built by MinGW-W64 project' 
> --with-bugurl=https://sourceforge.net/projects/mingw-w64 CFLAGS='-O2 
> -pipe -fno-ident 
> -I/c/mingw810/x86_64-810-win32-seh-rt_v6-rev0/mingw64/opt/include 
> -I/c/mingw810/prerequisites/x86_64-zlib-static/include 
> -I/c/mingw810/prerequisites/x86_64-w64-mingw32-static/include' 
> CXXFLAGS='-O2 -pipe -fno-ident 
> -I/c/mingw810/x86_64-810-win32-seh-rt_v6-rev0/mingw64/opt/include 
> -I/c/mingw810/prerequisites/x86_64-zlib-static/include 
> -I/c/mingw810/prerequisites/x86_64-w64-mingw32-static/include' 
> CPPFLAGS=' 
> -I/c/mingw810/x86_64-810-win32-seh-rt_v6-rev0/mingw64/opt/include 
> -I/c/mingw810/prerequisites/x86_64-zlib-static/include 
> -I/c/mingw810/prerequisites/x86_64-w64-mingw32-static/include' 
> LDFLAGS='-pipe -fno-ident 
> -L/c/mingw810/x86_64-810-win32-seh-rt_v6-rev0/mingw64/opt/lib 
> -L/c/mingw810/prerequisites/x86_64-zlib-static/lib 
> -L/c/mingw810/prerequisites/x86_64-w64-mingw32-static/lib '
> Thread model: win32
> gcc version 8.1.0 (x86_64-win32-seh-rev0, Built by MinGW-W64 project)

No special build args, just Meson (0.55.3) with --buildtype==debug 
-Dexamples=helloworld

DPDK builds just fine with both MinGW and Clang, but when I try and use 
it to build the SPDK the linking fails with MinGW (but works fine with 
Clang).  The error message is:
> CC app/trace_record/trace_record.o
>   LINK spdk_trace_record.exe
> C:/Users/Nick/Repos/upstream/build/lib/librte_bus_pci.a(bus_pci_windows_pci.c.obj):pci.c:(.rdata$.refptr.GUID_DEVCLASS_NET[.refptr.GUID_DEVCLASS_NET]+0x0): 
> undefined reference to `GUID_DEVCLASS_NET'

As far as I can see this is because the GUID_DEVCLASS_NET structure has 
not been created within the DPDK object files - it requires INITGUID to 
be set when devguid.h is included in order to create a 'select any' 
initialised structure.  Moving devguid.h after defining INITGUID 
resolves the issue.  Arguably, it would perhaps be better to define 
INITGUID in the source files that use the guids instead of in a shared 
header, but I think this can safely be left until after 20.11 is 
finalized - if there's any impact on the code produced it will be 
negligible.

I haven't worked it through but I suspect the reason it's ok with clang 
is because of a difference between the Microsoft headers and those 
shipped with MinGW.

Regards,
Nick

  reply	other threads:[~2020-11-20 23:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-20 21:12 Nick Connolly
2020-11-20 22:41 ` Tal Shnaiderman
2020-11-20 23:43   ` Nick Connolly [this message]
2020-11-20 23:44     ` Nick Connolly
2020-11-21 20:47     ` Dmitry Kozlyuk
2020-11-21 21:50       ` Nick Connolly
2020-11-21 22:02 ` Dmitry Kozlyuk
2020-11-21 22:54 ` [dpdk-dev] [PATCH v2] " Nick Connolly
2020-11-22  7:27   ` Tal Shnaiderman
2020-11-22  8:45 ` [dpdk-dev] [PATCH v3] " Nick Connolly
2020-11-22  9:00   ` Tal Shnaiderman
2020-11-22 17:57     ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a3ca2e1f-4e1f-ef18-6533-1b8ab42fb054@mayadata.io \
    --to=nick.connolly@mayadata.io \
    --cc=dev@dpdk.org \
    --cc=dmitry.kozliuk@gmail.com \
    --cc=dmitrym@microsoft.com \
    --cc=navasile@linux.microsoft.com \
    --cc=pallavi.kadam@intel.com \
    --cc=talshn@mellanox.com \
    --cc=talshn@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).