aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Haddock.hs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/Haddock.hs b/src/Haddock.hs
index 5f5b1156..1deb6408 100644
--- a/src/Haddock.hs
+++ b/src/Haddock.hs
@@ -136,7 +136,14 @@ haddock args = handleTopExceptions $ do
shortcutFlags flags
qual <- case qualification flags of {Left msg -> throwE msg; Right q -> return q}
- withGhc' flags $ do
+ -- inject dynamic-too into flags before we proceed
+ flags' <- withGhc' flags $ do
+ df <- getDynFlags
+ case lookup "GHC Dynamic" (compilerInfo df) of
+ Just "YES" -> return $ Flag_OptGhc "-dynamic-too" : flags
+ _ -> return flags
+
+ withGhc' flags' $ do
dflags <- getDynFlags