x86_64: add -fno-builtin to gcc command line for .hc files.
[ghc-hetmet.git] / ghc / compiler / main / DynFlags.hs
index 82d3c37..8f6ac1f 100644 (file)
@@ -41,6 +41,7 @@ module DynFlags (
        
        -- parsing DynFlags
        parseDynamicFlags,
+        allFlags,
 
        -- misc stuff
        machdepCCOpts, picCCOpts,
@@ -764,6 +765,15 @@ getStgToDo dflags
 -- -----------------------------------------------------------------------------
 -- DynFlags parser
 
+allFlags :: [String]
+allFlags = map ('-':) $
+           [ name | (name, optkind) <- dynamic_flags, ok optkind ] ++
+           map ("fno-"++) flags ++
+           map ("f"++) flags
+    where ok (PrefixPred _ _) = False
+          ok _ = True
+          flags = map fst fFlags
+
 dynamic_flags :: [(String, OptKind DynP)]
 dynamic_flags = [
      ( "n"              , NoArg  (setDynFlag Opt_DryRun) )
@@ -1256,11 +1266,15 @@ machdepCCOpts dflags
                        -- and get in the way of -split-objs.  Another option
                        -- would be to throw them away in the mangler, but this
                        -- is easier.
-                "-fno-unit-at-a-time"
+                "-fno-unit-at-a-time",
                        -- unit-at-a-time doesn't do us any good, and screws
                        -- up -split-objs by moving the split markers around.
                        -- It's only turned on with -O2, but put it here just
                        -- in case someone uses -optc-O2.
+                "-fno-builtin"
+                       -- calling builtins like strlen() using the FFI can
+                       -- cause gcc to run out of regs, so use the external
+                       -- version.
                ] )
 
 #elif mips_TARGET_ARCH