X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Fghci%2FLinker.lhs;h=eaf452199eb1e7c38fd902e0d7e30ebd48a4ea22;hp=29228b1b7e6761d719a6ec5b35711640ee0663cb;hb=16b9e80dc14db24509f051f294b5b51943285090;hpb=9142c238bd014c45e30fc79eee69fa6ab3f469d8 diff --git a/compiler/ghci/Linker.lhs b/compiler/ghci/Linker.lhs index 29228b1..eaf4521 100644 --- a/compiler/ghci/Linker.lhs +++ b/compiler/ghci/Linker.lhs @@ -245,11 +245,18 @@ dataConInfoPtrToName x = do where (modWords, occWord) = ASSERT (length rest1 > 0) (parseModOcc [] (tail rest1)) parseModOcc :: [[Word8]] -> [Word8] -> ([[Word8]], [Word8]) - parseModOcc acc str + -- We only look for dots if str could start with a module name, + -- i.e. if it starts with an upper case character. + -- Otherwise we might think that "X.:->" is the module name in + -- "X.:->.+", whereas actually "X" is the module name and + -- ":->.+" is a constructor name. + parseModOcc acc str@(c : _) + | isUpper $ chr $ fromIntegral c = case break (== dot) str of (top, []) -> (acc, top) - (top, _:bot) -> parseModOcc (top : acc) bot - + (top, _ : bot) -> parseModOcc (top : acc) bot + parseModOcc acc str = (acc, str) + -- | Get the 'HValue' associated with the given name. -- -- May cause loading the module that contains the name. @@ -1105,6 +1112,9 @@ loadFrameworks pkg -- If it isn't present, we assume it's a dynamic library. locateOneObj :: [FilePath] -> String -> IO LibrarySpec locateOneObj dirs lib + | not ("HS" `isPrefixOf` lib) + -- For non-Haskell libraries (e.g. gmp, iconv) we assume dynamic library + = assumeDll | not isDynamicGhcLib -- When the GHC package was not compiled as dynamic library -- (=DYNAMIC not set), we search for .o libraries or, if they