[commit: ghc] master: Disable -dynamic-too on Windows (4d5d68a)
git at git.haskell.org
git at git.haskell.org
Tue Jan 14 09:46:45 UTC 2014
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/4d5d68a87c282dc4bdac146685b2705de8fdbe3a/ghc
>---------------------------------------------------------------
commit 4d5d68a87c282dc4bdac146685b2705de8fdbe3a
Author: Austin Seipp <austin at well-typed.com>
Date: Mon Jan 13 02:15:35 2014 -0600
Disable -dynamic-too on Windows
Signed-off-by: Austin Seipp <austin at well-typed.com>
>---------------------------------------------------------------
4d5d68a87c282dc4bdac146685b2705de8fdbe3a
compiler/main/DriverPipeline.hs | 18 ++++++++++--------
compiler/main/DynFlags.hs | 5 +++++
mk/config.mk.in | 1 +
3 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs
index 3cc176c..acd231e 100644
--- a/compiler/main/DriverPipeline.hs
+++ b/compiler/main/DriverPipeline.hs
@@ -596,14 +596,16 @@ runPipeline stop_phase hsc_env0 (input_fn, mb_phase)
-- -dynamic-too, but couldn't do the -dynamic-too fast
-- path, then rerun the pipeline for the dyn way
let dflags = extractDynFlags hsc_env
- when isHaskellishFile $ whenCannotGenerateDynamicToo dflags $ do
- debugTraceMsg dflags 4
- (text "Running the pipeline again for -dynamic-too")
- let dflags' = dynamicTooMkDynamicDynFlags dflags
- hsc_env' <- newHscEnv dflags'
- _ <- runPipeline' start_phase hsc_env' env input_fn
- maybe_loc maybe_stub_o
- return ()
+ -- NB: Currently disabled on Windows (ref #7134, #8228, and #5987)
+ when (not $ platformOS (targetPlatform dflags) == OSMinGW32) $ do
+ when isHaskellishFile $ whenCannotGenerateDynamicToo dflags $ do
+ debugTraceMsg dflags 4
+ (text "Running the pipeline again for -dynamic-too")
+ let dflags' = dynamicTooMkDynamicDynFlags dflags
+ hsc_env' <- newHscEnv dflags'
+ _ <- runPipeline' start_phase hsc_env' env input_fn
+ maybe_loc maybe_stub_o
+ return ()
return r
runPipeline'
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index 734e7e9..1c0a923 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -3614,6 +3614,11 @@ tARGET_MAX_WORD dflags
-- Be careful not to introduce potential loops!
makeDynFlagsConsistent :: DynFlags -> (DynFlags, [Located String])
makeDynFlagsConsistent dflags
+ -- Disable -dynamic-too on Windows (#8228, #7134, #5987)
+ | os == OSMinGW32 && gopt Opt_BuildDynamicToo dflags
+ = let dflags' = gopt_unset dflags Opt_BuildDynamicToo
+ warn = "-dynamic-too is not supported on Windows"
+ in loop dflags' warn
| hscTarget dflags == HscC &&
not (platformUnregisterised (targetPlatform dflags))
= if cGhcWithNativeCodeGen == "YES"
diff --git a/mk/config.mk.in b/mk/config.mk.in
index 59d48c4..350ea69 100644
--- a/mk/config.mk.in
+++ b/mk/config.mk.in
@@ -137,6 +137,7 @@ DYNAMIC_TOO = YES
ifeq "$(TargetOS_CPP)" "mingw32"
# This doesn't work on Windows yet
DYNAMIC_GHC_PROGRAMS = NO
+DYNAMIC_TOO=NO
else ifeq "$(TargetOS_CPP)" "freebsd"
# FreeBSD cannot do proper resolution for $ORIGIN (due to a bug in
# rtld(1)), so disable it by default (see #7819).
More information about the ghc-commits
mailing list