X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fmain%2FDynFlags.hs;h=3c117c4f4ce37cc04486ff68608664c76484aede;hb=c9bb6b63aa1f479a3dd3679c7e4c2c69471a4912;hp=6cde987c11fd1f5d816858307d221bd0cd50bb09;hpb=2ee130cd71d175dfad4120e8ddf2db0588043696;p=ghc-hetmet.git diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 6cde987..3c117c4 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -256,6 +256,7 @@ data DynFlag | Opt_ExplicitForAll | Opt_AlternativeLayoutRule | Opt_AlternativeLayoutRuleTransitional + | Opt_DatatypeContexts | Opt_PrintExplicitForalls @@ -423,7 +424,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 @@ -440,7 +440,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 @@ -667,7 +666,6 @@ defaultDynFlags = opt_m = [], opt_l = [], opt_windres = [], - opt_la = [], opt_lo = [], opt_lc = [], @@ -696,7 +694,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 @@ -720,6 +717,7 @@ defaultDynFlags = Opt_ImplicitPrelude, Opt_MonomorphismRestriction, Opt_NPlusKPatterns, + Opt_DatatypeContexts, Opt_MethodSharing, @@ -787,9 +785,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 @@ -833,7 +831,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,[])} @@ -845,7 +842,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} @@ -1043,7 +1039,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 @@ -1059,7 +1054,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 @@ -1654,6 +1648,8 @@ xFlags = [ ( "ExplicitForAll", Opt_ExplicitForAll, const Supported ), ( "AlternativeLayoutRule", Opt_AlternativeLayoutRule, const Supported ), ( "AlternativeLayoutRuleTransitional",Opt_AlternativeLayoutRuleTransitional, const Supported ), + -- On by default: + ( "DatatypeContexts", Opt_DatatypeContexts, const Supported ), ( "MonoLocalBinds", Opt_MonoLocalBinds, const Supported ), ( "RelaxedPolyRec", Opt_RelaxedPolyRec, const Supported ), ( "ExtendedDefaultRules", Opt_ExtendedDefaultRules, const Supported ), @@ -2205,7 +2201,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 = []