[GHC] #11285: Split objects makes static linking really slow

GHC ghc-devs at haskell.org
Sat Dec 26 17:50:37 UTC 2015


#11285: Split objects makes static linking really slow
-------------------------------------+-------------------------------------
        Reporter:  ezyang            |                Owner:
            Type:  feature request   |               Status:  new
        Priority:  high              |            Milestone:
       Component:  Compiler          |              Version:  7.11
  (Linking)                          |
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  performance bug                    |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by olsner):

 ghc could very well default to use gold if it's available, I think. There
 are a few reasons to explicitly need bfd-ld (e.g. when using linker
 scripts), but for linking normal programs it shouldn't matter either way.
 To support "special" use cases, we'd just need to make sure `-optl-fuse-
 ld=bfd` overrides ghc's setting.


 > Could we enhance GHC to support running the linker in a "fast mode"

 I think this is not entirely up to the linking stage, as both split
 objects and function-sections are compile-time rather than link-time
 settings.

 Something that could be done at the linking stage is linking against the
 incrementally linked libraries-for-ghci - both split objects and split
 sections are undone by the incremental linking step. That might just run
 into different bottlenecks though :)

 Since #8405, `--gc-sections` is sent to the linker too. IIRC my previous
 experiments didn't find that it affected link times much unless actually
 using `-split-sections` for the installed libraries, but it could be moved
 to an explicit flag if need be. The downside of that is that users then
 have to learn a new flag to get smaller binaries.

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


More information about the ghc-tickets mailing list