summaryrefslogtreecommitdiff
path: root/ghc
diff options
context:
space:
mode:
authorAustin Seipp <austin@well-typed.com>2014-02-16 19:10:16 -0600
committerAustin Seipp <austin@well-typed.com>2014-02-17 01:46:04 -0600
commit5023c91780e90947680fe0640f7564a4f6448bea (patch)
tree54cd9afbc9cc7ada073cecf969844862b20394ba /ghc
parentc83eabf37b884398d911609e46707df771c3fde9 (diff)
downloadhaskell-5023c91780e90947680fe0640f7564a4f6448bea.tar.gz
Fix #8754 in a round-about way.
For some reason on OS X, it seems like -Bsymbolic (which we use for hooks into the RTS) isn't working, which results in #8754, where stats don't work because defaultHooks doesn't initialize the stats flag. This seems to work on Linux static/dynamically, but only on OS X statically. After talking with Simon, really, the entire hooks thing is a bit fragile. For now, we just work around it (since GHCi is dynamically linked) by calling into the defaultHooks ourselves when GHC starts. Signed-off-by: Austin Seipp <austin@well-typed.com>
Diffstat (limited to 'ghc')
-rw-r--r--ghc/Main.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/ghc/Main.hs b/ghc/Main.hs
index 868042b4e2..1aa65531a3 100644
--- a/ghc/Main.hs
+++ b/ghc/Main.hs
@@ -1,4 +1,5 @@
{-# OPTIONS -fno-warn-incomplete-patterns -optc-DNON_POSIX_SOURCE #-}
+{-# LANGUAGE ForeignFunctionInterface #-}
-----------------------------------------------------------------------------
--
@@ -76,6 +77,7 @@ import Data.Maybe
main :: IO ()
main = do
+ defaultsHook
hSetBuffering stdout LineBuffering
hSetBuffering stderr LineBuffering
GHC.defaultErrorHandler defaultFatalMessager defaultFlushOut $ do
@@ -818,3 +820,5 @@ unknownFlagsErr fs = throwGhcException $ UsageError $ concatMap oneError fs
(case fuzzyMatch f (nub allFlags) of
[] -> ""
suggs -> "did you mean one of:\n" ++ unlines (map (" " ++) suggs))
+
+foreign import ccall safe "defaultsHook" defaultsHook :: IO ()