[commit: ghc] ghc-7.10: Dynamically link all loaded packages in new object (2e2d540)

git at git.haskell.org git at git.haskell.org
Mon Mar 9 18:54:49 UTC 2015


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

On branch  : ghc-7.10
Link       : http://ghc.haskell.org/trac/ghc/changeset/2e2d5401e76cdc0db58617662c529b7a5c593461/ghc

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

commit 2e2d5401e76cdc0db58617662c529b7a5c593461
Author: Peter Trommler <ptrommler at acm.org>
Date:   Sat Mar 7 11:13:37 2015 -0600

    Dynamically link all loaded packages in new object
    
    Summary:
    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: https://phabricator.haskell.org/D676
    
    GHC Trac Issues: #10058
    
    (cherry picked from commit 0fcc454329c4e3e0dc4474412bff599d0e9bdfcd)


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

2e2d5401e76cdc0db58617662c529b7a5c593461
 compiler/ghci/Linker.hs | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/compiler/ghci/Linker.hs b/compiler/ghci/Linker.hs
index 91706da..f9467e1 100644
--- a/compiler/ghci/Linker.hs
+++ b/compiler/ghci/Linker.hs
@@ -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



More information about the ghc-commits mailing list