Skip to content
This repository has been archived by the owner on Aug 2, 2020. It is now read-only.

Commit

Permalink
Update RTS flags (#613)
Browse files Browse the repository at this point in the history
* Update RTS flags

See #611

* More tweaks
  • Loading branch information
snowleopard authored Jun 12, 2018
1 parent 8dba674 commit a63ad32
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/Settings/Packages/Rts.hs
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,21 @@ 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
-- there is a non-inlined variant to use instead. But RTS does not
-- 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"
Expand Down Expand Up @@ -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"

Expand All @@ -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:
Expand All @@ -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)
Expand Down

0 comments on commit a63ad32

Please sign in to comment.