public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* MinGW build of GDB 13 snapshot
@ 2022-12-17 17:16 Eli Zaretskii
  2022-12-19 21:14 ` Tom Tromey
  0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2022-12-17 17:16 UTC (permalink / raw)
  To: gdb-patches; +Cc: Joel Brobecker

I've built the latest snapshot 13.0.50.20221217-git of GDB using
mingw.org's MinGW on MS-Windows.  I saw only two issues with this
build, described below.

One of those issues is in the bfd directory, and I will report it to
the Binutils list.  I'm asking here what to do with that issue
meanwhile: do I install a fix for it in our copy of bfd, or do I wait
for Binutils folks to fix it up-stream?  The fix is simple:

--- bfd/bfdio.c~0	2022-12-17 03:47:10.000000000 +0200
+++ bfd/bfdio.c	2022-12-17 16:45:38.067750000 +0200
@@ -31,8 +31,10 @@
 #include <locale.h>
 #endif
 
-#if defined(__MINGW64_VERSION_MAJOR) && __MINGW64_VERSION_MAJOR < 9
-/* This prototype was added to locale.h in version 9.0 of MinGW-w64.  */
+#if (defined(__MINGW64_VERSION_MAJOR) && __MINGW64_VERSION_MAJOR < 9)	\
+  || (defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR))
+/* This prototype was added to locale.h in version 9.0 of MinGW-w64,
+   and is absent from all versions of mingw.org's MinGW.  */
 _CRTIMP unsigned int __cdecl ___lc_codepage_func(void);
 #endif
 


The other issue is with the new stuff in nat/windows-nat.c.  Here are
the compilation error messages:

       CXX    nat/windows-nat.o
     ../gdb/nat/windows-nat.c: In function 'BOOL windows_nat::create_process_wrapper(FUNC*, const CHAR*, CHAR*, DWORD, void*, const CHAR*, bool, INFO*, PROCESS_INFORMATION*)':
     ../gdb/nat/windows-nat.c:813:9: error: 'PPROC_THREAD_ATTRIBUTE_LIST' was not declared in this scope
       813 |      = (PPROC_THREAD_ATTRIBUTE_LIST) alloca (size);
	   |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
     ../gdb/nat/windows-nat.c:813:37: error: expected ';' before '__builtin_alloca'
       813 |      = (PPROC_THREAD_ATTRIBUTE_LIST) alloca (size);
	   |                                     ^
	   |                                     ;
     ../gdb/nat/windows-nat.c:831:9: error: 'EXTENDED_STARTUPINFO_PRESENT' was not declared in this scope
       831 |       | EXTENDED_STARTUPINFO_PRESENT),
	   |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

This happens because these two symbols are not visible when compiling
GDB with _WIN32_WINNT set to an older version that Windows 8.  The
patch for this is below.  OK to commit it on the master branch?

--- gdb/nat/windows-nat.c~0	2022-12-17 03:47:12.000000000 +0200
+++ gdb/nat/windows-nat.c	2022-12-17 16:46:20.817750000 +0200
@@ -802,6 +802,10 @@ create_process_wrapper (FUNC *do_create_
 
 	  gdb_extended_info info_ex {};
 
+#	  ifndef EXTENDED_STARTUPINFO_PRESENT
+#	   define EXTENDED_STARTUPINFO_PRESENT 0x00080000
+#	  endif
+
 	  if (startup_info != nullptr)
 	    info_ex.StartupInfo = *startup_info;
 	  info_ex.StartupInfo.cb = sizeof (info_ex);
@@ -810,7 +814,7 @@ create_process_wrapper (FUNC *do_create_
 	     call always fails, by design.  */
 	  InitializeProcThreadAttributeList (nullptr, 1, 0, &size);
 	  info_ex.lpAttributeList
-	    = (PPROC_THREAD_ATTRIBUTE_LIST) alloca (size);
+	    = (gdb_lpproc_thread_attribute_list) alloca (size);
 	  InitializeProcThreadAttributeList (info_ex.lpAttributeList,
 					     1, 0, &size);
 

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

* Re: MinGW build of GDB 13 snapshot
  2022-12-17 17:16 MinGW build of GDB 13 snapshot Eli Zaretskii
@ 2022-12-19 21:14 ` Tom Tromey
  2022-12-20 14:12   ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: Tom Tromey @ 2022-12-19 21:14 UTC (permalink / raw)
  To: Eli Zaretskii via Gdb-patches; +Cc: Eli Zaretskii, Joel Brobecker

