From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id EdNGNcSGVWoA6QYAWB0awg (envelope-from ) for ; Mon, 13 Jul 2026 20:45:56 -0400 Received: by simark.ca (Postfix, from userid 112) id D77FF1E09E; Mon, 13 Jul 2026 20:45:56 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.3 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 638A31E099 for ; Mon, 13 Jul 2026 20:45:56 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F159D4BA23C4 for ; Tue, 14 Jul 2026 00:45:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F159D4BA23C4 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) by sourceware.org (Postfix) with ESMTPS id 154234BA2E08 for ; Tue, 14 Jul 2026 00:45:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 154234BA2E08 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 154234BA2E08 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=209.85.128.53 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1783989926; cv=none; b=rrfKo1rmV22/o3uJkOhY04xk59bwqEhPio37CMZOX17l17YvOtq8yCtD7DdUU2TtIt5ORCJFWKF+vV8b0Oc6OH4TQoQRUpNr3Sj+rzwk68lCE7yG8IpMlWNr51nasnZEeFv1mSuZQNqXt4VNmFMprm87+FHk2K1v9XoyHeJHzGU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1783989926; c=relaxed/simple; bh=vSJoSBUlW4rdp/39YQkXYUnXiggslGSprWURGSh+z6E=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=SsH6zcgHvoZMkYAE4LP9q1xn7a0woGl2ZxIMdW/8tJ0wdnqg5BrLPuiUYzBjJuzVt0TCMl5eearnFfPzYCzheMe+3idVH7KT9ag3ftAfHjfdX5tc9wz2b3+ihKrcnRldLHzEzW5SJ09C+ktRP5tX99FFkzN0YuOoF8A+NSv4Ijw= ARC-Authentication-Results: i=1; sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 154234BA2E08 Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-493e497643fso2376945e9.0 for ; Mon, 13 Jul 2026 17:45:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783989925; x=1784594725; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=Sc+26rQFh/W29A9Rt8YdTRwe1pvT4illzh39233byHs=; b=i62j2rpjD7MYKpD+k3uP2WsJJQkHPvkwvGf4gm2yy1/9RoHRXNAN5B89x6n2Q8sGp3 L4dnD2OEne28dfrgoRRRpeRjKrMPPl6W3pVnfSXtXLPNZsc56XgemWlApT/jlwaSN3fU SvD02LMPMmjWn0nZZoLvDhhOsqizabTQloF4+mNzZ13s7TYfF1yxof8HZry4eDo7ArGX vuofYa5FJzqeRcdksGiiUijmM8eqstAVG8XPO3Rz8pXWYGtVfRvo1WECOx0qu1f+rTaw Q4RiXCjnWVnLb94NSk8aYBdRWntiwNT+vTsBvX3awHG+PbEihG+sCxKgx2e2Enz8USoO gS0A== X-Gm-Message-State: AOJu0YwUlf4LVvOh9/gV2tHbD43XQPXl8eK0BWVZjWyvMn/LnaanH43Z V65YFp0tIf/eSU0A6HEsRY5yIxIi9iuhVFaseRcXiDJ3+LBiNC/zm7yqeCUgczRpGdo= X-Gm-Gg: AfdE7cmb6GELAKX53LWBvmzdFFdtqiYq0dViSmxi1wxqdGbU+rCzB9yV9hdZwmOe+1o QL2Q9+JCpj/WA+TAruaWaNP7L+WS1y3WE2YEvF87T5FDQkCyRbWDHvlH5IGr72KHh632lmGvRgo 34t8o4I6O0nW7+5BfYVvbyk8thX7pGr8YnrrWfGaSFvKZS6zNQ5uJ/voagrX9Qq9oJBmZb20Uzk SRUQUcErPDucTXi0QWmXSY+dkVfVEFPDUvi7+QAT27HD6Ni1LMuWtXwsEh/9YTAD2w7QsLHmlJm m+oglXdcUvGnSHS0SldkXB/7DRpVow52gBNvZnEqmfH3Jn4CN2Co+whB/A2klQZAhCX6bauanpk U2/49tVBNzL7p5aAdgSRfbyWb0wXFyPNDoqBIW1xiAHYEgw0z1SnL2vk5Diirsct3JUgpFMKdhE U564GQFRgir76lODkpL3OWVA== X-Received: by 2002:a05:600c:c172:b0:490:b7e6:bd1d with SMTP id 5b1f17b1804b1-493f87ecb62mr131745205e9.16.1783989924764; Mon, 13 Jul 2026 17:45:24 -0700 (PDT) Received: from localhost ([2001:8a0:fae3:3700:e20e:b691:1f0e:d301]) by smtp.gmail.com with UTF8SMTPSA id 5b1f17b1804b1-493fd3ccfd4sm149391625e9.2.2026.07.13.17.45.23 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 13 Jul 2026 17:45:23 -0700 (PDT) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 1/4] gdb: recognize *-*-windows* Windows targets Date: Tue, 14 Jul 2026 01:45:04 +0100 Message-ID: <20260714004507.1323332-2-pedro@palves.net> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260714004507.1323332-1-pedro@palves.net> References: <20260714004507.1323332-1-pedro@palves.net> 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 Clang's default target on Windows uses the "windows-msvc" OS in its triplet, e.g. x86_64-pc-windows-msvc, i686-pc-windows-msvc, and aarch64-pc-windows-msvc. This is different from MinGW triplets -- it means that the compiler produces binaries following the Windows/MSVC ABI, not the GNU ABI. config.sub already canonicalizes these, but gdb/configure.tgt has no entry for the "windows" OS. Configuring GDB for such a target does not fail. The per-CPU section of configure.tgt still matches on the CPU, so gdb_target_obs is non-empty and the "configuration ... is unsupported" check does not trigger, but the resulting GDB has no Windows support at all -- none of the windows-tdep.o and friends are pulled in, and no Windows OS ABI is selected. Fix this my extending the i386, x86_64 and aarch64 Windows entries to also match "*-windows*", and map the "windows" OS to GDB_OSABI_WINDOWS, so that Windows target triplets spelled with the "windows" OS select the same target objects and OS ABI as their MinGW counterparts. The GNU/MinGW and MSVC ABIs are not actually identical (long double, the C++ ABI, and so on differ), so a later commit will introduce a distinct OS ABI for the MSVC case. For now, reusing GDB_OSABI_WINDOWS is enough to make these configurations build. Note: even though config.sub does not support "windows-gnu" today, Clang and Rust support it, as an alias for MinGW. Clang also accepts plain "windows", treating it as MSVC. That's why the patch matches "windows*". Also, this is what is already used in bfd, anyhow: bfd/configure.host:81:*-*-windows*) bfd/acinclude.m4:24:*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*) ... Change-Id: I14a0030efc388ae3dc5f34b2580849c41219e2bd --- gdb/configure.tgt | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/gdb/configure.tgt b/gdb/configure.tgt index 362de60065c..f473f67d8bd 100644 --- a/gdb/configure.tgt +++ b/gdb/configure.tgt @@ -155,8 +155,8 @@ aarch64*-*-linux*) symfile-mem.o linux-record.o" ;; -aarch64-*-mingw*) - # Target: MingW/aarch64 +aarch64-*-mingw* | aarch64-*-windows*) + # Target: Windows/aarch64 gdb_target_obs="aarch64-windows-tdep.o windows-tdep.o" ;; @@ -339,11 +339,7 @@ i[34567]86-*-gnu*) # Target: Intel 386 running the GNU Hurd gdb_target_obs="i386-gnu-tdep.o glibc-tdep.o solib-svr4.o" ;; -i[34567]86-*-cygwin*) - # Target: Intel 386 running win32 - gdb_target_obs="i386-windows-tdep.o windows-tdep.o" - ;; -i[34567]86-*-mingw32*) +i[34567]86-*-cygwin* | i[34567]86-*-mingw32* | i[34567]86-*-windows*) # Target: Intel 386 running win32 gdb_target_obs="i386-windows-tdep.o windows-tdep.o" ;; @@ -739,8 +735,8 @@ x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu) gdb_target_obs="amd64-fbsd-tdep.o ${i386_tobjs} \ i386-bsd-tdep.o i386-fbsd-tdep.o" ;; -x86_64-*-mingw* | x86_64-*-cygwin*) - # Target: MingW/amd64 +x86_64-*-mingw* | x86_64-*-cygwin* | x86_64-*-windows*) + # Target: Windows/amd64 gdb_target_obs="amd64-windows-tdep.o \ ${i386_tobjs} i386-windows-tdep.o \ windows-tdep.o" @@ -826,7 +822,7 @@ m68*-*-openbsd* | m88*-*-openbsd* | vax-*-openbsd*) ;; *-*-*-gnu*) ;; # prevent non-GNU kernels to match the Hurd rule below *-*-gnu*) gdb_osabi=GDB_OSABI_HURD ;; *-*-mingw32ce*) gdb_osabi=GDB_OSABI_WINCE ;; -*-*-mingw*) gdb_osabi=GDB_OSABI_WINDOWS ;; +*-*-mingw* | *-*-windows*) gdb_osabi=GDB_OSABI_WINDOWS ;; *-*-cygwin*) gdb_osabi=GDB_OSABI_CYGWIN ;; *-*-dicos*) gdb_osabi=GDB_OSABI_DICOS ;; powerpc-*-aix* | rs6000-*-* | powerpc64-*-aix*) -- 2.54.0