Remove LlvmAs phase as the llvm opt tool now handles this phase
[ghc-hetmet.git] / compiler / main / DynFlags.hs
index 0083ca3..f420f21 100644 (file)
@@ -164,6 +164,7 @@ data DynFlag
    | Opt_WarnIncompletePatterns
    | Opt_WarnIncompletePatternsRecUpd
    | Opt_WarnMissingFields
+   | Opt_WarnMissingImportList
    | Opt_WarnMissingMethods
    | Opt_WarnMissingSigs
    | Opt_WarnNameShadowing
@@ -422,7 +423,6 @@ data DynFlags = DynFlags {
   opt_a                 :: [String],
   opt_l                 :: [String],
   opt_windres           :: [String],
-  opt_la                :: [String], -- LLVM: llvm-as assembler
   opt_lo                :: [String], -- LLVM: llvm optimiser
   opt_lc                :: [String], -- LLVM: llc static compiler
 
@@ -439,7 +439,6 @@ data DynFlags = DynFlags {
   pgm_T                 :: String,
   pgm_sysman            :: String,
   pgm_windres           :: String,
-  pgm_la                :: (String,[Option]), -- LLVM: llvm-as assembler
   pgm_lo                :: (String,[Option]), -- LLVM: opt llvm optimiser
   pgm_lc                :: (String,[Option]), -- LLVM: llc static compiler
 
@@ -666,7 +665,6 @@ defaultDynFlags =
         opt_m                   = [],
         opt_l                   = [],
         opt_windres             = [],
-        opt_la                  = [],
         opt_lo                  = [],
         opt_lc                  = [],
 
@@ -695,7 +693,6 @@ defaultDynFlags =
         pgm_T                   = panic "defaultDynFlags: No pgm_T",
         pgm_sysman              = panic "defaultDynFlags: No pgm_sysman",
         pgm_windres             = panic "defaultDynFlags: No pgm_windres",
-        pgm_la                  = panic "defaultDynFlags: No pgm_la",
         pgm_lo                  = panic "defaultDynFlags: No pgm_lo",
         pgm_lc                  = panic "defaultDynFlags: No pgm_lc",
         -- end of initSysTools values
@@ -786,9 +783,9 @@ getVerbFlag dflags
 setObjectDir, setHiDir, setStubDir, setOutputDir, setDylibInstallName,
          setObjectSuf, setHiSuf, setHcSuf, parseDynLibLoaderMode,
          setPgmP, setPgmL, setPgmF, setPgmc, setPgmm, setPgms, setPgma, setPgml, setPgmdll, setPgmwindres,
-         setPgmla, setPgmlo, setPgmlc,
-         addOptL, addOptP, addOptF, addOptc, addOptm, addOpta, addOptl, addOptwindres, addOptla, addOptlo,
-         addOptlc, addCmdlineFramework, addHaddockOpts
+         setPgmlo, setPgmlc,
+         addOptL, addOptP, addOptF, addOptc, addOptm, addOpta, addOptl, addOptwindres, addOptlo, addOptlc,
+         addCmdlineFramework, addHaddockOpts
    :: String -> DynFlags -> DynFlags
 setOutputFile, setOutputHi, setDumpPrefixForce
    :: Maybe String -> DynFlags -> DynFlags
@@ -832,7 +829,6 @@ setPgma   f d = d{ pgm_a   = (f,[])}
 setPgml   f d = d{ pgm_l   = (f,[])}
 setPgmdll f d = d{ pgm_dll = (f,[])}
 setPgmwindres f d = d{ pgm_windres = f}
-setPgmla  f d = d{ pgm_la  = (f,[])}
 setPgmlo  f d = d{ pgm_lo  = (f,[])}
 setPgmlc  f d = d{ pgm_lc  = (f,[])}
 
@@ -844,7 +840,6 @@ addOptm   f d = d{ opt_m   = f : opt_m d}
 addOpta   f d = d{ opt_a   = f : opt_a d}
 addOptl   f d = d{ opt_l   = f : opt_l d}
 addOptwindres f d = d{ opt_windres = f : opt_windres d}
-addOptla  f d = d{ opt_la  = f : opt_la d}
 addOptlo  f d = d{ opt_lo  = f : opt_lo d}
 addOptlc  f d = d{ opt_lc  = f : opt_lc d}
 
@@ -1042,7 +1037,6 @@ dynamic_flags = [
 
         ------- Specific phases  --------------------------------------------
     -- need to appear before -pgmL to be parsed as LLVM flags.
-  , Flag "pgmla"         (HasArg (upd . setPgmla)) Supported
   , Flag "pgmlo"         (HasArg (upd . setPgmlo)) Supported
   , Flag "pgmlc"         (HasArg (upd . setPgmlc)) Supported
 
@@ -1058,7 +1052,6 @@ dynamic_flags = [
   , Flag "pgmwindres"     (HasArg (upd . setPgmwindres)) Supported
 
     -- need to appear before -optl/-opta to be parsed as LLVM flags.
-  , Flag "optla"          (HasArg (upd . addOptla)) Supported
   , Flag "optlo"          (HasArg (upd . addOptlo)) Supported
   , Flag "optlc"          (HasArg (upd . addOptlc)) Supported
 
@@ -1493,6 +1486,7 @@ fFlags = [
   ( "warn-incomplete-patterns",         Opt_WarnIncompletePatterns, const Supported ),
   ( "warn-incomplete-record-updates",   Opt_WarnIncompletePatternsRecUpd, const Supported ),
   ( "warn-missing-fields",              Opt_WarnMissingFields, const Supported ),
+  ( "warn-missing-import-lists",        Opt_WarnMissingImportList, const Supported ),
   ( "warn-missing-methods",             Opt_WarnMissingMethods, const Supported ),
   ( "warn-missing-signatures",          Opt_WarnMissingSigs, const Supported ),
   ( "warn-name-shadowing",              Opt_WarnNameShadowing, const Supported ),
@@ -2203,7 +2197,12 @@ picCCOpts _dflags
     | otherwise
         = []
 #else
-    | opt_PIC
+      -- we need -fPIC for C files when we are compiling with -dynamic,
+      -- otherwise things like stub.c files don't get compiled
+      -- correctly.  They need to reference data in the Haskell
+      -- objects, but can't without -fPIC.  See
+      -- http://hackage.haskell.org/trac/ghc/wiki/Commentary/PositionIndependentCode
+    | opt_PIC || not opt_Static
         = ["-fPIC", "-U __PIC__", "-D__PIC__"]
     | otherwise
         = []