This is an archive of the discontinued LLVM Phabricator instance.

Document `LLVM_USE_SPLIT_DWARF` option
ClosedPublic

Authored by beanz on Oct 6 2019, 2:17 PM.

Details

Summary

This patch adds a documentation note about the LLVM_USE_SPLIT_DWARF CMake option which is useful to reduce linker memory usage.

Event Timeline

beanz created this revision.Oct 6 2019, 2:17 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 6 2019, 2:17 PM

FWIW, the current support is incomplete - if you just turn on -gsplit-dwarf, gdb may misbehave owing to a lack of index. (you'd need to add -Wl,-gdb-index to CMAKE_*_LINKER_FLAGS)

Arguably we could/should fix LLVM itself to pass that flag when using -gsplit-dwarf while tuning for gdb and/or improve the LLVM CMake build to add the flag.

anton-afanasyev accepted this revision.Aug 30 2021, 3:35 AM
anton-afanasyev added a subscriber: anton-afanasyev.

FWIW, the current support is incomplete - if you just turn on -gsplit-dwarf, gdb may misbehave owing to a lack of index. (you'd need to add -Wl,-gdb-index to CMAKE_*_LINKER_FLAGS)

Arguably we could/should fix LLVM itself to pass that flag when using -gsplit-dwarf while tuning for gdb and/or improve the LLVM CMake build to add the flag.

Since --gdb-index option is added to LLVM_USE_SPLIT_DWARF (https://reviews.llvm.org/D108776) I think this could be landed with a couple of words added about --gdb-index.

BTW, the LLVM_USE_SPLIT_DWARF option is even documented at "GettingStarted" (https://reviews.llvm.org/D75425) already, but it's still not represented here, at full list.

This revision is now accepted and ready to land.Aug 30 2021, 3:35 AM
dblaikie accepted this revision.Aug 30 2021, 8:35 PM

FWIW, the current support is incomplete - if you just turn on -gsplit-dwarf, gdb may misbehave owing to a lack of index. (you'd need to add -Wl,-gdb-index to CMAKE_*_LINKER_FLAGS)

Arguably we could/should fix LLVM itself to pass that flag when using -gsplit-dwarf while tuning for gdb and/or improve the LLVM CMake build to add the flag.

Since --gdb-index option is added to LLVM_USE_SPLIT_DWARF (https://reviews.llvm.org/D108776) I think this could be landed with a couple of words added about --gdb-index.

Yeah, sounds about right.

aprantl added inline comments.Sep 3 2021, 5:59 PM
llvm/docs/CMake.rst
624

meory -> memory

625

should this be: platforms using the ELF object format, like Linux
I suppose this also works on FreeBSD?

dblaikie added inline comments.Sep 3 2021, 6:16 PM
llvm/docs/CMake.rst
625

Should do, yeah - though I've not tried it.

xgupta added a subscriber: xgupta.Sep 3 2021, 11:26 PM
This comment was removed by xgupta.

Reverse ping :) Just a gentle reminder this is ready to land (with minor nits).