haskell / haskell/cabal

Cabal should squash split sections when linking GHCi object

Open
#6,338 1 comment 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.