X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fghci%2FLinker.lhs;h=c566b8f3f52663f30533e863b8241ef40f66ae31;hb=85255a966b21172ce5a26c8a9cb0cdaf7315be95;hp=d7f3da3d5bfb4204e667c6e5ccbf078fb2c65a2f;hpb=f16f92c17c7afdfe7c820a3820316318b7712842;p=ghc-hetmet.git diff --git a/compiler/ghci/Linker.lhs b/compiler/ghci/Linker.lhs index d7f3da3..c566b8f 100644 --- a/compiler/ghci/Linker.lhs +++ b/compiler/ghci/Linker.lhs @@ -14,6 +14,9 @@ necessary. \begin{code} {-# OPTIONS -optc-DNON_POSIX_SOURCE -#include "Linker.h" #-} +{-# OPTIONS -fno-cse #-} +-- -fno-cse is needed for GLOBAL_VAR's to behave properly + module Linker ( HValue, getHValue, showLinkerState, linkExpr, unload, withExtendedLinkEnv, extendLinkEnv, deleteFromLinkEnv, @@ -72,6 +75,8 @@ import System.FilePath import System.IO import System.Directory +import Distribution.Package hiding (depends) + import Control.Exception import Data.Maybe \end{code} @@ -944,10 +949,11 @@ data LibrarySpec -- of DLL handles that rts/Linker.c maintains, and that in turn is -- used by lookupSymbol. So we must call addDLL for each library -- just to get the DLL handle into the list. -partOfGHCi :: [String] +partOfGHCi :: [PackageName] partOfGHCi | isWindowsTarget || isDarwinTarget = [] - | otherwise = [ "base", "haskell98", "template-haskell", "editline" ] + | otherwise = map PackageName + ["base", "haskell98", "template-haskell", "editline"] showLS :: LibrarySpec -> String showLS (Object nm) = "(static) " ++ nm @@ -1022,7 +1028,7 @@ linkPackage dflags pkg maybePutStr dflags ("Loading package " ++ display (package pkg) ++ " ... ") -- See comments with partOfGHCi - when (pkgName (package pkg) `notElem` partOfGHCi) $ do + when (packageName pkg `notElem` partOfGHCi) $ do loadFrameworks pkg -- When a library A needs symbols from a library B, the order in -- extra_libraries/extra_ld_opts is "-lA -lB", because that's the