[commit: ghc] master: Fix the behavior of ae87e122 (#8180) (7df27d5)
git at git.haskell.org
git at git.haskell.org
Tue Jan 14 09:46:47 UTC 2014
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/7df27d52cffa915886b9f2860e961a0e7bb5dd1e/ghc
>---------------------------------------------------------------
commit 7df27d52cffa915886b9f2860e961a0e7bb5dd1e
Author: Austin Seipp <austin at well-typed.com>
Date: Mon Jan 13 02:52:35 2014 -0600
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 at well-typed.com>
>---------------------------------------------------------------
7df27d52cffa915886b9f2860e961a0e7bb5dd1e
compiler/main/DriverPipeline.hs | 4 ++--
compiler/main/DynFlags.hs | 4 +---
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs
index acd231e..df0f8e6 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 1c0a923..193303e 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,
More information about the ghc-commits
mailing list