summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2023-02-10 14:56:08 +0000
committerMatthew Pickering <matthewtpickering@gmail.com>2023-02-10 14:56:08 +0000
commitda8686e9e1dc0c71c92bff6b9183aff533d8baef (patch)
tree1ab74c385da4ab2efe204873a96aef4f630d5ec9
parentfb2be3f403689b020b447cf82a23c97b6b809b87 (diff)
downloadhaskell-wip/mp-ghci-fixes-9.6.tar.gz
linker fixes mhuwip/mp-ghci-fixes-9.6
-rw-r--r--compiler/GHC/Linker/Loader.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/GHC/Linker/Loader.hs b/compiler/GHC/Linker/Loader.hs
index 151e3ba7c2..d26f6c0c03 100644
--- a/compiler/GHC/Linker/Loader.hs
+++ b/compiler/GHC/Linker/Loader.hs
@@ -1126,7 +1126,8 @@ dynLoadObjs interp hsc_env pls@LoaderState{..} objs = do
-- 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 logger tmpfs dflags2 unit_env objs (loaded_pkg_uid <$> eltsUDFM pkgs_loaded)
+ pprTraceM "pkgs" (ppr (loaded_pkg_uid <$> eltsUDFM pkgs_loaded))
+ linkDynLib logger tmpfs dflags2 unit_env objs [] -- (loaded_pkg_uid <$> eltsUDFM pkgs_loaded)
-- if we got this far, extend the lifetime of the library file
changeTempFilesLifetime tmpfs TFL_GhcSession [soFile]
@@ -1383,7 +1384,10 @@ loadPackages' interp hsc_env new_pks pls = do
= throwGhcExceptionIO (CmdLineError ("unknown package: " ++ unpackFS (unitIdFS new_pkg)))
-loadPackage :: Interp -> HscEnv -> UnitInfo -> IO ([LibrarySpec], [LibrarySpec])
+loadPackage :: HasCallStack => Interp -> HscEnv -> UnitInfo -> IO ([LibrarySpec], [LibrarySpec])
+
+loadPackage _ hsc_env pkg | unitId pkg `elem` hsc_all_home_unit_ids hsc_env = return ([], [])
+
loadPackage interp hsc_env pkg
= do
let dflags = hsc_dflags hsc_env