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

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