public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug build/26068] New: MinGW build failed due to ws2_32 dependency
@ 2020-06-02 16:54 mitza at objectcomputing dot com
  2020-06-02 17:20 ` [Bug build/26068] " mitza at objectcomputing dot com
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: mitza at objectcomputing dot com @ 2020-06-02 16:54 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=26068

            Bug ID: 26068
           Summary: MinGW build failed due to ws2_32 dependency
           Product: gdb
           Version: 9.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: build
          Assignee: unassigned at sourceware dot org
          Reporter: mitza at objectcomputing dot com
  Target Milestone: ---

Using x86_64-w64-mingw32 to compile gdb, link step for gdb.exe fails due to
libraries being listed in the wrong order.

C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
../gnulib/import/libgnu.a(inet_ntop.o): in function `rpl_inet_ntop':
C:\3rdparty\binutils-gdb\build\gnulib\import/../../../gnulib/import/inet_ntop.c:58:
undefined reference to `__imp_inet_ntop'
collect2.exe: error: ld returned 1 exit status

Fixed by:
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -611,7 +611,7 @@ CLIBS = $(SIM) $(READLINE) $(OPCODES) $(BFD) $(LIBCTF)
$(ZLIB) \
        $(XM_CLIBS) $(GDBTKLIBS) \
        @LIBS@ @GUILE_LIBS@ @PYTHON_LIBS@ \
        $(LIBEXPAT) $(LIBLZMA) $(LIBBABELTRACE) $(LIBIPT) \
-       $(LIBIBERTY) $(WIN32LIBS) $(LIBGNU) $(LIBICONV) $(LIBMPFR) \
+       $(LIBIBERTY) $(LIBGNU) $(WIN32LIBS) $(LIBICONV) $(LIBMPFR) \
        $(SRCHIGH_LIBS) $(LIBXXHASH) $(PTHREAD_LIBS)
 CDEPS = $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE_DEPS) $(LIBCTF) \
        $(OPCODES) $(INTL_DEPS) $(LIBIBERTY) $(CONFIG_DEPS) $(LIBGNU)

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug build/26068] MinGW build failed due to ws2_32 dependency
  2020-06-02 16:54 [Bug build/26068] New: MinGW build failed due to ws2_32 dependency mitza at objectcomputing dot com
@ 2020-06-02 17:20 ` mitza at objectcomputing dot com
  2020-06-02 22:41 ` simark at simark dot ca
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: mitza at objectcomputing dot com @ 2020-06-02 17:20 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=26068

Adam Mitz <mitza at objectcomputing dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
              Build|                            |x86_64-w64-mingw32
               Host|                            |x86_64-w64-mingw32

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug build/26068] MinGW build failed due to ws2_32 dependency
  2020-06-02 16:54 [Bug build/26068] New: MinGW build failed due to ws2_32 dependency mitza at objectcomputing dot com
  2020-06-02 17:20 ` [Bug build/26068] " mitza at objectcomputing dot com
@ 2020-06-02 22:41 ` simark at simark dot ca
  2020-06-03 15:42 ` mitza at objectcomputing dot com
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: simark at simark dot ca @ 2020-06-02 22:41 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=26068

Simon Marchi <simark at simark dot ca> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |simark at simark dot ca

--- Comment #1 from Simon Marchi <simark at simark dot ca> ---
I don't see it this when cross-compiling for mingw-w64 from Linux.  But the fix
seems to make sense.  Would you mind sending the patch to the gdb-patches
mailing list please?  See:

https://sourceware.org/gdb/wiki/ContributionChecklist

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug build/26068] MinGW build failed due to ws2_32 dependency
  2020-06-02 16:54 [Bug build/26068] New: MinGW build failed due to ws2_32 dependency mitza at objectcomputing dot com
  2020-06-02 17:20 ` [Bug build/26068] " mitza at objectcomputing dot com
  2020-06-02 22:41 ` simark at simark dot ca
@ 2020-06-03 15:42 ` mitza at objectcomputing dot com
  2020-06-03 19:20 ` simark at simark dot ca
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: mitza at objectcomputing dot com @ 2020-06-03 15:42 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=26068

--- Comment #2 from Adam Mitz <mitza at objectcomputing dot com> ---
(In reply to Simon Marchi from comment #1)
> I don't see it this when cross-compiling for mingw-w64 from Linux. 

I had less success with this, I'm hitting some unrelated build error before it
gets there.  Probably an issue with my local setup.

configured (on Ubuntu 18.04) with: --host=x86_64-w64-mingw32
--enable-targets=all

In file included from ../../intl/plural.y:35:0:
../../intl/plural-exp.h:102:23: error: conflicting types for
‘libintl_gettextparse’

> But the
> fix seems to make sense.  Would you mind sending the patch to the
> gdb-patches mailing list please?  See:
> 
> https://sourceware.org/gdb/wiki/ContributionChecklist

Will do

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug build/26068] MinGW build failed due to ws2_32 dependency
  2020-06-02 16:54 [Bug build/26068] New: MinGW build failed due to ws2_32 dependency mitza at objectcomputing dot com
                   ` (2 preceding siblings ...)
  2020-06-03 15:42 ` mitza at objectcomputing dot com
