From: Bratislav Filipovic <bfilipov@amd.com>
To: <gdb-patches@sourceware.org>
Cc: Bratislav Filipovic <bfilipov@amd.com>
Subject: [PATCH] testsuite: Skip fission-dw-form-strx with clang
Date: Thu, 16 Apr 2026 14:00:48 +0000 [thread overview]
Message-ID: <20260416140306.1556274-1-bfilipov@amd.com> (raw)
Clang's integrated assembler incorrectly sets the SHF_EXCLUDE flag
on .debug_*.dwo sections when assembling DWARF fission debug info.
This causes all linkers (both lld and GNU ld) to strip these
sections from the final output, breaking the test.
This is a limitation of clang's integrated assembler, not a GDB
issue. The test works correctly with GCC's assembler, which does
not set this flag.
A workaround exists (-fno-integrated-as to use GNU's external
assembler), but it is not practical to apply in the testsuite.
Therefore, restrict this test to GCC only.
---
I've investigated this thoroughly and found that clang's integrated
assembler hardcodes the SHF_EXCLUDE flag on .debug_*.dwo sections.
The only workaround I found is -fno-integrated-as, which forces clang
to use GNU's external assembler.
Does anyone have suggestions for making this test work with clang
without skipping it entirely? Or should we report this to LLVM as a bug?
gdb/testsuite/gdb.dwarf2/fission-dw-form-strx.exp | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/gdb/testsuite/gdb.dwarf2/fission-dw-form-strx.exp b/gdb/testsuite/gdb.dwarf2/fission-dw-form-strx.exp
index b0b842fe911..fb39cab9c75 100644
--- a/gdb/testsuite/gdb.dwarf2/fission-dw-form-strx.exp
+++ b/gdb/testsuite/gdb.dwarf2/fission-dw-form-strx.exp
@@ -20,6 +20,13 @@ load_lib dwarf.exp
# This test can only be run on targets which support DWARF-2 and use gas.
require dwarf2_support
+# This test requires GCC. Clang's integrated assembler incorrectly sets
+# the SHF_EXCLUDE flag on .debug_*.dwo sections, causing linkers to strip
+# them from the final output. This is a limitation of clang's integrated
+# assembler, not a GDB issue. The workaround (-fno-integrated-as) is not
+# practical for the testsuite.
+require {[test_compiler_info {gcc-*}]}
+
standard_testfile main.c -dw.S -dwo.S
set main_asm_file [standard_output_file $srcfile2]
--
2.43.0
next reply other threads:[~2026-04-16 14:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-16 14:00 Bratislav Filipovic [this message]
2026-04-16 14:45 ` Guinevere Larsen
2026-04-16 15:19 ` Simon Marchi
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=20260416140306.1556274-1-bfilipov@amd.com \
--to=bfilipov@amd.com \
--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