From: Pedro Alves <pedro@palves.net>
To: gdb-patches@sourceware.org
Subject: [PATCH 1/2] gdb/testsuite: Force lld-link linker on windows-msvc
Date: Tue, 11 Aug 2026 01:36:59 +0100 [thread overview]
Message-ID: <20260811003700.3580470-2-pedro@palves.net> (raw)
In-Reply-To: <20260811003700.3580470-1-pedro@palves.net>
clang windows-msvc defaults to using the Microsoft link.exe linker.
That does not work with DWARF though, we have to use lld-link instead.
That is why the whole windows-msvc support in the testsuite assumes
the linker in use is lld-link.
So far, I've been running the testsuite with
CC_FOR_TARGET/CXX_FOR_TARGET pointing at a clang wrapper script that
adds "-fuse-ld=lld-link", but I think this belongs in the testsuite
directly, since it's not really optional.
Change-Id: I5bcafa408696b349b829b4ffbd75037be25b3f3b
---
gdb/testsuite/lib/gdb.exp | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 6fb04869605..912ddf1cd54 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -6660,6 +6660,15 @@ proc gdb_compile {source dest type options} {
}
}
+ if {[istarget "*-*-windows-msvc*"]} {
+ # Clang wants to use the Microsoft linker by default. That
+ # doesn't support DWARF, so link with lld-link instead, which
+ # does support DWARF (and PDB/CodeView). Pass -Xarch_host so
+ # that when we're compiling HIP code, we only affect the host
+ # linker.
+ lappend new_options "early_flags=-Xarch_host -fuse-ld=lld-link"
+ }
+
# If the 'build-id' option is used, then ensure that we generate a
# build-id. It is possible that the compiler is configured to do
# so automatically, but at least for GCC the configure option
--
2.54.0
next prev parent reply other threads:[~2026-08-11 0:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-11 0:36 [PATCH 0/2] gdb/testsuite: Make windows-msvc test with lld-link + DWARF Pedro Alves
2026-08-11 0:36 ` Pedro Alves [this message]
2026-08-11 0:37 ` [PATCH 2/2] gdb/testsuite: Force DWARF debug info on windows-msvc Pedro Alves
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=20260811003700.3580470-2-pedro@palves.net \
--to=pedro@palves.net \
--cc=gdb-patches@sourceware.org \
/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