From c953c649da38f78249fe67986d55784a020a1965 Mon Sep 17 00:00:00 2001 From: Mateusz Kowalczyk Date: Wed, 4 Sep 2013 21:21:40 +0100 Subject: Fixes #256 We inject -dynamic-too into flags before we run all our actions in the GHC monad. --- src/Haddock.hs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3