A way
Don't change the constructor order as it is used by waysTag to create a unique tag (e.g. thr_debug_p) which is expected by other tools (e.g. Cabal).
:: a typeCtrl KGHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27
Moduleghc-9.10.3GHC2021
Ways
The central concept of a "way" is that all objects in a given program must be compiled in the same "way". Certain options change parameters of the virtual machine, eg. profiling adds an extra word to the object header, so profiling objects cannot be linked with non-profiling objects.
After parsing the command-line options, we determine which "way" we are building - this might be a combination way, eg. profiling+threaded.
There are two kinds of ways: - RTS only: only affect the runtime system (RTS) and don't affect code generation (e.g. threaded, debug) - Full ways: affect code generation and the RTS (e.g. profiling, dynamic linking)
We then find the "build-tag" associated with this way, and this becomes the suffix used to find .hi files and libraries used in this compilation.
A way
Don't change the constructor order as it is used by waysTag to create a unique tag (e.g. thr_debug_p) which is expected by other tools (e.g. Cabal).
Test if a way is enabled
Test if a way is not enabled
Add a way
Remove a way
Check if a combination of ways is allowed
Turn these flags on when enabling this way
Turn these flags off when enabling this way
Pass these options to the C compiler when enabling this way
Pass these options to linker when enabling this way
Pass these options to the preprocessor when enabling this way
Return true for ways that only impact the RTS, not the generated code
Unique build-tag associated to a way
Unique tag associated to a list of ways
Unique build-tag associated to a list of ways
RTS only ways are filtered out because they have no impact on the build.
Filter ways that have an impact on compilation
Filter RTS-only ways (ways that don't have an impact on compilation)
Host ways.
Host "full" ways (i.e. ways that have an impact on the compilation, not RTS only ways).
These ways must be used when compiling codes targeting the internal interpreter.
Consult the RTS to find whether it has been built with profiling enabled.
Consult the RTS to find whether GHC itself has been built with dynamic linking. This can't be statically known at compile-time, because we build both the static and dynamic versions together with -dynamic-too.
Consult the RTS to find whether it is threaded.
Consult the RTS to find whether it is debugged.
Consult the RTS to find whether it is tracing.