diff options
author | Austin Seipp <austin@well-typed.com> | 2014-02-13 07:17:30 -0600 |
---|---|---|
committer | Austin Seipp <austin@well-typed.com> | 2014-02-17 01:47:06 -0600 |
commit | dc080915597065087b3821b3ded0a621a7e2fae7 (patch) | |
tree | bb8b28d622b628f299e95214c8a146b523268d1f /compiler/ghci | |
parent | a8a01e742434df11b830ab99af12d9045dfcbc4b (diff) | |
download | haskell-dc080915597065087b3821b3ded0a621a7e2fae7.tar.gz |
Fix #8770
As usual, Mac OS X is extremely annoying (or the software is, anyway),
because not only does it load dynamic libraries with the .dylib
extension, but also the .so extension. For whatever reason. At least
it's easy to fix.
Signed-off-by: Austin Seipp <austin@well-typed.com>
Diffstat (limited to 'compiler/ghci')
-rw-r--r-- | compiler/ghci/Linker.lhs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/compiler/ghci/Linker.lhs b/compiler/ghci/Linker.lhs index eb3e226ab4..274f2fbd44 100644 --- a/compiler/ghci/Linker.lhs +++ b/compiler/ghci/Linker.lhs @@ -378,7 +378,16 @@ preloadLib dflags lib_paths framework_paths lib_spec -> do maybe_errstr <- loadDLL (mkSOName platform dll_unadorned) case maybe_errstr of Nothing -> maybePutStrLn dflags "done" - Just mm -> preloadFailed mm lib_paths lib_spec + Just mm | platformOS platform /= OSDarwin -> + preloadFailed mm lib_paths lib_spec + Just mm | otherwise -> do + -- As a backup, on Darwin, try to also load a .so file + -- since (apparently) some things install that way - see + -- ticket #8770. + err2 <- loadDLL $ ("lib" ++ dll_unadorned) <.> "so" + case err2 of + Nothing -> maybePutStrLn dflags "done" + Just _ -> preloadFailed mm lib_paths lib_spec DLLPath dll_path -> do maybe_errstr <- loadDLL dll_path |