For certain workloads linking with the gold linker on Linux can speed up compilation quite a bit. Servo, for example, goes to lengths to link with gold (it can be done with the rustc flag
-C link-args=-fuse-ld=gold) because it improves link time dramatically for their large project.
I think we should probably be using gold by default when possible to get the performance improvements. It’s not a simple matter though since gold is not completely compatible with ld. Still, this incompatibility might be a good reason to move to gold now, to establish the precedent that linking on Linux uses gold, maybe prevent those gold-broken linkage scenarios from ever occurring.
Here’s a simple patch that just reads an environment variable
RUSTC_LINK_WITH_GOLD. This is probably not the right way to do it though. We might alternately detect whether the gold bin is available and just use it unless some flag indicates not to.
That’s the sum of my thoughts for now. Want to get this subject moving since it’s such an easy compile time win for some cases.