Trying gold

I just felt like trying the new experimental linker gold. It seems to do c++ stuff quite fast.

To build it as a debian package, I just took the cvs binutils and the latest debian packaging, removed all the weird archs from the multiarch package and added –enable-gold to configure and built it.

$ ld --version
GNU gold (GNU Binutils for Debian 2.18.50.20080403) 1.4

It seems gold is so much stricter when trying to link something lazy developers have written. Kde3 fails quite heavily with lots of undefined stuff. Like not linking qt when actually using it.

kde4 seems to do a bit better – this is where I am blaming gold for the modifications required (all in FindKDE4Internal.cmake):

  • gold doesn’t like –no-undefined. but gold understands -z defs. As it is the same, replace it
  • gold doesn’t like –enable-new-dtags – let us try remove it
  • gold doesn’t like –fatal-warnings – let us try remove it

and then kdelibs from kde4 actually builds. I haven’t done any benchmarking, but I have the impression that gold is just so much faster. I wonder when it gets considered stable. And available for all archs.

One comment on “Trying gold
  1. Joe Buck says:

    Warning: while gold works great most of the time, and is about six times faster in my tests, it does not correctly build a Linux kernel yet.