From: Eli Zaretskii <eliz@gnu.org>
To: Tom Tromey <tromey@adacore.com>
Cc: Nikita.Venkatesh@arm.com, gdb-patches@sourceware.org, nd@arm.com
Subject: Re: [PATCH] Default to Vista APIs (0x0600) when _WIN32_WINNT is undefined
Date: Fri, 20 Nov 2026 09:23:49 +0200 [thread overview]
Message-ID: <86pkw0j796.fsf@gnu.org> (raw)
In-Reply-To: <87y0aoy2af.fsf@tromey.com> (message from Tom Tromey on Thu, 19 Nov 2026 13:49:44 -0700)
> From: Tom Tromey <tromey@adacore.com>
> Cc: gdb-patches@sourceware.org, nd@arm.com
> Date: Thu, 19 Nov 2026 13:49:44 -0700
>
> >>>>> Nikita Venkatesh <Nikita.Venkatesh@arm.com> writes:
>
> > GCC13 added win32 C++11 threading support that requires
> > Windows Vista (0x0600) condition variable APIs. GDB's
> > XP default hides the required declarations, causing
> > GDB compilation to fail.
>
> > With --enable-threading, configure stops with an error. With automatic
> > detection, configure disables GDB threading, but compilation later
> > fails because other libstdc++ headers still require those declarations.
>
> > The following discussions were considered:
> > https://sourceware.org/pipermail/gdb/2022-November/050448.html
> > https://sourceware.org/pipermail/gdb-patches/2024-May/209176.html
>
> Please read:
>
> https://sourceware.org/pipermail/gdb-patches/2021-October/182443.html
>
> That note is the reason the code is this way.
>
> Locally at AdaCore we just patch this to use 0x0602, since we don't need
> XP support.
>
> So while I'm sympathetic to your patch, it's hard to see how we would
> ever land it.
I think we can bump _WIN32_WINNT when GDB is compiled with MinGW64.
That's because MinGW64 dropped XP support quite some time ago, so
MinGW64 cannot be used to build GDB that would work on XP. Building a
GDB which works on XP is only possible using the old mingw.org's
MinGW.
So adding a preprocessor check in that place that MinGW64 is being
used should allow then to bump _WIN32_WINNT. But AFAIR it's a bit
tricky to find a preprocessor macro that will reliably tell that
MinGW64 is being used, because the header files which define such
macros are not guaranteed to be included. I used to use something
like
#include <_mingw.h>
#if defined __MINGW64_VERSION_MAJOR
/* we are using MinGW64 */
I hope it still works with today's MinGW64.
> I feel like we discussed an idea of trying to include the relevant
> headers and, if this fails, disable threading. But TBH I don't know if
> that's even desirable.
If standard C++ threads are not supported by the compiler and the
library, threading in GDB is automatically disabled at configure time.
> > Default to 0x0600 only when _WIN32_WINNT is undefined. Preserve the
> > existing XP minimum for already defined and higher values.
>
> This is a twist on the earlier approach but I'm not sure it's any more
> acceptable.
Yes, relying on _WIN32_WINNT to be undefined is not a good idea,
because the system headers usually define it to some default value.
next prev parent reply other threads:[~2026-11-20 7:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 17:56 Nikita.Venkatesh
2026-11-19 20:49 ` Tom Tromey
2026-11-20 7:23 ` Eli Zaretskii [this message]
2026-11-25 16:48 ` [PATCH v2] Default to Vista APIs for MinGW-w64 when no version is selected Nikita.Venkatesh
2026-11-25 17:36 ` Eli Zaretskii
2026-11-26 16:53 ` [PATCH v3] " Nikita.Venkatesh
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=86pkw0j796.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=Nikita.Venkatesh@arm.com \
--cc=gdb-patches@sourceware.org \
--cc=nd@arm.com \
--cc=tromey@adacore.com \
/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