[cfe-dev] DWARFv5 by default in clang?

Fāng-ruì Sòng via cfe-dev cfe-dev at lists.llvm.org
Sat Nov 20 12:31:59 PST 2021


On Sun, Nov 7, 2021 at 7:31 AM AdrianPrantl via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> Am 11/4/21 um 3:05 PM schrieb David Blaikie <dblaikie at gmail.com>:
>
> On Thu, Nov 4, 2021 at 3:01 PM Adrian Prantl <aprantl at apple.com> wrote:
>
>> On Darwin, we still have a sizeable number of test failures to go until
>> we're there:
>> https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake-matrix/
>>
>
> I'm not sure what/where/how to read that - could you give me some pointers?
>
>
> Click on any successful runs in the DWARF5 column and then on "Logs".
>
>
>
>
> In any case, as I recall, Darwin had a different default for quite a while
> after we switched the default on other platforms to v4, so I guess we could
> do the same thing for v5.
>
>
> Yes. I think we need to make this decision on a per-platform basis. On
> some platforms it may be even more nuanced. For example, when we moved
> macOS from DWARF v2 -> DWARF v4, we only enabled DWARF v4 on target triples
> with a deployment target of *-apple-macosx10.11 and higher, since various
> tools in the OS need to be able to understand the format. I don't know if
> other platforms have similar restrictions.
>

Agree that this is a per-platform decision.

For clang::driver::toolChains::Generic_GCC, we can define
GetDefaultDwarfVersion() to 5 to match GCC 11's switch (
https://gcc.gnu.org/gcc-11/changes.html).

> For targets that produce DWARF debugging information GCC now defaults to
DWARF version 5 (with the exception of VxWorks and Darwin/Mac OS X which
default to version 2 and AIX which defaults to version 4). This can produce
up to 25% more compact debug information compared to earlier versions.

Generic_GCC has many (indirect) derived classes (FreeBSD/OpenBSD/Solaris)
which override the base GetDefaultDwarfVersion().
The Generic_GCC change will affect Haiku/Hurd/Linux/NetBSD/PS4CPU/etc. I
have CC'd these folks: if your platform is not ready for DWARF v5, you can
override GetDefaultDwarfVersion() in your toolchain.


-- adrian
>
>
>
>>
>> -- adrian
>>
>> Am 11/4/21 um 2:58 PM schrieb David Blaikie <dblaikie at gmail.com>:
>>
>> Should we change Clang's default to DWARFv5?
>>
>> (I'm motivated by having fixed a bug because I only tested with v4 - I
>> should've tested with v5, but got me thinking about maybe v5 is just a
>> better default at this point)
>>
>> Google's been using v5 as the default for the better part of a year at
>> this point - not the most debugger usage, but we validated GDB and LLDB for
>> v5 pretty well & haven't encountered major issues since the switch.
>>
>>
>> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>


-- 
宋方睿
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20211120/e6485b07/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: greendragonmatrix.png
Type: image/png
Size: 218841 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20211120/e6485b07/attachment-0001.png>


More information about the cfe-dev mailing list