summaryrefslogtreecommitdiff
path: root/compiler/main/Packages.lhs
diff options
context:
space:
mode:
authorAustin Seipp <austin@well-typed.com>2014-02-24 13:03:34 -0600
committerAustin Seipp <austin@well-typed.com>2014-02-24 14:13:59 -0600
commited1aced403b50f1a15fbe06cc7eeca5b23e69e37 (patch)
tree5da03cd708bff4f75d248cf0b57134bb2fb3426f /compiler/main/Packages.lhs
parentbeac5252d444bafb0722bc6d13c6dd2d49a12070 (diff)
downloadhaskell-ed1aced403b50f1a15fbe06cc7eeca5b23e69e37.tar.gz
Fix #8696 - don't generate static intra-package references.
See the comments in Packages.lhs and the ticket for some more explanation. This is a temporary fix while we consider a way to re-enable intra-package references in the mean time. Authored-by: Reid Barton <rwbarton@gmail.com> Signed-off-by: Austin Seipp <austin@well-typed.com>
Diffstat (limited to 'compiler/main/Packages.lhs')
-rw-r--r--compiler/main/Packages.lhs16
1 files changed, 14 insertions, 2 deletions
diff --git a/compiler/main/Packages.lhs b/compiler/main/Packages.lhs
index aefb5360ed..a13b3599b8 100644
--- a/compiler/main/Packages.lhs
+++ b/compiler/main/Packages.lhs
@@ -1047,10 +1047,22 @@ isDllName :: DynFlags -> PackageId -> Module -> Name -> Bool
-- Despite the "dll", I think this function just means that
-- the synbol comes from another dynamically-linked package,
-- and applies on all platforms, not just Windows
-isDllName dflags this_pkg this_mod name
+isDllName dflags _this_pkg this_mod name
| gopt Opt_Static dflags = False
| Just mod <- nameModule_maybe name
- = if modulePackageId mod /= this_pkg
+ -- Issue #8696 - when GHC is dynamically linked, it will attempt
+ -- to load the dynamic dependencies of object files at compile
+ -- time for things like QuasiQuotes or
+ -- TemplateHaskell. Unfortunately, this interacts badly with
+ -- intra-package linking, because we don't generate indirect
+ -- (dynamic) symbols for intra-package calls. This means that if a
+ -- module with an intra-package call is loaded without its
+ -- dependencies, then GHC fails to link. This is the cause of #
+ --
+ -- In the mean time, always force dynamic indirections to be
+ -- generated: when the module name isn't the module being
+ -- compiled, references are dynamic.
+ = if mod /= this_mod
then True
else case dllSplit dflags of
Nothing -> False