summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorTamar Christina <tamar@zhox.com>2016-11-06 19:08:40 +0000
committerTamar Christina <tamar@zhox.com>2016-11-06 19:08:40 +0000
commit1964d8690aa41313de31f4ae0113a498d6943d44 (patch)
tree2d49c5070e5766c798eef5425ad8df279d443b55 /compiler
parentead83db8a7db772a9f248af9767a4283218a5c9f (diff)
downloadhaskell-1964d8690aa41313de31f4ae0113a498d6943d44.tar.gz
Some minor linker cleanups.
Summary: Just some cleanups to some oddities I've noticed while investigating a linker issue. Particularly the dll name returned by `findSysDll` was decorated. So foo.dll is returned. We make it `foo.dll.dll` and later drop one `.dll` when passed to `addDll` which expects it without extension, but still tries the name *as is* which is why it worked. This should be slightly faster, since we don't try 4 loads before we succeed. Test Plan: ./validate Reviewers: austin, hvr, erikd, simonmar, bgamari Reviewed By: bgamari Subscribers: thomie, #ghc_windows_task_force Differential Revision: https://phabricator.haskell.org/D2680
Diffstat (limited to 'compiler')
-rw-r--r--compiler/ghci/Linker.hs2
-rw-r--r--compiler/main/HscTypes.hs5
2 files changed, 3 insertions, 4 deletions
diff --git a/compiler/ghci/Linker.hs b/compiler/ghci/Linker.hs
index 73d0fac1f5..4a0b62f904 100644
--- a/compiler/ghci/Linker.hs
+++ b/compiler/ghci/Linker.hs
@@ -1349,7 +1349,7 @@ locateLib hsc_env is_hs dirs lib
in liftM2 (<|>) local linked
findHSDll = liftM (fmap DLLPath) $ findFile dirs hs_dyn_lib_file
findDll = liftM (fmap DLLPath) $ findFile dirs dyn_lib_file
- findSysDll = fmap (fmap $ DLL . takeFileName) $ findSystemLibrary hsc_env so_name
+ findSysDll = fmap (fmap $ DLL . dropExtension . takeFileName) $ findSystemLibrary hsc_env so_name
tryGcc = let short = liftM (fmap DLLPath) $ searchForLibUsingGcc dflags so_name dirs
full = liftM (fmap DLLPath) $ searchForLibUsingGcc dflags lib_so_name dirs
in liftM2 (<|>) short full
diff --git a/compiler/main/HscTypes.hs b/compiler/main/HscTypes.hs
index 9b2584dd0a..44b5634008 100644
--- a/compiler/main/HscTypes.hs
+++ b/compiler/main/HscTypes.hs
@@ -2521,9 +2521,8 @@ updNameCacheIO hsc_env upd_fn
mkSOName :: Platform -> FilePath -> FilePath
mkSOName platform root
= case platformOS platform of
- OSDarwin -> ("lib" ++ root) <.> "dylib"
- OSMinGW32 -> root <.> "dll"
- _ -> ("lib" ++ root) <.> "so"
+ OSMinGW32 -> root <.> soExt platform
+ _ -> ("lib" ++ root) <.> soExt platform
mkHsSOName :: Platform -> FilePath -> FilePath
mkHsSOName platform root = ("lib" ++ root) <.> soExt platform