ghci: Load static objects in batches
authorBen Gamari <ben@smart-cactus.org>
Fri, 14 Jun 2019 20:53:12 +0000 (16:53 -0400)
committerBen Gamari <ben@smart-cactus.org>
Tue, 25 Jun 2019 22:33:43 +0000 (18:33 -0400)
commit921c18deaf6ea776330f6d78ab58e754a385bdde
tree886cf6ca8f2864d4e93c2a65e4355d3bf2d8c208
parentbbf5dfa68edac55b6700a981977ae5421ff07536
ghci: Load static objects in batches

Previously in the case where GHC was dynamically linked we would load
static objects one-by-one by linking each into its own shared object and
dlopen'ing each in order. However, this meant that the link would fail
in the event that the objects had cyclic symbol dependencies.

Here we fix this by merging each "run" of static objects into a single
shared object and loading this.

Fixes #13786 for the case where GHC is dynamically linked.

(cherry picked from commit cd177b44695382878eca7800fb2493b72b20c1e7)
compiler/ghci/Linker.hs