>>>>> "Eli" == Eli Zaretskii via Gdb-patches <gdb-patches@sourceware.org> writes:

Eli> One of those issues is in the bfd directory, and I will report it to
Eli> the Binutils list.  I'm asking here what to do with that issue
Eli> meanwhile: do I install a fix for it in our copy of bfd, or do I wait
Eli> for Binutils folks to fix it up-stream?  The fix is simple:

IMO it's fine to put on the gdb 13 branch.
I suppose if binutils wants changes we can consider putting their
approved version on the branch instead.

Eli> The other issue is with the new stuff in nat/windows-nat.c.  Here are
Eli> the compilation error messages:
...
Eli> This happens because these two symbols are not visible when compiling
Eli> GDB with _WIN32_WINNT set to an older version that Windows 8.  The
Eli> patch for this is below.  OK to commit it on the master branch?

This is ok.  Thank you. 

Tom

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

* Re: MinGW build of GDB 13 snapshot
  2022-12-19 21:14 ` Tom Tromey
@ 2022-12-20 14:12   ` Eli Zaretskii
  2022-12-21  3:26     ` Joel Brobecker
  0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2022-12-20 14:12 UTC (permalink / raw)
  To: Tom Tromey, brobecker; +Cc: gdb-patches

> From: Tom Tromey <tom@tromey.com>
> Cc: Eli Zaretskii <eliz@gnu.org>,  Joel Brobecker <brobecker@adacore.com>
> Date: Mon, 19 Dec 2022 14:14:35 -0700
> 
> >>>>> "Eli" == Eli Zaretskii via Gdb-patches <gdb-patches@sourceware.org> writes:
> 
> Eli> One of those issues is in the bfd directory, and I will report it to
> Eli> the Binutils list.  I'm asking here what to do with that issue
> Eli> meanwhile: do I install a fix for it in our copy of bfd, or do I wait
> Eli> for Binutils folks to fix it up-stream?  The fix is simple:
> 
> IMO it's fine to put on the gdb 13 branch.
> I suppose if binutils wants changes we can consider putting their
> approved version on the branch instead.

The problem is now fixed in upstream Binutils, see

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

So I think I will fix this on the gdb 13 branch only, and master will
be fixed in due time when we import the latest BFD?  Or do you want me
to fix this on both branches?  Joel?

> Eli> The other issue is with the new stuff in nat/windows-nat.c.  Here are
> Eli> the compilation error messages:
> ...
> Eli> This happens because these two symbols are not visible when compiling
> Eli> GDB with _WIN32_WINNT set to an older version that Windows 8.  The
> Eli> patch for this is below.  OK to commit it on the master branch?
> 
> This is ok.  Thank you. 

Thanks, will install soon.

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

* Re: MinGW build of GDB 13 snapshot
  2022-12-20 14:12   ` Eli Zaretskii
