Has anyone tried to use gold
instead of ld
?
gold
promises to be much faster than ld
, so it may help speeding up test cycles for large C++ applications, but can it be used as drop-in replacement for ld?
Can gcc
/g++
directly call gold
.?
Are there any know bugs or problems?
Although gold
is part of the GNU binutils since a while, I have found almost no "success stories" or even "Howtos" in the Web.
(Update: added links to gold and blog entry explaining it)
gold was about 3x/4x faster than LD.
Among the reasons why LLD is so much faster comes down to its threading model, continuously evaluating its performance with code changes, a custom memory allocator, more efficient data structures, and other design choices.
This version of ld uses the general purpose BFD libraries to operate on object files. This allows ld to read, combine, and write object files in many different formats---for example, COFF or "a. out". Different formats may be linked together to produce any available kind of object file.
At the moment it is compiling bigger projects on Ubuntu 10.04. Here you can install and integrate it easily with the binutils-gold
package (if you remove that package, you get your old ld
). Gcc will automatically use gold then.
Some experiences:
/usr/local/lib
What does not work: It cannot compile kernel stuff and therefore no kernel modules. Ubuntu does this automatically via DKMS if it updates proprietary drivers like fglrx. This fails with ld-gold
(you have to remove gold, restart DKMS, reinstall ld-gold
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With