X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fghci%2FLinker.lhs;h=45cbdc095fd468851ed0b9e272e10fa35c69b6b4;hb=628c40615eaa124605ad8f380296059bd71182ce;hp=43bd80ed3785339903253f8f31817c468461dc87;hpb=86b891f0de066ff67c4197918227eda4dec55d22;p=ghc-hetmet.git diff --git a/compiler/ghci/Linker.lhs b/compiler/ghci/Linker.lhs index 43bd80e..45cbdc0 100644 --- a/compiler/ghci/Linker.lhs +++ b/compiler/ghci/Linker.lhs @@ -38,7 +38,7 @@ import Name import NameEnv import NameSet import qualified OccName -import LazyUniqFM +import UniqFM import Module import ListSetOps import DynFlags @@ -103,18 +103,18 @@ data PersistentLinkerState -- When a new Unlinked is linked into the running image, or an existing -- module in the image is replaced, the itbl_env must be updated -- appropriately. - itbl_env :: ItblEnv, + itbl_env :: !ItblEnv, -- The currently loaded interpreted modules (home package) - bcos_loaded :: [Linkable], + bcos_loaded :: ![Linkable], -- And the currently-loaded compiled modules (home package) - objs_loaded :: [Linkable], + objs_loaded :: ![Linkable], -- The currently-loaded packages; always object code -- Held, as usual, in dependency order; though I am not sure if -- that is really important - pkgs_loaded :: [PackageId] + pkgs_loaded :: ![PackageId] } emptyPLS :: DynFlags -> PersistentLinkerState @@ -692,7 +692,7 @@ getLinkDeps hsc_env hpt pls maybe_normal_osuf span mods linkModules :: DynFlags -> PersistentLinkerState -> [Linkable] -> IO (PersistentLinkerState, SuccessFlag) linkModules dflags pls linkables - = block $ do -- don't want to be interrupted by ^C in here + = mask_ $ do -- don't want to be interrupted by ^C in here let (objs, bcos) = partition isObjectLinkable (concatMap partitionLinkable linkables) @@ -862,7 +862,7 @@ unload :: DynFlags -> [Linkable] -- ^ The linkables to *keep*. -> IO () unload dflags linkables - = block $ do -- block, so we're safe from Ctrl-C in here + = mask_ $ do -- mask, so we're safe from Ctrl-C in here -- Initialise the linker (if it's not been done already) initDynLinker dflags @@ -1084,23 +1084,20 @@ loadFrameworks pkg -- If it isn't present, we assume it's a dynamic library. locateOneObj :: [FilePath] -> String -> IO LibrarySpec locateOneObj dirs lib - | not picIsOn + | not isDynamicGhcLib -- When the GHC package was not compiled as dynamic library - -- (=__PIC__ not set), we search for .o libraries first. + -- (=DYNAMIC not set), we search for .o libraries. = do { mb_obj_path <- findFile mk_obj_path dirs ; case mb_obj_path of Just obj_path -> return (Object obj_path) - Nothing -> - do { mb_lib_path <- findFile mk_dyn_lib_path dirs - ; case mb_lib_path of - Just _ -> return (DLL dyn_lib_name) - Nothing -> return (DLL lib) }} -- We assume - | otherwise - -- When the GHC package was compiled as dynamic library (=__PIC__ set), + Nothing -> return (DLL lib) } + + | otherwise + -- When the GHC package was compiled as dynamic library (=DYNAMIC set), -- we search for .so libraries first. = do { mb_lib_path <- findFile mk_dyn_lib_path dirs ; case mb_lib_path of - Just _ -> return (DLL (lib ++ "-ghc" ++ cProjectVersion)) + Just _ -> return (DLL dyn_lib_name) Nothing -> do { mb_obj_path <- findFile mk_obj_path dirs ; case mb_obj_path of