Commit 7df27d52 authored by Austin Seipp's avatar Austin Seipp

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: default avatarAustin Seipp <austin@well-typed.com>
parent 4d5d68a8
......@@ -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
......
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment