summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorAustin Seipp <austin@well-typed.com>2014-01-13 02:52:35 -0600
committerAustin Seipp <austin@well-typed.com>2014-01-14 03:46:06 -0600
commit7df27d52cffa915886b9f2860e961a0e7bb5dd1e (patch)
treebe30072f1fdef66f916e94387044ac57d009054f /compiler
parent4d5d68a87c282dc4bdac146685b2705de8fdbe3a (diff)
downloadhaskell-7df27d52cffa915886b9f2860e961a0e7bb5dd1e.tar.gz
Fix the behavior of ae87e122 (#8180)
As Simon pointed out, we should only enable -dynamic-too in the template haskell case if GHC is dynamic and we're not already compiling in the dyn way (the dyn way will be switched on by -dynamic-too later in the pipeline anyway - see pipeLoop) Signed-off-by: Austin Seipp <austin@well-typed.com>
Diffstat (limited to 'compiler')
-rw-r--r--compiler/main/DriverPipeline.hs4
-rw-r--r--compiler/main/DynFlags.hs4
2 files changed, 3 insertions, 5 deletions
diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs
index acd231e88a..df0f8e6492 100644
--- a/compiler/main/DriverPipeline.hs
+++ b/compiler/main/DriverPipeline.hs
@@ -139,10 +139,10 @@ compileOne' m_tc_result mHscMessage
input_fnpp = ms_hspp_file summary
mod_graph = hsc_mod_graph hsc_env0
needsTH = any (xopt Opt_TemplateHaskell . ms_hspp_opts) mod_graph
-
+ isDynWay = any (== WayDyn) (ways dflags0)
-- #8180 - when using TemplateHaskell, switch on -dynamic-too so
-- the linker can correctly load the object files.
- let dflags1 = if needsTH
+ let dflags1 = if needsTH && dynamicGhc && not isDynWay
then gopt_set dflags0 Opt_BuildDynamicToo
else dflags0
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index 1c0a92351b..193303eeef 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -114,11 +114,9 @@ module DynFlags (
compilerInfo,
#ifdef GHCI
--- Only in stage 2 can we be sure that the RTS
--- exposes the appropriate runtime boolean
rtsIsProfiled,
- dynamicGhc,
#endif
+ dynamicGhc,
#include "../includes/dist-derivedconstants/header/GHCConstantsHaskellExports.hs"
bLOCK_SIZE_W,