summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAustin Seipp <austin@well-typed.com>2014-01-13 02:15:35 -0600
committerAustin Seipp <austin@well-typed.com>2014-01-14 03:46:06 -0600
commit4d5d68a87c282dc4bdac146685b2705de8fdbe3a (patch)
treecfb9935b3e8e8cca5985470fce619729952df475
parentf9892b24c740628a54f5ebdd89e2fd5f72590522 (diff)
downloadhaskell-4d5d68a87c282dc4bdac146685b2705de8fdbe3a.tar.gz
Disable -dynamic-too on Windows
Signed-off-by: Austin Seipp <austin@well-typed.com>
-rw-r--r--compiler/main/DriverPipeline.hs18
-rw-r--r--compiler/main/DynFlags.hs5
-rw-r--r--mk/config.mk.in1
3 files changed, 16 insertions, 8 deletions
diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs
index 3cc176cebf..acd231e88a 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 734e7e910b..1c0a92351b 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 59d48c4ccf..350ea697c7 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).