-- language opts
opt_DictsStrict,
- opt_MaxContextReductionDepth,
opt_IrrefutableTuples,
opt_Parallel,
opt_RuntimeTypes,
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
-- 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")
"fsemi-tagging",
"flet-no-escape",
"femit-extern-decls",
- "fglobalise-toplev-names",
"fgransim",
"fno-hi-version-check",
"dno-black-holing",
"fPIC"
]
|| any (flip prefixMatch f) [
- "fcontext-stack",
"fliberate-case-threshold",
"fmax-worker-args",
"fhistory-size",
_ `allowedWith` WayDebug = True
WayDebug `allowedWith` _ = True
- WayThreaded `allowedWith` WayProf = True
WayProf `allowedWith` WayUnreg = True
WayProf `allowedWith` WayNDP = True
_ `allowedWith` _ = False
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: " ++
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
] ),