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

GHC ghc-devs at haskell.org
Fri Apr 7 00:12:09 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.

 In fact, I would even weakly suggest that we might consider enabling
 `--enable-gold` the default behavior, requiring the user to explicitly
 pass `--disable-gold` if they want the current behavior.

--

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


More information about the ghc-tickets mailing list