Mailinglist Archive: opensuse-packaging (162 mails)

< Previous Next >
Re: [opensuse-packaging] Using the gold linker
  • From: Richard Guenther <rguenther@xxxxxxx>
  • Date: Mon, 22 Feb 2010 16:57:24 +0100 (CET)
  • Message-id: <alpine.LNX.2.00.1002221656570.4650@xxxxxxxxxxxxxx>
On Mon, 22 Feb 2010, Michael Matz wrote:

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.

Or much easier:

RPM_OPT_FLAGS="$RPM_OPT_FLAGS -fuse-linker-plugin"

Well, that works with GCC 4.5 in Factory only.

Richard.

--
Richard Guenther <rguenther@xxxxxxx>
Novell / SUSE Labs
SUSE LINUX Products GmbH - Nuernberg - AG Nuernberg - HRB 16746 - GF: Markus Rex
< Previous Next >