[RFC] Faster linking (-gsplit-dwarf, gold)

Luboš Luňák l.lunak at collabora.com
Thu Jun 28 11:21:50 UTC 2018


On Wednesday 27 of June 2018, Thorsten Behrens wrote:
> Tangential question: anybody aware of something to prevent gdb from
> trying to load _all_ symbols? The VS debugger is much more frugal
> there initially.

 Actually it  turns out that gold can help even here, with the --gdb-index 
option. I remember I tried that 4(?) years ago and back then it just moved 
the time from gdb to linking, which was pointless for the normal development 
cycle, but nowadays the small link time increase is probably worth it:

                        before  |  gdb-index
gdb symbols load time       51s |      16s
libsclo link time        6.159s |   7.758s
libcslo.so size         207951K |  135315K

 That's all with gold and split debug enabled, and  
https://gerrit.libreoffice.org/#/c/56566/ . It seems to require 
binutils-2.25, which is from 2015.

 Just to add to the list, other things I've tried:

* --threads doesn't seem to really do anything in practice. Even if I 
enable --preread-archive-symbols (which according to the source is the only 
thing it affects, besides compressed debuginfo), I can't see a difference.

* --incremental reduces link time to about 4-5s, but appears to be unstable

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


More information about the LibreOffice mailing list