Skip to content

Use gold linker when available

Afonso Mukai requested to merge Use_gold_linker_when_available into v3.0.0

Created by: matthew-d-jones

gold linker is a faster alternative to the default GNU linker on Linux. These few lines of CMake allow us to make use of it when it is available on the system. It is already available on all of our Linux build containers.

On the machine I tested on (16 core, 4.5GHz, Ubuntu 19.10, gcc 9.2.1, ninja) it results in clean build time going from 1m7s to 58s (3 repetitions with each, all repetitions were within 300ms of each other). A reduction of ~15%. Reduction is a larger percentage for incremental builds, since linking is a larger proportion of the build time in that case.

Merge request reports