GNU gold

Some guys at Google thought that GNU ld was a bit slow on C++ programs.
Guess what, they were right and wrote a new C++ linker from scratch. Enter
GNU gold. It links about 10x faster than traditional ld. Ubuntu 9.10 or
Debian testing people can enjoy it by apt-getting binutils-gold. I just
pushed the necessary changes to support this linker. It's a bit pickier on
the -l flags you provide (you need to provide some more than with old ld).
The orocos-rtt-corba .pc file needed to be updated.

For those loosing track, this updates our minimal Orocos build chain to
Quad-core i7 + 6GB RAM + gcc 4.4 + ccache + gold + Eclipse all this to keep
your build under 60 seconds.

Example RTT 2.0 mainline with CORBA, tests:
empty ccache + make clean + make -j8: 1m36s
make clean + make -j8 with all in ccache : 14s

Really worth it's name.

Peter

GNU gold

peter wrote:
I just
pushed the necessary changes to support this linker. It's a bit pickier on
the -l flags you provide (you need to provide some more than with old ld).
The orocos-rtt-corba .pc file needed to be updated.

How did you manage cmake to use gold? Changing CMAKE_LINKER makes no effect. Actually it always links our projects with c++, whether CMAKE_LINKER is set to ld or gold.

On google I just found http://www.kwwidgets.org/Bug/bug_view_page.php?bug_id=8065 , which states that CMAKE_LINKER is not really usable

thanks

Re: GNU gold

peter wrote:
I just pushed the necessary changes to support this linker. It's a bit pickier on the -l flags you provide (you need to provide some more than with old ld). The orocos-rtt-corba .pc file needed to be updated.

How did you manage cmake to use gold? Changing CMAKE_LINKER makes no effect. Actually it always links our projects with c++, whether CMAKE_LINKER is set to ld or gold.

On google I just found http://www.kwwidgets.org/Bug/bug_view_page.php?bug_id=8065 , which states that CMAKE_LINKER is not really usable

thanks

GNU gold

On Tue, Nov 10, 2009 at 13:27, <orocos [..] ...> wrote:
>
>

peter wrote:
I just
> pushed the necessary changes to support this linker. It's a bit pickier on
> the -l flags you provide (you need to provide some more than with old ld).
> The orocos-rtt-corba .pc file needed to be updated.
>

>
> How did you manage cmake to use gold? Changing CMAKE_LINKER makes no effect. Actually it always links our projects with c++, whether CMAKE_LINKER is set to ld or gold.
>
> On google I just found http://www.kwwidgets.org/Bug/bug_view_page.php?bug_id=8065 , which states that CMAKE_LINKER is not really usable

gold is installed as 'ld', so cmake picks it up automatically. Try ld
--version and you should see 'GNU gold' on the first line.

Peter

GNU gold

peter wrote:
On Tue, Nov 10, 2009 at 13:27, <orocos [..] ...> wrote:
>
>
peter wrote:
I just
> pushed the necessary changes to support this linker. It's a bit pickier on
> the -l flags you provide (you need to provide some more than with old ld).
> The orocos-rtt-corba .pc file needed to be updated.
>

>
> How did you manage cmake to use gold? Changing CMAKE_LINKER makes no effect. Actually it always links our projects with c++, whether CMAKE_LINKER is set to ld or gold.
>
> On google I just found http://www.kwwidgets.org/Bug/bug_view_page.php?bug_id=8065 , which states that CMAKE_LINKER is not really usable

gold is installed as 'ld', so cmake picks it up automatically. Try ld
--version and you should see 'GNU gold' on the first line.

Peter

In my case ld is not replaced by gold-binutils rpm from suse gcc repository
<pre>
la /usr/bin/gold
-rwxr-xr-x 1 root root 1501624 2009-10-23 11:39 /usr/bin/gold

la /usr/bin/ld
-rwxr-xr-x 1 root root 552392 2009-10-23 11:39 /usr/bin/ld

/usr/bin/ld --version
GNU ld (GNU Binutils; devel:gcc / openSUSE_11.1) 2.20.51.20091013-21.1
Copyright 2009 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.

