...
 
Commits (2)
......@@ -5,8 +5,8 @@ module GHC (
containers, deepseq, deriveConstants, directory, filepath, genapply,
genprimopcode, ghc, ghcBoot, ghcBootTh, ghcCabal, ghcCompact, ghcHeap, ghci,
ghcPkg, ghcPrim, ghcTags, ghcSplit, haddock, haskeline, hsc2hs, hp2ps, hpc,
hpcBin, integerGmp, integerSimple, iservBin, libffi, mtl, parsec, parallel,
pretty, primitive, process, rts, runGhc, stm, templateHaskell, terminfo,
hpcBin, integerGmp, integerSimple, iserv, libffi, libiserv, mtl, parsec,
parallel, pretty, process, rts, runGhc, stm, templateHaskell, terminfo,
text, time, touchy, transformers, unlit, unix, win32, xhtml, ghcPackages,
isGhcPackage, defaultPackages, testsuitePackages,
......@@ -93,7 +93,8 @@ stage1Packages = do
++ [ haddock | not cross ]
++ [ runGhc | not cross ]
++ [ hpcBin | not cross ]
++ [ iservBin | not win, not cross ]
++ [ iserv | not win, not cross ]
++ [ libiserv | not win, not cross ]
++ [ unix | not win ]
++ [ win32 | win ]
......@@ -114,11 +115,11 @@ programName Context {..} = do
targetPlatform <- setting TargetPlatformFull
let prefix = if cross then targetPlatform ++ "-" else ""
in return $ prefix ++ case package of
p | p == ghc -> "ghc"
| p == hpcBin -> "hpc"
| p == runGhc -> "runhaskell"
| p == iservBin -> "ghc-iserv"
_ -> pkgName package
p | p == ghc -> "ghc"
| p == hpcBin -> "hpc"
| p == runGhc -> "runhaskell"
| p == iserv -> "ghc-iserv"
_ -> pkgName package
-- | The build stage whose results are used when installing a package, or
-- @Nothing@ if the package is not installed, e.g. because it is a user package.
......@@ -154,16 +155,15 @@ nonCabalContext Context {..} = (package `elem` [ hp2ps
-- | Some program packages should not be linked with Haskell main function.
nonHsMainPackage :: Package -> Bool
nonHsMainPackage = (`elem` [ghc, hp2ps, iservBin, touchy, unlit])
nonHsMainPackage = (`elem` [ghc, hp2ps, iserv, touchy, unlit])
-- | Path to the autogen directory generated by @ghc-cabal@ of a given 'Context'.
autogenPath :: Context -> Action FilePath
autogenPath context@Context {..}
| isLibrary package = autogen "build"
| package == ghc = autogen "build/ghc"
| package == hpcBin = autogen "build/hpc"
| package == iservBin = autogen "build/iserv"
| otherwise = autogen $ "build" -/- pkgName package
| isLibrary package = autogen "build"
| package == ghc = autogen "build/ghc"
| package == hpcBin = autogen "build/hpc"
| otherwise = autogen $ "build" -/- pkgName package
where
autogen dir = contextPath context <&> (-/- dir -/- "autogen")
......
......@@ -15,7 +15,7 @@ ghcPackages =
, containers, deepseq, deriveConstants, directory, filepath, genapply
, genprimopcode, ghc, ghcBoot, ghcBootTh, ghcCompact, ghcHeap, ghci, ghcPkg
, ghcPrim, ghcTags, haddock, haskeline, hsc2hs, hp2ps, hpc, hpcBin, integerGmp
, integerSimple, iservBin, libffi, mtl, parsec, parallel, pretty, primitive
, integerSimple, iserv, libffi, libiserv, mtl, parsec, parallel, pretty
, process, rts, runGhc, stm, templateHaskell, terminfo, text, time, touchy
, transformers, unlit, unix, win32, xhtml ]
......@@ -58,8 +58,9 @@ hpc = hsLib "hpc"
hpcBin = hsUtil "hpc-bin" `setPath` "utils/hpc"
integerGmp = hsLib "integer-gmp"
integerSimple = hsLib "integer-simple"
iservBin = hsUtil "iserv-bin" `setPath` "iserv"
iserv = hsUtil "iserv"
libffi = cTop "libffi"
libiserv = hsLib "libiserv"
mtl = hsLib "mtl"
parsec = hsLib "parsec"
parallel = hsLib "parallel"
......
......@@ -115,6 +115,7 @@ rtsPackageArgs = package rts ? do
, arg $ "-DRtsWay=\"rts_" ++ show way ++ "\""
-- Set the namespace for the rts fs functions
, arg $ "-DFS_NAMESPACE=rts"
, arg $ "-DCOMPILING_RTS"
-- RTS *must* be compiled with optimisations. The INLINE_HEADER macro
-- requires that functions are inlined to work as expected. Inlining
-- only happens for optimised builds. Otherwise we can assume that
......@@ -122,8 +123,13 @@ rtsPackageArgs = package rts ? do
-- provide non-inlined alternatives and hence needs the function to
-- be inlined. See https://github.com/snowleopard/hadrian/issues/90.
, arg "-O2"
, arg "-fomit-frame-pointer"
, arg "-g"
, Debug `wayUnit` way ? arg "-DDEBUG"
, Debug `wayUnit` way ? pure [ "-DDEBUG"
, "-fno-omit-frame-pointer"
, "-g"
, "-O0" ]
, way `elem` [debug, debugDynamic] ? arg "-DTICKY_TICKY"
, Profiling `wayUnit` way ? arg "-DPROFILING"
, Threaded `wayUnit` way ? arg "-DTHREADED_RTS"
......@@ -153,8 +159,7 @@ rtsPackageArgs = package rts ? do
, input "//xxhash.c" ? pure
[ "-O3"
, "-ffast-math"
, "-ftree-vectorize"
]
, "-ftree-vectorize" ]
, inputs ["//Evac.c", "//Evac_thr.c"] ? arg "-funroll-loops"
......@@ -175,7 +180,6 @@ rtsPackageArgs = package rts ? do
-- emits warnings about call-clobbered registers on x86_64
, inputs [ "//RetainerProfile.c", "//StgCRun.c"
, "//win32/ConsoleHandler.c", "//win32/ThrIOManager.c"] ? arg "-w"
, inputs ["//RetainerSet.c"] ? arg "-Wno-format"
-- The above warning suppression flags are a temporary kludge.
-- While working on this module you are encouraged to remove it and fix
-- any warnings in the module. See:
......@@ -184,7 +188,6 @@ rtsPackageArgs = package rts ? do
, (not <$> flag GccIsClang) ?
inputs ["//Compact.c"] ? arg "-finline-limit=2500"
, input "//StgCRun.c" ? windowsHost ? arg "-Wno-return-local-addr"
, input "//RetainerProfile.c" ? flag GccIsClang ?
arg "-Wno-incompatible-pointer-types"
, windowsHost ? arg ("-DWINVER=" ++ windowsVersion)
......