[PATCH] D92844: [gn build] Link with -Wl,--gdb-index

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 9 11:26:41 PST 2020


thakis added a comment.

In D92844#2442915 <https://reviews.llvm.org/D92844#2442915>, @aeubanks wrote:

>>> 15% slower links seems noticeable. I'd prefer putting this behind a flag (can default to `is_debug` if you really want). I think putting all optional compiler/linker command line flags behind gn args makes sense.
>>
>> You're setting `is_debug=true` but you don't run the binary under gdb? If so, wy do you set `is_debug=true`? For stacks with line numbers?
>
> Yup

Do you think we should have some mode to get `-g1` for that use case? I'd expect that to make your use case link faster than it currently does. (At least while we don't use fission, but even then it'll reduce .o file size which likely means faster build time with distributed compiles.) And then we could do the index only on `-g` not `-g1` builds.

In D92844#2442982 <https://reviews.llvm.org/D92844#2442982>, @MaskRay wrote:

> If `-gsplit-dwarf` is set, `-Wl,--gdb-index` makes sense.

The GN build currently never sets `gsplit-dwarf` and `-Wl,--gdb-index` still seems to speed up things quite a bit. Are you saying we should _also_ use `-gsplit-dwarf` (probably a good idea), or are you saying something else?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D92844/new/

https://reviews.llvm.org/D92844



More information about the llvm-commits mailing list