[llvm] [CMake] Turn on LLVM_USE_SPLIT_DWARF by default for Linux Debug build (PR #80328)

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 6 13:14:42 PST 2024


dwblaikie wrote:

> > GCC and LLVM have now DWARF5 on by default. It has it's own accelerator tables .debug_names. It looks like side affect of this is that we will also be generating --gdb-index in the linker. I don't think this is the behavior we want with DWARF5.
> 
> I respectfully disagree with changing the default due to the diverse configurations and their inherent trade-offs.

^ this comment is a general one on the whole proposal (here and on discourse) - you're suggesting we should not enable Split DWARF by default for LLVM Debug builds?

*nod* I don't feel /too/ strongly about it - I don't think most people are terribly storage-constrained to such a degree that this is super important to most LLVM developers. We do document the Split DWARF configuration/suggest it for folks struggling with build times and such.

>  `-gsplit-dwarf` deviates from common practices of other project build systems (this is an advanced option), and the `.gdb_index` section doesn't benefit lldb users (haha, even if I primarily use gdb due to rr).

gdb is still the predominant debugger on these platforms - Clang still defaults to gdb debugger tuning on them, so I don't feel too badly about enabling gdb_index by default on these platforms for LLVM Debug builds. It substantially improves gdb startup time.

Folks using lldb can add -glldb to their build flags if they want to tune for lldb, but it isn't the default.

> Perhaps we should not do too smart things here like making gdb-index `LLVM_USE_SPLIT_DWARF` the default and add a `.debug_names` configuration when linker `--debug-names` work is complete. These advanced options can be learned by users.

They can be - but at some cost of failure/frustraction and eventual discovery of these better options. Given how many folks still link with bfd ld despite the time cost because they don't know that's what's happening nor know that there are better options - I'm not against trying to make the defaults better behaved for most people, and I do think gdb_index and Split DWARF are better defaults for most people on the platforms where they're applicable.


https://github.com/llvm/llvm-project/pull/80328


More information about the llvm-commits mailing list