[GHC] #13541: Make it easier to use the gold linker

GHC ghc-devs at haskell.org
Fri Apr 7 00:10:13 UTC 2017


#13541: Make it easier to use the gold linker
-------------------------------------+-------------------------------------
        Reporter:  bgamari           |                Owner:  (none)
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Description changed by bgamari:

Old description:

> As pointed out in #4862, the `gold` linker is significantly faster than
> BFD `ld`. Currently we use whatever linker `gcc` uses by default. This is
> an unfortunate situation for users as few packagers take the effort to
> configure their builds to use `gold`.
>
> I think we should consider the following,
>
> > Introduce a configure flag (to both the source distribution, and the
> distributed binary distributions), `--enable-gold`. When enabled,
> `configure` will check for the functioning of `gcc -fuse-ld=gold`. If
> found to work `-fuse-ld=gold` would be added to GHC's `optl`. The flag
> would throw an error on non-ELF platforms (which are not supported by
> `gold`).
>
> While there is admittedly not a whole lot of precedent for this, the
> status quo means we are leaving a significant bit of compiler performance
> on the table in a majority of cases. Given that `stack` uses GHC's
> official bindists, we should try to improve this situation.
>
>  *

New description:

 As pointed out in #4862, the `gold` linker is significantly faster than
 BFD `ld`. Currently we use whatever linker `gcc` uses by default. This is
 an unfortunate situation for users as few packagers take the effort to
 configure their builds to use `gold`.

 I think we should consider the following,

 > Introduce a configure flag (to both the source distribution, and the
 distributed binary distributions), `--enable-gold`. When enabled,
 `configure` will check for the functioning of `gcc -fuse-ld=gold`. If
 found to work `-fuse-ld=gold` would be added to GHC's `optl`. The flag
 would throw an error on non-ELF platforms (which are not supported by
 `gold`).

 While there is admittedly not a whole lot of precedent for this, the
 status quo means we are leaving a significant bit of compiler performance
 on the table in a majority of cases. Given that `stack` uses GHC's
 official bindists, we should try to improve this situation.

--

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13541#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list