@ 2022-12-21  3:26     ` Joel Brobecker
  2022-12-22 10:46       ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: Joel Brobecker @ 2022-12-21  3:26 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Tom Tromey, brobecker, gdb-patches

Hi Eli,

On Tue, Dec 20, 2022 at 04:12:12PM +0200, Eli Zaretskii wrote:
> > From: Tom Tromey <tom@tromey.com>
> > Cc: Eli Zaretskii <eliz@gnu.org>,  Joel Brobecker <brobecker@adacore.com>
> > Date: Mon, 19 Dec 2022 14:14:35 -0700
> > 
> > >>>>> "Eli" == Eli Zaretskii via Gdb-patches <gdb-patches@sourceware.org> writes:
> > 
> > Eli> One of those issues is in the bfd directory, and I will report it to
> > Eli> the Binutils list.  I'm asking here what to do with that issue
> > Eli> meanwhile: do I install a fix for it in our copy of bfd, or do I wait
> > Eli> for Binutils folks to fix it up-stream?  The fix is simple:
> > 
> > IMO it's fine to put on the gdb 13 branch.
> > I suppose if binutils wants changes we can consider putting their
> > approved version on the branch instead.
> 
> The problem is now fixed in upstream Binutils, see
> 
>   https://sourceware.org/bugzilla/show_bug.cgi?id=29915
> 
> So I think I will fix this on the gdb 13 branch only, and master will
> be fixed in due time when we import the latest BFD?  Or do you want me
> to fix this on both branches?  Joel?

Binutils and GDB share the same repository, so it's the same master
branch. Alan's fix on master, if you confirm fixes the problem on
master, can be cherry-picked to the gdb-13-branch.

Otherwise, if Alan's fix does not work, we can indeed start with
your patch in gdb-13-branch, and wait for master to get fixed
via the binutils team.

-- 
Joel

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

* Re: MinGW build of GDB 13 snapshot
  2022-12-21  3:26     ` Joel Brobecker
@ 2022-12-22 10:46       ` Eli Zaretskii
  2022-12-23  3:28         ` Joel Brobecker
  0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2022-12-22 10:46 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: tom, gdb-patches

> Date: Wed, 21 Dec 2022 07:26:49 +0400
> From: Joel Brobecker <brobecker@adacore.com>
> Cc: Tom Tromey <tom@tromey.com>, brobecker@adacore.com,
> 	gdb-patches@sourceware.org
> 
> > The problem is now fixed in upstream Binutils, see
> > 
> >   https://sourceware.org/bugzilla/show_bug.cgi?id=29915
> > 
> > So I think I will fix this on the gdb 13 branch only, and master will
> > be fixed in due time when we import the latest BFD?  Or do you want me
> > to fix this on both branches?  Joel?
> 
> Binutils and GDB share the same repository, so it's the same master
> branch. Alan's fix on master, if you confirm fixes the problem on
> master, can be cherry-picked to the gdb-13-branch.
> 
> Otherwise, if Alan's fix does not work, we can indeed start with
> your patch in gdb-13-branch, and wait for master to get fixed
> via the binutils team.

OK, done.

I also installed the other patch, approved by Tom.

Thanks.

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

* Re: MinGW build of GDB 13 snapshot
  2022-12-22 10:46       ` Eli Zaretskii
@ 2022-12-23  3:28         ` Joel Brobecker
  2022-12-23  8:07           ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: Joel Brobecker @ 2022-12-23  3:28 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Joel Brobecker, tom, gdb-patches

Hi Eli,

On Thu, Dec 22, 2022 at 12:46:14PM +0200, Eli Zaretskii wrote:
> > Date: Wed, 21 Dec 2022 07:26:49 +0400
> > From: Joel Brobecker <brobecker@adacore.com>
> > Cc: Tom Tromey <tom@tromey.com>, brobecker@adacore.com,
> > 	gdb-patches@sourceware.org
> > 
> > > The problem is now fixed in upstream Binutils, see
> > > 
> > >   https://sourceware.org/bugzilla/show_bug.cgi?id=29915
> > > 
> > > So I think I will fix this on the gdb 13 branch only, and master will
> > > be fixed in due time when we import the latest BFD?  Or do you want me
> > > to fix this on both branches?  Joel?
> > 
> > Binutils and GDB share the same repository, so it's the same master
> > branch. Alan's fix on master, if you confirm fixes the problem on
> > master, can be cherry-picked to the gdb-13-branch.
> > 
> > Otherwise, if Alan's fix does not work, we can indeed start with
> > your patch in gdb-13-branch, and wait for master to get fixed
> > via the binutils team.
> 
> OK, done.
> 
> I also installed the other patch, approved by Tom.

