[project @ 2002-09-13 15:02:25 by simonpj]
[ghc-hetmet.git] / ghc / compiler / main / DriverFlags.hs
index 63aa85c..8b1a8da 100644 (file)
@@ -1,5 +1,5 @@
 -----------------------------------------------------------------------------
--- $Id: DriverFlags.hs,v 1.99 2002/07/11 06:52:23 ken Exp $
+-- $Id: DriverFlags.hs,v 1.102 2002/09/13 15:02:34 simonpj Exp $
 --
 -- Driver flags
 --
@@ -27,10 +27,10 @@ import Config
 import Util
 import Panic
 
-import Exception
-import IOExts
-import System          ( exitWith, ExitCode(..) )
+import EXCEPTION
+import DATA_IOREF      ( readIORef, writeIORef )
 
+import System          ( exitWith, ExitCode(..) )
 import IO
 import Maybe
 import Monad
@@ -493,8 +493,13 @@ decodeSize str
 -----------------------------------------------------------------------------
 -- RTS Hooks
 
+#if __GLASGOW_HASKELL__ >= 504
+foreign import ccall unsafe "setHeapSize"       setHeapSize       :: Int -> IO ()
+foreign import ccall unsafe "enableTimingStats" enableTimingStats :: IO ()
+#else
 foreign import "setHeapSize"       unsafe setHeapSize       :: Int -> IO ()
 foreign import "enableTimingStats" unsafe enableTimingStats :: IO ()
+#endif
 
 -----------------------------------------------------------------------------
 -- Build the Hsc static command line opts
@@ -572,6 +577,10 @@ machdepCCOpts
 --                    , if suffixMatch "mingw32" cTARGETPLATFORM then "-mno-cygwin" else "" 
                      ],
                      [ "-fno-defer-pop", "-fomit-frame-pointer",
+                       -- we want -fno-builtin, because when gcc inlines
+                       -- built-in functions like memcpy() it tends to
+                       -- run out of registers, requiring -monly-n-regs
+                       "-fno-builtin",
                        "-DSTOLEN_X86_REGS="++show n_regs ]
                    )