[PATCH] D130566: [Driver] Default to DWARF 4 on Linux/sparc64
Rainer Orth via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 27 03:50:33 PDT 2022
ro added a comment.
In D130566#3681129 <https://reviews.llvm.org/D130566#3681129>, @dblaikie wrote:
>> During a build on Debian 11/sparc64, several binaries fail to link with
>>
>> /usr/bin/ld: /usr/bin/ld: DWARF error: invalid or unhandled FORM value: 0x23
>
> What's the linker doing parsing DWARF? Any idea what feature this is? And why is it SPARC-specific? Or is it true of other targets on the same Debian version?
I have no idea, actually. The code in question is `bfd/dwarf2.c` (`read_attribute_value`), who's comment states:
/* Read and fill in the value of attribute ATTR as described by FORM.
Read data starting from INFO_PTR, but never at or beyond INFO_PTR_END.
Returns an updated INFO_PTR taking into account the amount of data read. */
So far, I had only seen it with the GNU `ld` 2.38.50 bundled with Debian 11/sparc64, but couldn't reproduce on Ubuntu 20.04/x86_64 (neither bundled GNU `ld` 2.34, nor self-compiled 2.38.90). Things got even weirder when I tried to create a minimal testcase for a binutils bug report: I'd initially seen the error when linking `Sanitizer-sparc-Test`. However, at that time the link also failed due to D130571 <https://reviews.llvm.org/D130571>. I got the `unhandled FORM value` error several times, probably for several different input objects. However, when adding `-latomic` to the link, the link did succeed without issues.
I've since ran a full build with all pending patches, just without this one, and didn't see the DWARF error again. This is all extremely weird, but until the error shows up again, I'll put this patch on hold (not yet abandoning since there seems to be no way to unabandon if necessary).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D130566/new/
https://reviews.llvm.org/D130566
More information about the cfe-commits
mailing list