-----------------------------------------------------------------------------
--- $Id: DriverFlags.hs,v 1.97 2002/06/12 22:04:26 wolfgang Exp $
+-- $Id: DriverFlags.hs,v 1.101 2002/08/29 15:44:15 simonmar 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
, ( "fvia-c", NoArg (setLang HscC) )
, ( "fvia-C", NoArg (setLang HscC) )
, ( "filx", NoArg (setLang HscILX) )
- , ( "fcore", NoArg (setLang HscCore) )
-- "active negatives"
, ( "fno-implicit-prelude", NoArg (setDynFlag Opt_NoImplicitPrelude) )
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.
-- the fp (%ebp) for our register maps.
= do n_regs <- dynFlag stolen_x86_regs
sta <- readIORef v_Static
- return ( [ if sta then "-DDONT_WANT_WIN32_DLL_SUPPORT" else "",
- if suffixMatch "mingw32" cTARGETPLATFORM then "-mno-cygwin" else "" ],
+ return ( [ if sta then "-DDONT_WANT_WIN32_DLL_SUPPORT" else ""
+-- , 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 ]
)