Mailinglist Archive: opensuse-packaging (162 mails)

< Previous Next >
Re: [opensuse-packaging] Using the gold linker
  • From: Michael Matz <matz@xxxxxxx>
  • Date: Mon, 22 Feb 2010 15:26:36 +0100 (CET)
  • Message-id: <Pine.LNX.4.64.1002221510210.18785@xxxxxxxxxxxxx>
Hi,

On Mon, 22 Feb 2010, Cristian Rodríguez wrote:

Is there any way to use the gold linker in a project-wide way and/or per
package basis without resorting to export LD=... or gcc -B hacks ?

Create a package "gold-by-default", which
* Requires binutils-gold
* creates a new directory /opt/gold/bin
* therein a symlink named 'ld' (to /usr/bin/gold)
* creates a new file /etc/profile.d/gold-by-default.sh which
sets and exports COMPILER_PATH=/opt/gold/bin, and prepends PATH with
that path

Then you should be able to always install gold-by-default in your project.
The important thing is the $COMPILER_PATH setting, so that collect2 (an
internal program of gcc which actually calls the linker) finds the new ld.
collect2 itself won't look at $LD, or into $PATH.


Ciao,
Michael.
< Previous Next >
References