Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Sergio Durigan Junior <sergiodj@redhat.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Joel Brobecker <brobecker@adacore.com>,  gdb-patches@sourceware.org
Subject: Re: MinGW build of GDB 8.2.90
Date: Thu, 28 Feb 2019 18:55:00 -0000	[thread overview]
Message-ID: <87pnrbivz4.fsf@redhat.com> (raw)
In-Reply-To: <837edjkbp4.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 28 Feb	2019 20:30:31 +0200")

On Thursday, February 28 2019, Eli Zaretskii wrote:

>> From: Joel Brobecker <brobecker@adacore.com>
>> Date: Wed, 27 Feb 2019 09:51:12 +0400 (+04)
>> 
>> I have just finished creating the gdb-8.2.90 pre-release.
>> It is available for download at the following location:
>> 
>>     ftp://sourceware.org/pub/gdb/snapshots/branch/gdb-8.2.90.tar.xz
>
> Thanks, I've built this with mingw.org's MinGW and bumped into a few
> problems.
>
> First, the recent changes to support IPv6 caused compilation errors in
> several files.  The problem is with several fragments such as this
> one:
>
>   #ifdef USE_WIN32API
>   #include <winsock2.h>
>   #include <wspiapi.h>
>   #else
>   ...
>
> mingw.org's MinGW doesn't have wspiapi.h.  Moreover, the Microsoft
> documentation indicates that to get prototypes of getaddrinfo,
> freeaddrinfo, etc. one needs to include ws2tcpip.h (and not include
> winsock2.h separately), see, for example,
>
>   https://docs.microsoft.com/en-us/windows/desktop/api/ws2tcpip/nf-ws2tcpip-getaddrinfo
>
> Sergio, can you tell why you used wspiapi.h instead?

Thanks for the report, Eli.

To be honest, I don't remember where I found the information that
wspiapi.h needed to be used, but I do remember finding it somewhere on
the internet, and since I don't use Windows, I assumed it was correct.

However, and more importantly, I remember testing the whole patch by
compiling it using a mingw32 compiler on Fedora, and it was working
correctly.  In fact, we even have a mingw32 builder on our BuildBot
(running on Fedora), and it is still compiling GDB without problems:

  https://gdb-build.sergiodj.net/builders/Fedora-x86_64-w64-mingw32

So apparently this error is only triggered when you use mingw on
Windows...?  I don't know.

> Is it okay to push changes such as the one below, master and branch
> (after filing a Bugzilla report)?
>
> --- ./gdb/common/netstuff.c~0	2019-02-27 06:51:50.000000000 +0200
> +++ ./gdb/common/netstuff.c	2019-02-28 08:56:07.511568800 +0200
> @@ -21,8 +21,11 @@
>  #include <algorithm>
>  
>  #ifdef USE_WIN32API
> -#include <winsock2.h>
> -#include <wspiapi.h>
> +#if _WIN32_WINNT < 0x0501
> +# undef _WIN32_WINNT
> +# define _WIN32_WINNT 0x0501
> +#endif
> +#include <ws2tcpip.h>
>  #else
>  #include <netinet/in.h>
>  #include <arpa/inet.h>

As I said, I don't use Windows and don't understand the system, but if
these changes fix the problem for you, I'd say they're justified and
should be pushed (even though I don't understand the "if
_WIN32_WINNT..." part).

> Note that one other side effect of the IPv6 support additions is that
> on MS-Windows GDB will no longer run on versions older than XP, I
> guess this is something that should be mentioned in NEWS?

I confess I did not know that.  If that's the case, then we should
indeed notify the users via the NEWS file, IMO.

> The other two problems were minor warning, one in tui.c about an
> unused variable 'cap' (it is not used on Windows) and another in
> xml-syscall.c:
>
>        CXX    xml-syscall.o
>      xml-syscall.c: In function 'bool xml_list_syscalls_by_group(gdbarch*, const char*, std::vector<int>*)':
>      xml-syscall.c:475:14: warning: types may not be defined in a for-range-declaration
> 	for (const struct syscall_desc *sysdesc : groupdesc->syscalls)
> 		   ^~~~~~
>
> I solved the latter by removing "struct" from the declaration.  This
> is with GCC 6.3.0; is that a GCC bug? is removing "struct" the right
> solution?

Yeah, this is the right thing to do.  I remember having to do this a few
times, and seeing other patches doing the same.

Thanks,

-- 
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF  31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/


  reply	other threads:[~2019-02-28 18:55 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-27  5:51 GDB 8.2.90 available for testing Joel Brobecker
2019-02-27 22:05 ` Jim Wilson
2019-03-04 11:15   ` Andrew Burgess
2019-03-04 13:57     ` Alan Hayward
2019-03-04 20:00     ` Jim Wilson
2019-02-28 18:31 ` MinGW build of GDB 8.2.90 (was: GDB 8.2.90 available for testing) Eli Zaretskii
2019-02-28 18:55   ` Sergio Durigan Junior [this message]
2019-02-28 19:06     ` MinGW build of GDB 8.2.90 LRN
2019-02-28 19:45     ` Eli Zaretskii
2019-02-28 20:17       ` Sergio Durigan Junior
2019-02-28 20:29         ` Eli Zaretskii
2019-02-28 20:37           ` Sergio Durigan Junior
2019-02-28 18:34 ` GDB 8.2.90 available for testing Eli Zaretskii
2019-03-01 16:35   ` Pedro Alves
2019-03-01 18:50     ` Tom Tromey
2019-03-07 22:44     ` Tom Tromey
2019-03-08  7:46       ` Eli Zaretskii
2019-03-08 20:57         ` Tom Tromey
2019-03-09  6:13           ` Eli Zaretskii
2019-03-14 17:32             ` Tom Tromey
2019-03-14 19:49               ` Eli Zaretskii
2019-03-15 12:55                 ` Tom Tromey
2019-03-17 15:56               ` Eli Zaretskii
2019-03-17 17:31                 ` Tom Tromey
2019-03-17 18:36                   ` Eli Zaretskii
2019-03-18 14:13                     ` Tom Tromey
2019-03-18 18:08                       ` Eli Zaretskii
2019-03-07 17:42 ` Pedro Franco de Carvalho
     [not found]   ` <4d855905-32ce-ba4b-72f5-037f1796b37e@redhat.com>
2019-03-22 14:42     ` [PATCH] Fix testsuite hangs when gdb_test_multiple body errors out (Re: GDB 8.2.90 available for testing) Simon Marchi
2019-03-25 13:23       ` Pedro Alves
2019-03-22 20:44     ` Pedro Franco de Carvalho
2019-03-25 13:21       ` Pedro Alves
2019-03-25 19:43         ` Pedro Franco de Carvalho
2019-03-26 18:58           ` Pedro Alves
2019-03-26 21:01             ` Pedro Franco de Carvalho
2019-03-28 17:36               ` Joel Brobecker

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=87pnrbivz4.fsf@redhat.com \
    --to=sergiodj@redhat.com \
    --cc=brobecker@adacore.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    /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