Re: ctfconvert: rc = 1 Unsupported version [_dwarf_info_load(229)]

From: Andriy Gapon <avg_at_freebsd.org>
Date: Sat, 27 Nov 2021 08:42:12 UTC
On 26/11/2021 21:48, Mark Johnston wrote:
> On Fri, Nov 26, 2021 at 02:00:27PM -0500, Mark Johnston wrote:
>> Thanks, I can reproduce it now.
>>
>> Our libdwarf is complaining that the first compilation unit header in
>> .debug_info contains an unsupported DWARF version number (libdwarf only
>> supports 2, 3 and 4).  In files compiled by clang it ends up being zero.
>> For instance, compiling bin/cat and dumping the .debug_info section:
>>
>> gcc10:
>>   c1250000 04000000 00000801 00000000
>>             ^ DWARF version
>> clang:
>>    01000000 00000000 4e230000 00000000
>>
>> llvm-dwarfdump and binutils readelf are somehow still able to find a
>> valid-looking unit header, but I haven't yet been able to figure out how
>> they do that from reading the DWARF 4/5 specs or the LLVM sources.
> |Ah, we recently started configuring clang to compress debug sections by 
> default, and our libdwarf doesn't know how to handle that. As an interim 
> workaround this could simply be disabled with WITH_CTF is configured:

Oh wow, you were very fast at figuring this out.
Thank you very much!

I'll give the build change a whirl first and then test D33139 a bit later.

-- 
Andriy Gapon