Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Guinevere Larsen <guinevere@redhat.com>
To: Bratislav Filipovic <bfilipov@amd.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] testsuite: Skip fission-dw-form-strx with clang
Date: Thu, 16 Apr 2026 11:45:56 -0300	[thread overview]
Message-ID: <9e2fcd13-b793-4d01-9263-83f566ef8db1@redhat.com> (raw)
In-Reply-To: <20260416140306.1556274-1-bfilipov@amd.com>

On 4/16/26 11:00 AM, Bratislav Filipovic wrote:
> 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?

My approach for these kinds of things in the past was to open a bug with 
LLVM and mark the tests as XFAIL in our testsuite (at least if the rest 
of the test still make sense to run)

>
>   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]


-- 
Cheers,
Guinevere Larsen
It/she


  reply	other threads:[~2026-04-16 14:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-16 14:00 Bratislav Filipovic
2026-04-16 14:45 ` Guinevere Larsen [this message]
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=9e2fcd13-b793-4d01-9263-83f566ef8db1@redhat.com \
    --to=guinevere@redhat.com \
    --cc=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