From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id uUhKDoU4/2rgyiAAWB0awg (envelope-from ) for ; Thu, 19 Nov 2026 12:57:25 -0500 Authentication-Results: simark.ca; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=foss header.b=GQn7Kkvn; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 296B61E0BC; Thu, 19 Nov 2026 12:57:25 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2 autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.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 DE4631E023 for ; Thu, 19 Nov 2026 12:57:23 -0500 (EST) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 02C284BA2E2D for ; Thu, 19 Nov 2026 17:57:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 02C284BA2E2D Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (1024-bit key, unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=foss header.b=GQn7Kkvn Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id 5D3CE4BA2E07 for ; Thu, 19 Nov 2026 17:56:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5D3CE4BA2E07 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5D3CE4BA2E07 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1795110987; cv=none; b=EjX/aL8juuB0xdOhMluOy/VDQGtusQ2mEqcxAzxHoV0P8eS0VgkXpAUECmAGO6PNKNXxGpADA+H7Vk6bR4Tfbz7Xq/WSehEjC+zqrTHAKAyd8R31db9hURuFOe770VqOWaMq+UNbYPkLVjRhcJRL+vOy/bKFO36T15jkn2wHW48= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1795110987; c=relaxed/simple; bh=aqAvZ1UiwWJE3v+JqNLOQjBed7bh6sGzS7XETfzdQTE=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=Vu9O9/60mbwtsePp//mOjJRxk4c4rUftQRV8/W2FjfcO65bTNOLquZvS8yjcwX3iyySF0uJwZHK6573JbH93S05Lnr9hSpkqfTmbKhGX0oWKFO3iF4PCIRx1acLhZfFHmwnLy6HYVsPIt4ahnpTM6KQuy2/cJXkKvtVT8vlhqBE= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=foss header.b=GQn7Kkvn DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5D3CE4BA2E07 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 99FB71575; Thu, 19 Nov 2026 09:56:23 -0800 (PST) Received: from e129758.cambridge.arm.com (e129758.arm.com [10.2.212.12]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0C7D23F673; Thu, 19 Nov 2026 09:56:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1795110986; bh=aqAvZ1UiwWJE3v+JqNLOQjBed7bh6sGzS7XETfzdQTE=; h=From:To:Cc:Subject:Date:From; b=GQn7KkvnmkRgwzaxin713dzEZmJDt6h2de6mZSs9kuhmhvpw9NH/sbxPB1/oAKJpz xR69OF0J9jYMflSHWuBxWlXjsMVwAmFXAu3ECkNoeEN1D6rJ9fnAB0T7wjBcw8V90Y ZEqEoSHR/touM8TB/qBVFS1DTiYCKDt3M72GTqmA= From: Nikita.Venkatesh@arm.com To: gdb-patches@sourceware.org Cc: nd@arm.com, Nikita Venkatesh Subject: [PATCH] Default to Vista APIs (0x0600) when _WIN32_WINNT is undefined Date: Thu, 19 Nov 2026 17:56:05 +0000 Message-Id: <20261119175605.3837218-1-Nikita.Venkatesh@arm.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: Nikita Venkatesh 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 Including as suggested in the 2024 discussion, does not resolve this with Ubuntu 24.04's mingw-w64 headers. It instead defaults to 0x0502, which is below the required 0x0600. Default to 0x0600 only when _WIN32_WINNT is undefined. Preserve the existing XP minimum for already defined and higher values. An explicitly selected XP target is preserved. However, builds using GCC's native Win32 C++11 threading support require Vista or later. Verified that full MinGW GCC 13 builds succeed with both automatic threading detection and explicit --enable-threading. --- gdb/configure | 2 +- gdbserver/configure | 2 +- gdbsupport/common-defs.h | 10 ++++++---- gdbsupport/common.m4 | 2 +- gdbsupport/configure | 2 +- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/gdb/configure b/gdb/configure index e747ffce49f..39cbc817657 100755 --- a/gdb/configure +++ b/gdb/configure @@ -21168,7 +21168,7 @@ else # define _WIN32_WINNT 0x0501 # endif # else - # define _WIN32_WINNT 0x0501 + # define _WIN32_WINNT 0x0600 # endif #endif /* __MINGW32__ || __CYGWIN__ */ #include diff --git a/gdbserver/configure b/gdbserver/configure index e00e1e1c1c5..cebef407494 100755 --- a/gdbserver/configure +++ b/gdbserver/configure @@ -9363,7 +9363,7 @@ else # define _WIN32_WINNT 0x0501 # endif # else - # define _WIN32_WINNT 0x0501 + # define _WIN32_WINNT 0x0600 # endif #endif /* __MINGW32__ || __CYGWIN__ */ #include diff --git a/gdbsupport/common-defs.h b/gdbsupport/common-defs.h index 1c0ae0ad9d1..38e1d3402e4 100644 --- a/gdbsupport/common-defs.h +++ b/gdbsupport/common-defs.h @@ -83,9 +83,11 @@ #define _FORTIFY_SOURCE 2 #endif -/* We don't support Windows versions before XP, so we define - _WIN32_WINNT correspondingly to ensure the Windows API headers - expose the required symbols. +/* We don't support Windows versions before XP, so ensure that + _WIN32_WINNT is atleast 0x0501 when already defined. + + If it is undefined, default to 0x0600 because GCC's native + win32 C++11 threading support requires Windows Vista APIs. NOTE: this must be kept in sync with common.m4. */ #if defined (__MINGW32__) || defined (__CYGWIN__) @@ -95,7 +97,7 @@ # define _WIN32_WINNT 0x0501 # endif # else -# define _WIN32_WINNT 0x0501 +# define _WIN32_WINNT 0x0600 # endif #endif /* __MINGW32__ || __CYGWIN__ */ diff --git a/gdbsupport/common.m4 b/gdbsupport/common.m4 index bf21c31d78d..4ee949d0be4 100644 --- a/gdbsupport/common.m4 +++ b/gdbsupport/common.m4 @@ -132,7 +132,7 @@ AC_CHECK_HEADERS([ \ # define _WIN32_WINNT 0x0501 # endif # else - # define _WIN32_WINNT 0x0501 + # define _WIN32_WINNT 0x0600 # endif #endif /* __MINGW32__ || __CYGWIN__ */ #include diff --git a/gdbsupport/configure b/gdbsupport/configure index 7ed4e259ffe..74e4551e4a8 100755 --- a/gdbsupport/configure +++ b/gdbsupport/configure @@ -12264,7 +12264,7 @@ else # define _WIN32_WINNT 0x0501 # endif # else - # define _WIN32_WINNT 0x0501 + # define _WIN32_WINNT 0x0600 # endif #endif /* __MINGW32__ || __CYGWIN__ */ #include -- 2.34.1