Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] testsuite: Skip fission-dw-form-strx with clang
@ 2026-04-16 14:00 Bratislav Filipovic
  2026-04-16 14:45 ` Guinevere Larsen
  2026-04-16 15:19 ` Simon Marchi
  0 siblings, 2 replies; 3+ messages in thread
From: Bratislav Filipovic @ 2026-04-16 14:00 UTC (permalink / raw)
  To: gdb-patches; +Cc: Bratislav Filipovic

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-04-16 15:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-04-16 14:00 [PATCH] testsuite: Skip fission-dw-form-strx with clang Bratislav Filipovic
2026-04-16 14:45 ` Guinevere Larsen
2026-04-16 15:19 ` Simon Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox