X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fmain%2FStaticFlags.hs;h=9e1d8ad7a8df11c7aa2bdd7e63212187efff47bb;hb=95731e19939a07410877371bac8fcb5a259c17eb;hp=3067063f7bfcdde1be566f7f2841edd674bc684d;hpb=0065d5ab628975892cea1ec7303f968c3338cbe1;p=ghc-hetmet.git diff --git a/compiler/main/StaticFlags.hs b/compiler/main/StaticFlags.hs index 3067063..9e1d8ad 100644 --- a/compiler/main/StaticFlags.hs +++ b/compiler/main/StaticFlags.hs @@ -29,7 +29,6 @@ module StaticFlags ( -- language opts opt_DictsStrict, - opt_MaxContextReductionDepth, opt_IrrefutableTuples, opt_Parallel, opt_RuntimeTypes, @@ -56,7 +55,6 @@ module StaticFlags ( -- misc opts opt_IgnoreDotGhci, opt_ErrorSpans, - opt_EmitCExternDecls, opt_GranMacros, opt_HiVersion, opt_HistorySize, @@ -70,7 +68,6 @@ module StaticFlags ( #include "HsVersions.h" -import Util ( consIORef ) import CmdLineParser import Config ( cProjectVersionInt, cProjectPatchLevel, cGhcUnregisterised ) @@ -78,14 +75,13 @@ import FastString ( FastString, mkFastString ) import Util import Maybes ( firstJust ) import Panic ( GhcException(..), ghcError ) -import Constants ( mAX_CONTEXT_REDUCTION_DEPTH ) import EXCEPTION ( throwDyn ) import DATA_IOREF import UNSAFE_IO ( unsafePerformIO ) import Monad ( when ) import Char ( isDigit ) -import List ( sort, intersperse ) +import Data.List ( sort, intersperse, nub ) ----------------------------------------------------------------------------- -- Static flags @@ -253,7 +249,6 @@ opt_DoTickyProfiling = lookUp FSLIT("-fticky-ticky") -- language opts opt_DictsStrict = lookUp FSLIT("-fdicts-strict") opt_IrrefutableTuples = lookUp FSLIT("-firrefutable-tuples") -opt_MaxContextReductionDepth = lookup_def_int "-fcontext-stack" mAX_CONTEXT_REDUCTION_DEPTH opt_Parallel = lookUp FSLIT("-fparallel") opt_Flatten = lookUp FSLIT("-fflatten") @@ -266,7 +261,6 @@ opt_RulesOff = lookUp FSLIT("-frules-off") opt_LiberateCaseThreshold = lookup_def_int "-fliberate-case-threshold" (10::Int) opt_MaxWorkerArgs = lookup_def_int "-fmax-worker-args" (10::Int) -opt_EmitCExternDecls = lookUp FSLIT("-femit-extern-decls") opt_GranMacros = lookUp FSLIT("-fgransim") opt_HiVersion = read (cProjectVersionInt ++ cProjectPatchLevel) :: Int opt_HistorySize = lookup_def_int "-fhistory-size" 20 @@ -309,15 +303,10 @@ isStaticFlag f = "fauto-sccs-on-individual-cafs", "fscc-profiling", "fticky-ticky", - "fall-strict", "fdicts-strict", "firrefutable-tuples", "fparallel", "fflatten", - "fsemi-tagging", - "flet-no-escape", - "femit-extern-decls", - "fglobalise-toplev-names", "fgransim", "fno-hi-version-check", "dno-black-holing", @@ -330,14 +319,12 @@ isStaticFlag f = "static", "funregisterised", "fext-core", - "frule-check", "frules-off", "fcpr-off", "ferror-spans", "fPIC" ] || any (flip prefixMatch f) [ - "fcontext-stack", "fliberate-case-threshold", "fmax-worker-args", "fhistory-size", @@ -449,7 +436,6 @@ allowed_combination way = and [ x `allowedWith` y _ `allowedWith` WayDebug = True WayDebug `allowedWith` _ = True - WayThreaded `allowedWith` WayProf = True WayProf `allowedWith` WayUnreg = True WayProf `allowedWith` WayNDP = True _ `allowedWith` _ = False @@ -458,7 +444,7 @@ allowed_combination way = and [ x `allowedWith` y findBuildTag :: IO [String] -- new options findBuildTag = do way_names <- readIORef v_Ways - let ws = sort way_names + let ws = sort (nub way_names) if not (allowed_combination ws) then throwDyn (CmdLineError $ "combination not supported: " ++ @@ -492,8 +478,15 @@ way_details :: [ (WayName, Way) ] way_details = [ (WayThreaded, Way "thr" True "Threaded" [ #if defined(freebsd_TARGET_OS) - "-optc-pthread" - , "-optl-pthread" +-- "-optc-pthread" +-- , "-optl-pthread" + -- FreeBSD's default threading library is the KSE-based M:N libpthread, + -- which GHC has some problems with. It's currently not clear whether + -- the problems are our fault or theirs, but it seems that using the + -- alternative 1:1 threading library libthr works around it: + "-optl-lthr" +#elif defined(solaris2_TARGET_OS) + "-optl-lrt" #endif ] ),