summaryrefslogtreecommitdiff
path: root/compiler/ghci
diff options
context:
space:
mode:
authorPatrick Palka <patrick@parcs.ath.cx>2013-08-13 23:11:22 -0400
committerAustin Seipp <aseipp@pobox.com>2013-08-14 00:42:47 -0500
commit333273792479695cf79a72cffa4c579d0c9deb21 (patch)
treec9ed8ddaeb3b877c46d35230894edb0723773461 /compiler/ghci
parentefde8ec55ef43f82306a06c70d527ae3868b92cd (diff)
downloadhaskell-333273792479695cf79a72cffa4c579d0c9deb21.tar.gz
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: Austin Seipp <aseipp@pobox.com>
Diffstat (limited to 'compiler/ghci')
-rw-r--r--compiler/ghci/Linker.lhs6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/ghci/Linker.lhs b/compiler/ghci/Linker.lhs
index a409e7f628..45bc9d56c9 100644
--- a/compiler/ghci/Linker.lhs
+++ b/compiler/ghci/Linker.lhs
@@ -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