summaryrefslogtreecommitdiff
path: root/compiler/main/Packages.hs
diff options
context:
space:
mode:
authorThomas Miedema <thomasmiedema@gmail.com>2015-12-15 01:07:24 +0100
committerBen Gamari <ben@smart-cactus.org>2015-12-15 01:38:10 +0100
commit6d9c18cb43c1fda95932ef0f640dcf41906a2773 (patch)
tree3c43af6f62a7de90e86e8c29a56bda6fd7ee2bb4 /compiler/main/Packages.hs
parent05a5ebed916dc00bc5761224047440fefe10485e (diff)
downloadhaskell-6d9c18cb43c1fda95932ef0f640dcf41906a2773.tar.gz
DynFlags: remove Opt_Static
There are currently 2 different ways to test for a static or dynamic build: * Test if WayDyn is in ways * Test if Opt_Static is set The problem is that these can easily go out of sync, especially when using the GHC API. This commit replaces all queries of Opt_Static with an equivalent query of WayDyn. This would have prevented bug #8294 and fixes #11154. Reviewers: hvr, austin, bgamari Reviewed By: austin, bgamari Differential Revision: https://phabricator.haskell.org/D1607 GHC Trac Issues: #10636
Diffstat (limited to 'compiler/main/Packages.hs')
-rw-r--r--compiler/main/Packages.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/main/Packages.hs b/compiler/main/Packages.hs
index ac4fae2449..8d0f2a67aa 100644
--- a/compiler/main/Packages.hs
+++ b/compiler/main/Packages.hs
@@ -1157,7 +1157,7 @@ packageHsLibs dflags p = map (mkDynName . addSuffix) (hsLibraries p)
rts_tag = mkBuildTag ways2
mkDynName x
- | gopt Opt_Static dflags = x
+ | WayDyn `notElem` ways dflags = x
| "HS" `isPrefixOf` x =
x ++ '-':programName dflags ++ projectVersion dflags
-- For non-Haskell libraries, we use the name "Cfoo". The .a
@@ -1362,10 +1362,10 @@ unitIdPackageIdString dflags pkg_key
-- | Will the 'Name' come from a dynamically linked library?
isDllName :: DynFlags -> UnitId -> Module -> Name -> Bool
-- Despite the "dll", I think this function just means that
--- the synbol comes from another dynamically-linked package,
+-- the symbol comes from another dynamically-linked package,
-- and applies on all platforms, not just Windows
isDllName dflags _this_pkg this_mod name
- | gopt Opt_Static dflags = False
+ | WayDyn `notElem` ways dflags = False
| Just mod <- nameModule_maybe name
-- Issue #8696 - when GHC is dynamically linked, it will attempt
-- to load the dynamic dependencies of object files at compile