#4862: Enable usage of gold linker with GHC
------------------------------+---------------------------------------------
Reporter: ajd | Owner:
Type: feature request | Status: closed
Priority: normal | Milestone: 7.4.1
Component: Compiler | Version: 7.0.1
Resolution: worksforme | Keywords:
Testcase: | Blockedby:
Difficulty: | Os: Linux
Blocking: | Architecture: Unknown/Multiple
Failure: None/Unknown |
------------------------------+---------------------------------------------
Changes (by batterseapower):
* status: new => closed
* resolution: => worksforme
Comment:
AFAIK there is no problem with using GHC with gold. The original poster
may have been confused because trying to add "-pgml gold" to the GHC
command line won't work as GHC invokes the linker with C-compiler flags
like -DFOO, as it expects the linker to be g++.
In order to use gold with GHC, the only way I could find was to:
* In some directory (I used /home/mbolingbroke/bin), create a link called
ld to /usr/bin/ld.gold (or whatever it is called on your system)
* Invoke GHC with the argument -optl"-B/home/mbolingbroke/bin"
The -B option tells gcc/g++/collect2 to look in that directory first for
programs such as the linker. Because that directory contains an ld, that
one will be used in preference to the system linker (probably binutils
ld). For some reason GCC doesn't seem to have an equivalent to GHC's -pgml
flag..
If you want to verify that gold is being invoked you can use "strace -f -e
execve" as described here: http://infomonkey.cdleary.com/questions/19/is-
there-an-easy-way-to-use-the-gold-linker-for-js-shell-builds
I've tested this and it seems to work for a small example program, and
there is no reason to believe it will not work with larger examples.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4862#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs