RTS Configurations

The RTS can be built in several different ways, corresponding to global CPP defines. The flavour of the RTS is chosen by GHC when compiling a Haskell program, in response to certain command-line options: -prof, -threaded, etc.

The CPP symbols and their corresponding command-line flags are:

Enables profiling.
GHC option: -prof
RTS suffix: p
Enables multithreading in the RTS, bound threads, and SMP execution.
GHC option: -threaded
RTS suffix: thr
Enables extra debugging code, assertions, traces, and the +RTS -D options.
GHC option: -debug
RTS suffix: debug
Enables RTS tracing and event logging, see rts/Trace.c. Implied by DEBUG.
GHC option: -eventlog
RTS suffix: l

So for example, libHSrts_thr_debug.a is the version of the runtime compiled with THREADED_RTS and DEBUG, and will be linked in if you use the -threaded and -debug options to GHC.

The ways that the RTS is built in are controlled by the GhcRTSWays Makefile variable.


All combinations are allowed. Only some are built by default though; see mk/ to see how the GhcRTSWays variable is set.

Other configuration options

Disabled the use of hardware registers for the stack pointer (Sp), heap pointer (Hp), etc. This is enabled when building "unregisterised" code, which is controlled by the GhcUnregisterised build option. Typically this is necessary when building GHC on a platform for which there is no native code generator and LLVM does not have a GHC calling convention.
Enables the use of the RTS "mini-interpreter", which simulates tail-calls. Again, this is enabled by GhcUnregisterised in the build system.
Controls whether the info table is placed directly before the entry code for a closure or return continuation. This is normally turned on if the platform supports it, but is turned off by GhcUnregisterised.
Last modified 7 years ago Last modified on Dec 12, 2012 8:43:40 AM