GoldLinking

Introducing GNU gold
Gold is a linker for ELF files. It was added to binutils March, 2008 and first released in binutils version 2.19. Gold is developed by Ian Lance Taylor and a small team at Google with participation of general GNU community. The motivation for writing gold was to make a linker that is faster than the GNU linker, especially for large applications coded in C++. Gold is known to work on x86 and x86-64, PowerPC (partially) and ARM. Gold is intended to link faster but may not support that much architectures as original GNU  does however distributions, like Fedora, which primary supports GNU gold supported architectures may make it default linker in the future.

gold`s state in Fedora
GNU gold is in Fedora since binutils 2.19 release but was not built until recently. In binutils-2.20.51.0.2-7 (F-13/rawhide that time) we build gold as alternative linker to ld. Via  we have   which is symbolic link to either   (original  ), or. By default  links to BFD   but altering spec file is easily possible.

Before Fedora may uses gold as primary linker, several things have to be assured


 * gold is stable and feature full, so linked apps generally work,
 * gold is supported and available for Fedora-supported architectures,
 * gold gives speed benefits, and
 * Fedora application stack is capable of being linked by gold

Basics
is a Bash script which utilizes Mock, rpm-build, createrepo, yum and  itself to rebuild, hence the name, Fedora packages or even whole comps groups and link resulted object files with   instead of. For this purpose builds daily binutils CVS snapshot from trunk as part of Rawhide binutils SRPM and installs resulted new binutils packages to repository reachable by Mock. If rebuild of particular package fails it`s logged and failure is guess-classified to state what might be the problem.

Linear description of how-it-works
Code should be well commented so you shouldn`t have much problems reading and understanding it


 * 1) First we parse options and set several variables determining whether we are "quiet" or "verbose", building whole comps group or just several packages, etc.
 * 2) If script is asked for rebuild of binutils from CVS, it
 * 3) Downloads latest binutils package from Koji and installs it on localhost
 * 4) Gets   and places it to RPM SOURCES/ directory
 * 5) Several necessary edits to Rawhide`s specfile is necessary - Version and Release fields are bumped to include snapshot date, recent upstream incorporated patches are turned off (one has to specify them in sources now...)
 * 6) SRPM package is built and we hand it to mock for rebuild
 * 7) binutils packages are built and placed into shiny new repository, createrepo is ran on it
 * 8) repository is added (if necessary) and enabled to be on for other packages when are being rebuilt
 * 9) Selected SRPM packages for rebuild and linage by gold are downloaded to cache, dupes are removed
 * 10) Logging facilities are being set
 * 11) Script now iterates for every SRPM package
 * 12) Mock is asked to rebuild package $PK1
 * 13) Log is archived for later investigation
 * 14) If rebuild passed - good for us! - size of produced packages and time spent are logged, otherwise script investigates roots of the problem
 * 15) Last lines from log are being removed known to be bogus lines (such as   or   or  ), actually last 15 lines are being inspected.
 * 16) Error classification.
 * 17) When error type is guessed, error message is written out
 * 18) After all packages passed or failed to build'n'link statistics is produced (e.g. TOTAL: 99 PASS: 84 FAIL: 15)
 * 19) As last step, all logs are archived

Passed rebuild

 * ./gold-rebuild --quiet --color --rebuild --package hardlink

Download
http://mnowak.fedorapeople.org/gold-rebuild/dist/

There are tarballs and respective spec file, you can easily make your own RPM file.