Mingw64 build failure

"Willgerodt, Felix via Gdb" <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <MN2PR11MB4566AB3B5DDBF3A39F0DBFD08E2C9@MN2PR11MB4566.namprd11.prod.outlook.com>
Hi everyone,

I have some problems cross-compiling the latest gdb master branch with mingw64.
I tried a couple of different mingw64 versions on Ubuntu and Fedora 
(and even mingw64 from msys2 on Windows).

On my Fedora 34 with mingw64 in this version:
gcc version 10.3.1 20210422 (Fedora MinGW 10.3.1-2.fc34) (GCC)

I always get this error:

checking for sys/param.h... yes
checking for pid_t... /users/username/sources/gdb/gnulib/import/closedir.c: In function 'closedir':
/users/username/sources/gdb/gnulib/import/closedir.c:58:11: error: 'DIR' has no member named 'current'
   58 |   if (dirp->current != INVALID_HANDLE_VALUE)
      |           ^~
/users/username/sources/gdb/gnulib/import/closedir.c:59:20: error: 'DIR' has no member named 'current'
   59 |     FindClose (dirp->current);
      |                    ^~
make[5]: *** [Makefile:2188: closedir.o] Error 1
make[5]: *** Waiting for unfinished jobs....
yes


I see the same issue with the gdb-11-branch. Gdb-10 still compiles.
I have little knowledge with mingw and even less with gnulib. So before opening a Bugzilla,
I thought I would ask here, as there seem to be others compiling GDB with mingw64.
Has anyone seen this before?

I configure gdb like this:

$src/gdb/configure \
    --host="x86_64-w64-mingw32" \
    --build="x86_64-pc-linux-gnu" \
    --disable-binutils \
    --disable-gas \
    --disable-gprof \
    --disable-inprocess-agent \
    --disable-intl \
    --disable-ld \
    --disable-source-highlight \
    --without-mpfr \
    --with-libgmp-prefix="/users/username/builds/gmp/install"

GMP is also cross compiled as a static library:

$ tree install/
install/
------ include
-- - - ------ gmp.h
-- - - ------ gmpxx.h
------ lib
-- - - ------ libgmp.a
-- - - ------ libgmp.la
-- - - ------ libgmpxx.a
-- - - ------ libgmpxx.la
-- - - ------ pkgconfig
-- - -     ------ gmp.pc
-- - -     ------ gmpxx.pc
------ share
    ------ info
        ------ dir
        ------ gmp.info
        ------ gmp.info-1
        ------ gmp.info-2

But even if I remove “--with-libgmp-prefix”, I get the same error.

Thanks,
Felix
Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva  
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.