Thank you.

Just for the avoidance of doubt: On the gdb-13-branch, I see
you cherry-picked Alan's change and then applied the fix for
the other issue you noticed.

What about master? Alan's change was pushed by Alan himself
a few days ago, but what about the fix for the other issue?
Did you push it there as well? I don't seem to be able to
see it.

-- 
Joel

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

* Re: MinGW build of GDB 13 snapshot
  2022-12-23  3:28         ` Joel Brobecker
@ 2022-12-23  8:07           ` Eli Zaretskii
  2022-12-23  9:13             ` Joel Brobecker
  0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2022-12-23  8:07 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: tom, gdb-patches

> Date: Fri, 23 Dec 2022 07:28:54 +0400
> From: Joel Brobecker <brobecker@adacore.com>
> Cc: Joel Brobecker <brobecker@adacore.com>, tom@tromey.com,
> 	gdb-patches@sourceware.org
> 
> What about master? Alan's change was pushed by Alan himself
> a few days ago, but what about the fix for the other issue?
> Did you push it there as well? I don't seem to be able to
> see it.

Sorry, I forgot about master when I installed the changes in
windows-nat.c.

Should I cherry-pick the change from gdb-13-branch to master?

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

* Re: MinGW build of GDB 13 snapshot
  2022-12-23  8:07           ` Eli Zaretskii
@ 2022-12-23  9:13             ` Joel Brobecker
  2022-12-23 11:21               ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: Joel Brobecker @ 2022-12-23  9:13 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Joel Brobecker, tom, gdb-patches

> > What about master? Alan's change was pushed by Alan himself
> > a few days ago, but what about the fix for the other issue?
> > Did you push it there as well? I don't seem to be able to
> > see it.
> 
> Sorry, I forgot about master when I installed the changes in
> windows-nat.c.
> 
> Should I cherry-pick the change from gdb-13-branch to master?

Sure! That should work.

-- 
Joel

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

* Re: MinGW build of GDB 13 snapshot
  2022-12-23  9:13             ` Joel Brobecker
@ 2022-12-23 11:21               ` Eli Zaretskii
  0 siblings, 0 replies; 9+ messages in thread
From: Eli Zaretskii @ 2022-12-23 11:21 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: brobecker, tom, gdb-patches

> Date: Fri, 23 Dec 2022 13:13:45 +0400
> From: Joel Brobecker <brobecker@adacore.com>
> Cc: Joel Brobecker <brobecker@adacore.com>, tom@tromey.com,
> 	gdb-patches@sourceware.org
> 
> > > What about master? Alan's change was pushed by Alan himself
> > > a few days ago, but what about the fix for the other issue?
> > > Did you push it there as well? I don't seem to be able to
> > > see it.
> > 
> > Sorry, I forgot about master when I installed the changes in
> > windows-nat.c.
> > 
> > Should I cherry-pick the change from gdb-13-branch to master?
> 
> Sure! That should work.

Thanks, done.

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

end of thread, other threads:[~2022-12-23 11:22 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-17 17:16 MinGW build of GDB 13 snapshot Eli Zaretskii
2022-12-19 21:14 ` Tom Tromey
2022-12-20 14:12   ` Eli Zaretskii
2022-12-21  3:26     ` Joel Brobecker
2022-12-22 10:46       ` Eli Zaretskii
2022-12-23  3:28         ` Joel Brobecker
2022-12-23  8:07           ` Eli Zaretskii
2022-12-23  9:13             ` Joel Brobecker
2022-12-23 11:21               ` Eli Zaretskii

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).