diff options
| author | Tamar Christina <tamar@zhox.com> | 2016-11-06 19:08:40 +0000 | 
|---|---|---|
| committer | Tamar Christina <tamar@zhox.com> | 2016-11-06 19:08:40 +0000 | 
| commit | 1964d8690aa41313de31f4ae0113a498d6943d44 (patch) | |
| tree | 2d49c5070e5766c798eef5425ad8df279d443b55 | |
| parent | ead83db8a7db772a9f248af9767a4283218a5c9f (diff) | |
| download | haskell-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
| -rw-r--r-- | compiler/ghci/Linker.hs | 2 | ||||
| -rw-r--r-- | compiler/main/HscTypes.hs | 5 | ||||
| -rw-r--r-- | rts/linker/PEi386.c | 2 | 
3 files changed, 4 insertions, 5 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 diff --git a/rts/linker/PEi386.c b/rts/linker/PEi386.c index b8c5231bab..56975ed976 100644 --- a/rts/linker/PEi386.c +++ b/rts/linker/PEi386.c @@ -1559,7 +1559,7 @@ SymbolAddr *lookupSymbol_PEi386(SymbolName *lbl)      RtsSymbolInfo *pinfo;      if (!ghciLookupSymbolInfo(symhash, lbl, &pinfo)) { -        IF_DEBUG(linker, debugBelch("lookupSymbol: symbol not found\n")); +        IF_DEBUG(linker, debugBelch("lookupSymbol: symbol '%s' not found\n", lbl));          SymbolAddr* sym; | 
