From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id viUmAqX1/2rzIyMAWB0awg (envelope-from ) for ; Fri, 20 Nov 2026 02:24:21 -0500 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=gnu.org header.i=@gnu.org header.a=rsa-sha256 header.s=fencepost-gnu-org header.b=AVc/krVg; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id DF8CE1E087; Fri, 20 Nov 2026 02:24:20 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id A58E51E087 for ; Fri, 20 Nov 2026 02:24:19 -0500 (EST) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 177894BC0546 for ; Fri, 20 Nov 2026 07:24:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 177894BC0546 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gnu.org header.i=@gnu.org header.a=rsa-sha256 header.s=fencepost-gnu-org header.b=AVc/krVg Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 6BA574B920BF for ; Fri, 20 Nov 2026 07:23:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6BA574B920BF Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gnu.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 6BA574B920BF Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2001:470:142:3::10 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1795159434; cv=none; b=MhBJZkQDzgJQKI4jWQvBK2d27Wg7RIvhgJ76utpRLcDRAecSibuq+uTjNSN0od7+ItNMJxEJsVZ7FHbnvjT4IYkSbggfQOcjsh1sy09T7DdNH7+3W/dDfq9uqlwlzgrTBVPju+uJvCUZ5Iqy6URtCY9d6oHmxeRYW1ykla4Zryc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1795159434; c=relaxed/simple; bh=+uO1a1nVZTR+4fyZoK8wPTvJykWIF5blmB7HW77fHhA=; h=DKIM-Signature:Date:Message-Id:From:To:Subject; b=sVXhz/v6f3s1h8xR4x48x+T94BOEQykl4fGRz3p5pnEHJQX/yeMESuaqHKRi+wHDwwbNFjvG9HHK0HPeMc7osT93POTZcUbGZlWuSiuwWBgRKHzvXLqQTGExEAcxD8pb7GlUvQfG2xyQPhntaWNT9FdlXnV8GzmTqkt6lKPZuIw= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gnu.org header.i=@gnu.org header.a=rsa-sha256 header.s=fencepost-gnu-org header.b=AVc/krVg DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6BA574B920BF Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xUIyO-0002rL-H9; Fri, 20 Nov 2026 02:23:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=g15l4dxctVPyLqfh5x2qkgfykvEv+2fwk05Dl+tfmzM=; b=AVc/krVgX/1v Lq/S3Hs/7ObxTnbDoJYeyKv+1Kyvmn2ZPkxGAWd15bMtbggtCjbX+TiVbcZlk07XZ8bLMbMhvLFz6 7ZfNHvcy/0X3qT3iVkQbNPHOT3sYIDcjdM42zUT2+TmA3qCP96GJNUpMjlj4RqUrQmzTAbjWSAcb6 2tRrdsJ3uWOsgxGassjBjR8fpS/amTR8epi1tF2tf3ytYT65Gsd9TvRNbDp1KFUBehBQpiH2qcyPg iRPsZ1j2mfEQVbIYnr7jfDMMFizE1odopDxxoOWzRVMJUTscBzbf+DZhGo7xSYN6QGbQOghVGR7uC qkqt/XA9mRHS8b4/mYUlkQ==; Date: Fri, 20 Nov 2026 09:23:49 +0200 Message-Id: <86pkw0j796.fsf@gnu.org> From: Eli Zaretskii To: Tom Tromey Cc: Nikita.Venkatesh@arm.com, gdb-patches@sourceware.org, nd@arm.com In-Reply-To: <87y0aoy2af.fsf@tromey.com> (message from Tom Tromey on Thu, 19 Nov 2026 13:49:44 -0700) Subject: Re: [PATCH] Default to Vista APIs (0x0600) when _WIN32_WINNT is undefined References: <20261119175605.3837218-1-Nikita.Venkatesh@arm.com> <87y0aoy2af.fsf@tromey.com> X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org > From: Tom Tromey > Cc: gdb-patches@sourceware.org, nd@arm.com > Date: Thu, 19 Nov 2026 13:49:44 -0700 > > >>>>> Nikita Venkatesh 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.