Need to pass gcc -m64 on amd64 OSX
[ghc-hetmet.git] / compiler / main / DynFlags.hs
index 47cc3fe..e724f61 100644 (file)
@@ -72,7 +72,7 @@ import PackageConfig
 import PrelNames        ( mAIN, main_RDR_Unqual )
 import RdrName          ( RdrName, mkRdrUnqual )
 import OccName          ( mkVarOccFS )
-#ifdef i386_TARGET_ARCH
+#if defined(i386_TARGET_ARCH) || ! defined(mingw32_TARGET_OS)
 import StaticFlags      ( opt_Static )
 #endif
 import StaticFlags      ( opt_PIC, WayName(..), v_Ways, v_Build_tag,
@@ -1809,6 +1809,8 @@ impliedFlags
                                                      --      be completely rigid for GADTs
 
     , (Opt_TypeFamilies,        Opt_RelaxedPolyRec)  -- Trac #2944 gives a nice example
+    , (Opt_TypeFamilies,        Opt_KindSignatures)  -- Type families use kind signatures
+                                                    -- all over the place
 
     , (Opt_ScopedTypeVariables, Opt_RelaxedPolyRec)  -- Ditto for scoped type variables; see
                                                      --      Note [Scoped tyvars] in TcBinds
@@ -2039,12 +2041,15 @@ setOptLevel n dflags
 --                                      sometimes
 --    -fdicts-cheap                     always inline dictionaries
 --    -fmax-simplifier-iterations20     this is necessary sometimes
+--    -fsimplifier-phases=3             we use an additional simplifier phase
+--                                      for fusion
 --    -fno-spec-constr-threshold        run SpecConstr even for big loops
 --    -fno-spec-constr-count            SpecConstr as much as possible
 --    -finline-enough-args              hack to prevent excessive inlining
 --
 setDPHOpt :: DynFlags -> DynFlags
 setDPHOpt dflags = setOptLevel 2 (dflags { maxSimplIterations  = 20
+                                         , simplPhases         = 3
                                          , specConstrThreshold = Nothing
                                          , specConstrCount     = Nothing
                                          })
@@ -2277,6 +2282,8 @@ machdepCCOpts _dflags
       --     for "normal" programs, but it doesn't support register variable
       --     declarations.
         = ( [], ["-no-cpp-precomp"] )
+#elif x86_64_apple_darwin_TARGET
+        = ( ["-m64"], [] )
 #else
         = ( [], [] )
 #endif
@@ -2303,7 +2310,7 @@ picCCOpts _dflags
     | otherwise
         = []
 #else
-    | opt_PIC
+    | opt_PIC || not opt_Static
         = ["-fPIC", "-U __PIC__", "-D__PIC__"]
     | otherwise
         = []