diff options
| author | Simon Marlow <marlowsd@gmail.com> | 2010-01-03 22:36:37 +0000 |
|---|---|---|
| committer | Simon Marlow <marlowsd@gmail.com> | 2010-01-03 22:36:37 +0000 |
| commit | cd24d61675e2f5c9145efcac62f64347789e583c (patch) | |
| tree | 7c6694acd631be8d5ee8b84f1d10e4cf4a7e3e6e /compiler/ghci | |
| parent | b06d623b2e367a572de5daf06d6a0b12c2740471 (diff) | |
| download | haskell-cd24d61675e2f5c9145efcac62f64347789e583c.tar.gz | |
locateOneObj: don't look for dynamic libs in static mode
also replace picIsOn with isDynamicGhcLib, as __PIC__ is not the
correct test for whether the GHC library is dynamically linked.
Diffstat (limited to 'compiler/ghci')
| -rw-r--r-- | compiler/ghci/Linker.lhs | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/compiler/ghci/Linker.lhs b/compiler/ghci/Linker.lhs index 43bd80ed37..d2459f4920 100644 --- a/compiler/ghci/Linker.lhs +++ b/compiler/ghci/Linker.lhs @@ -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 |
