autobuild3
autobuild3 copied to clipboard
Add experimental support for alternative LDs.
There are two ELF-only non-regular-ld's that may be somehow better than the original one. Both are somehow experimental, but personally I think gold
is closer to everyday use.
gold
from binutils
gold the linker is a part of binutils, and it's nearly 10x faster than ld
. Using gold
for LTO builds can make gcc use the plugin features better.
Note that the description for the -O
stuff in gold manpage is ‘Optimize output file size’.
gold
is a drop-in replacement for ld
for normal use (README).
eu-ld
from elfstrip
This one seems to support less flags with a much-shorter --help
output, so I'm not sure if it will work well as a drop-in (and there is no further documentation!). It's listed here actually for some kind of religion-like belief that elfutils is better.
It seems that it treats -O
more carefully somehow (ldgeneric.c: optimal_bucket_size
does some extra loops with higher level). Well just pretend that you can't see the XXX
in optimal_gnu_hash_size
.
Issue Metadata
@MingcongBai reported that gold
is commonly crashing stuffs. Oh no my GNU belief.
@MingcongBai Maybe we should remove the fno-use-linker-plugins
stuff, as forcing such thing is really weird..
@Arthur2e5 It is sensible to remove this flag.
Bai has already added some bumpy way of doing this, and it works fine (thanks to the good option compatibility…). Uh… Should we consider this still? It's just CFLAGS stuffs written again.
It seems like at the moment, a symlink would be (sadly) one of the suck-less choices we would have.