summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2009-11-04 16:30:39 +0000
committerSimon Marlow <marlowsd@gmail.com>2009-11-04 16:30:39 +0000
commit86b891f0de066ff67c4197918227eda4dec55d22 (patch)
tree1c2f0ea4b325af57ca944322e0cba9b15843615f /compiler
parent1ef67b9729bc796b6e4fca24a1e7934e48e92840 (diff)
downloadhaskell-86b891f0de066ff67c4197918227eda4dec55d22.tar.gz
#3604: treat TH with -dynamic in the same way as -prof
That is, you have to build the library/program without -dynamic first, to get plain object files, and then build it again with -dynamic. I still need to check whether any changes to Cabal are required to make this work.
Diffstat (limited to 'compiler')
-rw-r--r--compiler/ghci/Linker.lhs11
1 files changed, 10 insertions, 1 deletions
diff --git a/compiler/ghci/Linker.lhs b/compiler/ghci/Linker.lhs
index a7e9492dea..43bd80ed37 100644
--- a/compiler/ghci/Linker.lhs
+++ b/compiler/ghci/Linker.lhs
@@ -528,7 +528,16 @@ dieWith span msg = ghcError (ProgramError (showSDoc (mkLocMessage span msg)))
checkNonStdWay :: DynFlags -> SrcSpan -> IO (Maybe String)
checkNonStdWay dflags srcspan = do
let tag = buildTag dflags
- if null tag || tag == "dyn" then return Nothing else do
+ if null tag {- || tag == "dyn" -} then return Nothing else do
+ -- see #3604: object files compiled for way "dyn" need to link to the
+ -- dynamic packages, so we can't load them into a statically-linked GHCi.
+ -- we have to treat "dyn" in the same way as "prof".
+ --
+ -- In the future when GHCi is dynamically linked we should be able to relax
+ -- this, but they we may have to make it possible to load either ordinary
+ -- .o files or -dynamic .o files into GHCi (currently that's not possible
+ -- because the dynamic objects contain refs to e.g. __stginit_base_Prelude_dyn
+ -- whereas we have __stginit_base_Prelude_.
let default_osuf = phaseInputExt StopLn
if objectSuf dflags == default_osuf
then failNonStd srcspan