Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,262
    • Issues 4,262
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 394
    • Merge Requests 394
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Wiki
    • Commentary
    • Rts
  • config

Last edited by Takenobu Tani Apr 20, 2019
Page history New page

config

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:

  • PROFILING

    • Enables profiling.
    • GHC option: -prof
    • RTS suffix: p
  • THREADED_RTS

    • Enables multithreading in the RTS, bound threads, and SMP execution.
    • GHC option: -threaded
    • RTS suffix: thr
  • DEBUG

    • Enables extra debugging code, assertions, traces, and the +RTS -D options.
    • GHC option: -debug
    • RTS suffix: debug
  • TRACING

    • 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.

Combinations

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

Other configuration options

  • NO_REGS

    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.

  • USE_MINIINTERPRETER

    Enables the use of the RTS "mini-interpreter", which simulates tail-calls. Again, this is enabled by GhcUnregisterised in the build system.

  • TABLES_NEXT_TO_CODE

    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.

Clone repository

GHC Home
GHC User's Guide

Joining In

Newcomers info
Mailing Lists & IRC
The GHC Team

Documentation

GHC Status Info
Working conventions
Building Guide
Debugging
Commentary

Wiki

Title Index
Recent Changes