Commit 33327379 authored by parcs's avatar parcs Committed by thoughtpolice

Don't run the system linker unncessarily.

This wastes time when evaluating expressions in GHCi. We also
disable object unloading when using the dynamic linker, too.

Fixes #7382. Fixes #7326.
Signed-off-by: thoughtpolice's avatarAustin Seipp <aseipp@pobox.com>
parent efde8ec5
......@@ -785,7 +785,7 @@ dynLinkObjs dflags pls objs = do
if cDYNAMIC_GHC_PROGRAMS
then do dynLoadObjs dflags wanted_objs
return (pls, Succeeded)
return (pls1, Succeeded)
else do mapM_ loadObj wanted_objs
-- Link them all together
......@@ -800,6 +800,7 @@ dynLinkObjs dflags pls objs = do
return (pls2, Failed)
dynLoadObjs :: DynFlags -> [FilePath] -> IO ()
dynLoadObjs _ [] = return ()
dynLoadObjs dflags objs = do
let platform = targetPlatform dflags
soFile <- newTempName dflags (soExt platform)
......@@ -967,6 +968,9 @@ unload_wkr _ linkables pls
maybeUnload :: [Linkable] -> Linkable -> IO Bool
maybeUnload keep_linkables lnk
| linkableInSet lnk keep_linkables = return True
-- We don't do any cleanup when linking objects with the dynamic linker.
-- Doing so introduces extra complexity for not much benefit.
| cDYNAMIC_GHC_PROGRAMS = return False
| otherwise
= do mapM_ unloadObj [f | DotO f <- linkableUnlinked lnk]
-- The components of a BCO linkable may contain
......
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