@ 2020-06-03 19:20 ` simark at simark dot ca
  2020-06-03 19:24 ` cbiesinger at google dot com
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: simark at simark dot ca @ 2020-06-03 19:20 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=26068

--- Comment #3 from Simon Marchi <simark at simark dot ca> ---
(In reply to Adam Mitz from comment #2)
> (In reply to Simon Marchi from comment #1)
> > I don't see it this when cross-compiling for mingw-w64 from Linux. 
> 
> I had less success with this, I'm hitting some unrelated build error before
> it gets there.  Probably an issue with my local setup.
> 
> configured (on Ubuntu 18.04) with: --host=x86_64-w64-mingw32
> --enable-targets=all
> 
> In file included from ../../intl/plural.y:35:0:
> ../../intl/plural-exp.h:102:23: error: conflicting types for
> ‘libintl_gettextparse’

Ok, strange.  For reference, this is my configure line for my mingw-w64 build:

$ path/to/configure 'CC=ccache x86_64-w64-mingw32-gcc' 'CXX=ccache
x86_64-w64-mingw32-g++' '--disable-binutils' '--disable-gold' '--disable-ld'
'--disable-gprof' '--disable-gas' '--host=x86_64-w64-mingw32'

It is with Ubuntu 20.04, but I also used it on Ubuntu 18.04 before upgrading.

> > But the
> > fix seems to make sense.  Would you mind sending the patch to the
> > gdb-patches mailing list please?  See:
> > 
> > https://sourceware.org/gdb/wiki/ContributionChecklist
> 
> Will do

Thanks!

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug build/26068] MinGW build failed due to ws2_32 dependency
  2020-06-02 16:54 [Bug build/26068] New: MinGW build failed due to ws2_32 dependency mitza at objectcomputing dot com
                   ` (3 preceding siblings ...)
  2020-06-03 19:20 ` simark at simark dot ca
@ 2020-06-03 19:24 ` cbiesinger at google dot com
  2020-06-04 20:45 ` ssbssa at sourceware dot org
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: cbiesinger at google dot com @ 2020-06-03 19:24 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=26068

Christian Biesinger <cbiesinger at google dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |cbiesinger at google dot com

--- Comment #4 from Christian Biesinger <cbiesinger at google dot com> ---
Hm, I don't think I've seen that error before. Could you share some details
about your setup? What configure line did you use?

The patch does look reasonable.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug build/26068] MinGW build failed due to ws2_32 dependency
  2020-06-02 16:54 [Bug build/26068] New: MinGW build failed due to ws2_32 dependency mitza at objectcomputing dot com
                   ` (4 preceding siblings ...)
  2020-06-03 19:24 ` cbiesinger at google dot com
@ 2020-06-04 20:45 ` ssbssa at sourceware dot org
  2020-06-04 20:46 ` cbiesinger at google dot com
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: ssbssa at sourceware dot org @ 2020-06-04 20:45 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=26068

Hannes Domani <ssbssa at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ssbssa at sourceware dot org

--- Comment #5 from Hannes Domani <ssbssa at sourceware dot org> ---
I think his mingw-w64 was configured with --with-default-win32-winnt=0x600 (or
higher), because then inet_ntop will be found by the gnulib configure, defines
HAVE_DECL_INET_NTOP=1, and this gets you to inet_ntop.c:58 where the function
is used.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug build/26068] MinGW build failed due to ws2_32 dependency
  2020-06-02 16:54 [Bug build/26068] New: MinGW build failed due to ws2_32 dependency mitza at objectcomputing dot com
                   ` (5 preceding siblings ...)
  2020-06-04 20:45 ` ssbssa at sourceware dot org
@ 2020-06-04 20:46 ` cbiesinger at google dot com
  2020-06-04 22:36 ` mitza at objectcomputing dot com
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: cbiesinger at google dot com @ 2020-06-04 20:46 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=26068

--- Comment #6 from Christian Biesinger <cbiesinger at google dot com> ---
Ah, that makes sense, thanks!

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug build/26068] MinGW build failed due to ws2_32 dependency
  2020-06-02 16:54 [Bug build/26068] New: MinGW build failed due to ws2_32 dependency mitza at objectcomputing dot com
                   ` (6 preceding siblings ...)
  2020-06-04 20:46 ` cbiesinger at google dot com