/usr/bin/gold --version
GNU gold (GNU Binutils; devel:gcc / openSUSE_11.1 2.20.51.20091013-21.1) 1.9
Copyright 2008 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.

rpm -qa | grep gold
binutils-gold-2.20.51-21.1
</pre>

Old gcc --with-ld flag does not work. I manually replaced ld with gold and I got a 2 fold link time performance. Excellent!

Re: GNU gold

peter wrote:
On Tue, Nov 10, 2009 at 13:27, <orocos [..] ...> wrote: >>
peter wrote:
I just > pushed the necessary changes to support this linker. It's a bit pickier on > the -l flags you provide (you need to provide some more than with old ld). > The orocos-rtt-corba .pc file needed to be updated. >
>> How did you manage cmake to use gold? Changing CMAKE_LINKER makes no effect. Actually it always links our projects with c++, whether CMAKE_LINKER is set to ld or gold. >

> On google I just found http://www.kwwidgets.org/Bug/bug_view_page.php?bug_id=8065 , which states that CMAKE_LINKER is not really usable

gold is installed as 'ld', so cmake picks it up automatically. Try ld --version and you should see 'GNU gold' on the first line.

Peter

In my case ld is not replaced by gold-binutils rpm from suse gcc repository

 la /usr/bin/gold -rwxr-xr-x 1 root root 1501624 2009-10-23 11:39 /usr/bin/gold

la /usr/bin/ld -rwxr-xr-x 1 root root 552392 2009-10-23 11:39 /usr/bin/ld

/usr/bin/ld --version GNU ld (GNU Binutils; devel:gcc / openSUSE_11.1) 2.20.51.20091013-21.1 Copyright 2009 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License version 3 or (at your option) a later version. This program has absolutely no warranty.

/usr/bin/gold --version GNU gold (GNU Binutils; devel:gcc / openSUSE_11.1 2.20.51.20091013-21.1) 1.9 Copyright 2008 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License version 3 or (at your option) a later version. This program has absolutely no warranty.

rpm -qa | grep gold binutils-gold-2.20.51-21.1

Old gcc --with-ld flag does not work. I manually replaced ld with gold and I got a 2 fold link time performance. Excellent!

GNU gold

On Nov 9, 2009, at 11:40 AM, Peter Soetens wrote:

> Some guys at Google thought that GNU ld was a bit slow on C++
> programs. Guess what, they were right and wrote a new C++ linker
> from scratch. Enter GNU gold. It links about 10x faster than
> traditional ld. Ubuntu 9.10 or Debian testing people can enjoy it by
> apt-getting binutils-gold. I just pushed the necessary changes to
> support this linker. It's a bit pickier on the -l flags you provide
> (you need to provide some more than with old ld). The orocos-rtt-
> corba .pc file needed to be updated.
>
> For those loosing track, this updates our minimal Orocos build chain
> to Quad-core i7 + 6GB RAM + gcc 4.4 + ccache + gold + Eclipse all
> this to keep your build under 60 seconds.
>
> Example RTT 2.0 mainline with CORBA, tests:
> empty ccache + make clean + make -j8: 1m36s
> make clean + make -j8 with all in ccache : 14s
>
> Really worth it's name.
>
> Peter

Interesting ... we have also noticed the link time issue. Thanks for
adding this capability in, Peter!

Shame that gold won't support Mach-O (ie Mac OS X format) though ....
but having said that ....

1 x Mac Pro = dual Quad-core i7 + 12 GB RAM + gcc 4.2 + no ccache + no
distcc = 2:00 to clean build RTT+KDL+BFL+OCL.

... so life could be worse ... :-)

I also wonder whether we could get better build times if we could
convince CMake to continue compiling objects files for the next
library, while it is linking the current library. We get a major pause
while it links the first library, with N-1 cores sitting idle, before
it begins to compile the objects files for the second library. As the
second library depends on the first, you can't link the second until
you've linked the first, however, you could compile the objects files
for the second library. I have not gotten around to investigating if
this is possible yet ...

Stephen