Commit 0fcc4543 authored by Peter Trommler's avatar Peter Trommler 🥁 Committed by Austin Seipp
Browse files

Dynamically link all loaded packages in new object

As a result of fixing #8935 we needed to open shared libraries
with RTLD_LOCAL and so symbols from packages loaded earlier
cannot be found anymore. We need to include in the link all
packages loaded so far.

This fixes #10058

Test Plan: validate

Reviewers: hvr, simonmar, austin

Reviewed By: austin

Subscribers: rwbarton, thomie

Differential Revision:

GHC Trac Issues: #10058
parent 76b1e119
......@@ -846,7 +846,10 @@ dynLoadObjs dflags pls objs = do
buildTag = mkBuildTag [WayDyn],
outputFile = Just soFile
linkDynLib dflags2 objs []
-- link all "loaded packages" so symbols in those can be resolved
-- Note: We are loading packages with local scope, so to see the
-- symbols in this link we must link all loaded packages again.
linkDynLib dflags2 objs (pkgs_loaded pls)
consIORef (filesToNotIntermediateClean dflags) soFile
m <- loadDLL soFile
case m of
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment