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
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' 
> -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 

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 

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.


  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:

* 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 \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git