-----------------------------------------------------------------------------
--- $Id: DriverFlags.hs,v 1.98 2002/07/03 15:15:24 sof Exp $
+-- $Id: DriverFlags.hs,v 1.104 2002/10/13 10:55:06 wolfgang Exp $
--
-- Driver flags
--
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
, ( "dshow-passes", NoArg (setVerbosity "2") )
, ( "ddump-rn-trace", NoArg (setDynFlag Opt_D_dump_rn_trace) )
, ( "ddump-tc-trace", NoArg (setDynFlag Opt_D_dump_tc_trace) )
+ , ( "ddump-splices", NoArg (setDynFlag Opt_D_dump_splices) )
, ( "ddump-rn-stats", NoArg (setDynFlag Opt_D_dump_rn_stats) )
, ( "ddump-stix", NoArg (setDynFlag Opt_D_dump_stix) )
, ( "ddump-simpl-stats", NoArg (setDynFlag Opt_D_dump_simpl_stats) )
-----------------------------------------------------------------------------
-- 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
machdepCCOpts
| prefixMatch "alpha" cTARGETPLATFORM
- = return ( ["-static", "-w", "-mieee"], [] )
+ = return ( ["-static", "-w", "-mieee"
+#ifdef HAVE_THREADED_RTS_SUPPORT
+ , "-D_REENTRANT"
+#endif
+ ], [] )
-- For now, to suppress the gcc warning "call-clobbered
-- register used for global register variable", we simply
-- disable all warnings altogether using the -w flag. Oh well.
-- , 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 ]
)
-- disable all warnings altogether using the -w flag. Oh well.
| prefixMatch "powerpc-apple-darwin" cTARGETPLATFORM
- = return ( ["-no-cpp-precomp"], [""] )
+ -- -no-cpp-precomp:
+ -- Disable Apple's precompiling preprocessor. It's a great thing
+ -- for "normal" programs, but it doesn't support register variable
+ -- declarations.
+ -- -mdynamic-no-pic:
+ -- As we don't support haskell code in shared libraries anyway,
+ -- we might as well turn of PIC code generation and save space and time.
+ -- This is completely optional.
+ = return ( ["-no-cpp-precomp","-mdynamic-no-pic"], [] )
| prefixMatch "powerpc" cTARGETPLATFORM || prefixMatch "rs6000" cTARGETPLATFORM
= return ( ["-static"], ["-finhibit-size-directive"] )