This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: gold: how to integrate into existing tool chain
- From: Ian Lance Taylor <iant at google dot com>
- To: Roland Baumann <roland dot baumann at CoWare dot com>
- Cc: binutils at sourceware dot org
- Date: Mon, 07 Apr 2008 13:09:02 -0700
- Subject: Re: gold: how to integrate into existing tool chain
- References: <47FA36BF.7000305@coware.com>
Roland Baumann <roland.baumann@CoWare.com> writes:
> Now we are trying to figure out how to integrate gold into our
> existing development environment. We are still using gcc 3.4.4 and gcc
> 3.2.3 and need a way to optionally use gold instead of the normal ld
> when linking with a g++ command line.
>
> I saw that collect2 looks for real-ld when it wants to call ld. So we
> could create a symbolic link to gold under that name in the search
> path and collect2 would use that. But then g++ would always use gold
> and we do not want that.
>
> Instead it would be great to have a way to tell collect2 or g++ which
> linker to use (environment variable; command line option).
The -B option to g++ gives it an additional directory in which to find
compiler passes. If you put gold in a directory under the name
"real-ld" and then pass -Bdirectory_name/ (older versions of gcc
require the trailing slash), then gcc should use tell collect2 to use
gold. You can use -Wl,-debug to confirm.
Ian