Faster linking (-gsplit-dwarf, gold/lld, --gdb-index)

Luboš Luňák l.lunak at collabora.com
Wed Jul 4 15:37:38 UTC 2018


 Ok, so I've just pushed my changes to master.

 TLDR: If your distro is not older than 2-3 years, you can probably just 
pass --enable-split-debug --enable-gdb-index --enable-ld=gold to configure 
and you'll just magically get faster builds taking less space and faster gdb 
startup.

 I've decided not to enable the options by default for now, just to see if 
something breaks. I still plan to do that later, if nothing shows up.

 Note that this is meant primarily for debug builds. It should work also for 
release builds, but I have no idea what it will do e.g. with distro packaging 
tools that generate debuginfo packages.

 If you want to see numbers, see previous mails, nothing has really changed 
there (except for lld below).

 I've changed --enable-gold to --enable-ld=<linker>, because I've found out 
that LLVM besides Clang provides also a linker called lld, and lld at least 
in version 6 actually performs even better than gold (4s vs gold's 6-7s). 
There are some caveats though:
* lld6 crashes sometimes and needs [1] (openSUSE users, 
devel:tools:compiler/libLLVM6 has it)
* Valgrind can't handle lld's debuginfo and needs [2] and [3], or 
passing --no-rosegment to lld, see 
https://bugs.kde.org/show_bug.cgi?id=384727 (openSUSE users, 
home:llunak:my/valgrind has them)

[1] 
https://github.com/llvm-mirror/llvm/commit/d227a3b47ef9e57d86127c7a94b4d06fdf1bfd2d
[2] 
https://github.com/orivej/valgrind/commit/c59bf5c215f85fb08605708b51f88777227885ae.patch
[3] https://bugsfiles.kde.org/attachment.cgi?id=113765

-- 
 Luboš Luňák
 l.lunak at collabora.com


More information about the LibreOffice mailing list