@ 2020-06-04 22:36 ` mitza at objectcomputing dot com
  2020-06-04 22:45 ` ssbssa at sourceware dot org
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: mitza at objectcomputing dot com @ 2020-06-04 22:36 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=26068

--- Comment #7 from Adam Mitz <mitza at objectcomputing dot com> ---
(In reply to Hannes Domani from comment #5)
> I think his mingw-w64 was configured with --with-default-win32-winnt=0x600
> (or higher), because then inet_ntop will be found by the gnulib configure,
> defines HAVE_DECL_INET_NTOP=1, and this gets you to inet_ntop.c:58 where the
> function is used.

I haven't seen the --with-default-win32-winnt option, but maybe it's hiding
somewhere.  The two MinGW compilers I tried are:

1. Native Windows

$ g++ -v
Using built-in specs.
COLLECT_GCC=C:\msys64\mingw64\bin\g++.exe
COLLECT_LTO_WRAPPER=C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../gcc-9.2.0/configure --prefix=/mingw64
--with-local-prefix=/mingw64/local --build=x86_64-w64-mingw32
--host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32
--with-native-system-header-dir=/mingw64/x86_64-w64-mingw32/include
--libexecdir=/mingw64/lib --enable-bootstrap --with-arch=x86-64
--with-tune=generic --enable-languages=c,lto,c++,fortran,ada,objc,obj-c++
--enable-shared --enable-static --enable-libatomic --enable-threads=posix
--enable-graphite --enable-fully-dynamic-string
--enable-libstdcxx-filesystem-ts=yes --enable-libstdcxx-time=yes
--disable-libstdcxx-pch --disable-libstdcxx-debug --disable-isl-version-check
--enable-lto --enable-libgomp --disable-multilib --enable-checking=release
--disable-rpath --disable-win32-registry --disable-nls --disable-werror
--disable-symvers --enable-plugin --with-libiconv --with-system-zlib
--with-gmp=/mingw64 --with-mpfr=/mingw64 --with-mpc=/mingw64
--with-isl=/mingw64 --with-pkgversion='Rev2, Built by MSYS2 project'
--with-bugurl=https://sourceforge.net/projects/msys2 --with-gnu-as
--with-gnu-ld
Thread model: posix
gcc version 9.2.0 (Rev2, Built by MSYS2 project)

2. Cross-compiler on Ubuntu 18.04

$ x86_64-w64-mingw32-g++ -v
Using built-in specs.
COLLECT_GCC=x86_64-w64-mingw32-g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-w64-mingw32/7.3-win32/lto-wrapper
Target: x86_64-w64-mingw32
Configured with: ../../src/configure --build=x86_64-linux-gnu --prefix=/usr
--includedir='/usr/include' --mandir='/usr/share/man'
--infodir='/usr/share/info' --sysconfdir=/etc --localstatedir=/var
--disable-silent-rules --libdir='/usr/lib/x86_64-linux-gnu'
--libexecdir='/usr/lib/x86_64-linux-gnu' --disable-maintainer-mode
--disable-dependency-tracking --prefix=/usr --enable-shared --enable-static
--disable-multilib --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --libdir=/usr/lib --enable-libstdcxx-time=yes
--with-tune=generic --with-headers=/usr/x86_64-w64-mingw32/include
--enable-version-specific-runtime-libs --enable-fully-dynamic-string
--enable-libgomp --enable-languages=c,c++,fortran,objc,obj-c++,ada --enable-lto
--with-plugin-ld --enable-threads=win32 --program-suffix=-win32
--program-prefix=x86_64-w64-mingw32- --target=x86_64-w64-mingw32
--with-as=/usr/bin/x86_64-w64-mingw32-as
--with-ld=/usr/bin/x86_64-w64-mingw32-ld --enable-libatomic
--enable-libstdcxx-filesystem-ts=yes
Thread model: win32
gcc version 7.3-win32 20180312 (GCC)

The other problem I listed (not really the subject of this PR)
> ../../intl/plural-exp.h:102:23: error: conflicting types for ‘libintl_gettextparse’

seems to occur when the build generates a new plural.c using bison.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug build/26068] MinGW build failed due to ws2_32 dependency
  2020-06-02 16:54 [Bug build/26068] New: MinGW build failed due to ws2_32 dependency mitza at objectcomputing dot com
                   ` (7 preceding siblings ...)
  2020-06-04 22:36 ` mitza at objectcomputing dot com
@ 2020-06-04 22:45 ` ssbssa at sourceware dot org
  2021-06-11 21:00 ` alfedotov at gmail dot com
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: ssbssa at sourceware dot org @ 2020-06-04 22:45 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=26068

