Cabal should squash split sections when linking GHCi object
- Dominant language
- Haskell
- Stars
- 1.7k
- Forks
- 750
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 28
Description
**Describe the bug**
Currently building of objects for GHCi is disabled by default (#977) as Cabal's current implementation can result in very long loading times in GHCi is `-split-sections` is enabled (see [GHC #15524](https://gitlab.haskell.org/ghc/ghc/issues/15524)).
The reason for these long loading times is that Cabal naively combines the objects without combining the many sections produced by `-split-sections`. This creates an enormous amount of unnecessary work for the runtime linker.
The solution here is straightforward: Cabal should tell the linker to merge these sections with a linker script, as done [by GHC](https://gitlab.haskell.org/ghc/ghc/blob/a956663291435cbcb3ad7bc5db01597e8604063a/driver/utils/merge_sections.ld).
Contributor guide
Assessment
This issue has not been assessed yet.