[commit: ghc] master: Don't run the system linker unncessarily. (3332737)

git at git.haskell.org git at git.haskell.org
Wed Aug 14 07:43:49 CEST 2013


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/333273792479695cf79a72cffa4c579d0c9deb21/ghc

>---------------------------------------------------------------

commit 333273792479695cf79a72cffa4c579d0c9deb21
Author: Patrick Palka <patrick at parcs.ath.cx>
Date:   Tue Aug 13 23:11:22 2013 -0400

    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 at pobox.com>


>---------------------------------------------------------------

333273792479695cf79a72cffa4c579d0c9deb21
 compiler/ghci/Linker.lhs |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/compiler/ghci/Linker.lhs b/compiler/ghci/Linker.lhs
index a409e7f..45bc9d5 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





More information about the ghc-commits mailing list