--- Comment #8 from Hannes Domani <ssbssa at sourceware dot org> ---
(In reply to Adam Mitz from comment #7)
> I haven't seen the --with-default-win32-winnt option, but maybe it's hiding
> somewhere.  The two MinGW compilers I tried are:

It's not in gcc directly, but in mingw-w64.
The default is 0x502, but msys2 apparently uses 0x601 [1].

[1]
https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-headers-git/PKGBUILD#L55

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug build/26068] MinGW build failed due to ws2_32 dependency
  2020-06-02 16:54 [Bug build/26068] New: MinGW build failed due to ws2_32 dependency mitza at objectcomputing dot com
                   ` (8 preceding siblings ...)
  2020-06-04 22:45 ` ssbssa at sourceware dot org
@ 2021-06-11 21:00 ` alfedotov at gmail dot com
  2022-12-02 18:32 ` tromey at sourceware dot org
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: alfedotov at gmail dot com @ 2021-06-11 21:00 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=26068

Alexander Fedotov <alfedotov at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |alfedotov at gmail dot com

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug build/26068] MinGW build failed due to ws2_32 dependency
  2020-06-02 16:54 [Bug build/26068] New: MinGW build failed due to ws2_32 dependency mitza at objectcomputing dot com
                   ` (9 preceding siblings ...)
  2021-06-11 21:00 ` alfedotov at gmail dot com
@ 2022-12-02 18:32 ` tromey at sourceware dot org
  2022-12-02 18:33 ` tromey at sourceware dot org
  2022-12-02 18:37 ` mitza at objectcomputing dot com
  12 siblings, 0 replies; 14+ messages in thread
From: tromey at sourceware dot org @ 2022-12-02 18:32 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=26068

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |markus.boeck02 at gmail dot com

--- Comment #9 from Tom Tromey <tromey at sourceware dot org> ---
*** Bug 26117 has been marked as a duplicate of this bug. ***

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug build/26068] MinGW build failed due to ws2_32 dependency
  2020-06-02 16:54 [Bug build/26068] New: MinGW build failed due to ws2_32 dependency mitza at objectcomputing dot com
                   ` (10 preceding siblings ...)
  2022-12-02 18:32 ` tromey at sourceware dot org
@ 2022-12-02 18:33 ` tromey at sourceware dot org
  2022-12-02 18:37 ` mitza at objectcomputing dot com
  12 siblings, 0 replies; 14+ messages in thread
From: tromey at sourceware dot org @ 2022-12-02 18:33 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=26068

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at sourceware dot org

--- Comment #10 from Tom Tromey <tromey at sourceware dot org> ---
What ever happened with this patch?
It seemed pretty straightforward & fine to me.
I can't test it though.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug build/26068] MinGW build failed due to ws2_32 dependency
  2020-06-02 16:54 [Bug build/26068] New: MinGW build failed due to ws2_32 dependency mitza at objectcomputing dot com
                   ` (11 preceding siblings ...)
  2022-12-02 18:33 ` tromey at sourceware dot org
@ 2022-12-02 18:37 ` mitza at objectcomputing dot com
  12 siblings, 0 replies; 14+ messages in thread
From: mitza at objectcomputing dot com @ 2022-12-02 18:37 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=26068

--- Comment #11 from Adam Mitz <mitza at objectcomputing dot com> ---
I didn't come back to it after
https://sourceware.org/pipermail/gdb-patches/2020-June/169376.html

The project I was potentially going to use a from-source build of GDB on ended
up going in a different direction.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2022-12-02 18:37 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-02 16:54 [Bug build/26068] New: MinGW build failed due to ws2_32 dependency mitza at objectcomputing dot com
2020-06-02 17:20 ` [Bug build/26068] " mitza at objectcomputing dot com
2020-06-02 22:41 ` simark at simark dot ca
2020-06-03 15:42 ` mitza at objectcomputing dot com
2020-06-03 19:20 ` simark at simark dot ca
2020-06-03 19:24 ` cbiesinger at google dot com
2020-06-04 20:45 ` ssbssa at sourceware dot org
2020-06-04 20:46 ` cbiesinger at google dot com
2020-06-04 22:36 ` mitza at objectcomputing dot com
2020-06-04 22:45 ` ssbssa at sourceware dot org
2021-06-11 21:00 ` alfedotov at gmail dot com
2022-12-02 18:32 ` tromey at sourceware dot org
2022-12-02 18:33 ` tromey at sourceware dot org
2022-12-02 18:37 ` mitza at objectcomputing dot com

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 read-only IMAP folder(s) and NNTP newsgroup(s).