Skip to content

Commit

Permalink
Update GhcFlags.md
Browse files Browse the repository at this point in the history
  • Loading branch information
adithyaov authored Nov 9, 2023
1 parent 99ff011 commit 1a1d192
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions dev/GhcFlags.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ There are 2 types of GHC flags.
1. Compiler flags
2. RTS flags

The RTS flags can be found in `ghc/rts/RtsFlags.c`.
To add an RTS flag one needs to edit this file and make some followup changes.
The RTS flags are in `ghc/rts/RtsFlags.c`.
To add an RTS flag one needs to edit this file and make some follow-up changes.

The Compiler flags can be foung in `ghc/compiler/main/DynFlags.hs`.
The Compiler flags are in `ghc/compiler/main/DynFlags.hs`.
One needs to edit this file to add a dynamic flag.

## FAQ:
Expand All @@ -18,10 +18,10 @@ A Compiler flag is a flag that the compiler takes. ie. `ghc`. Whereas the RTS
flag is the flag that the executable generated by the compiler takes.


**Q:** The Compiler flags seems to set some C Flags for a few options (for
**Q:** The Compiler flags seem to set some C Flags for a few options (for
example "-DTRACING" when "-eventlog" is enabled, etc.). This is
meta-programming. How does this work? Does a mini compilation happen
everytime everytime we invoke GHC?
everytime we invoke GHC?

We can describe what happens with eventlog which might answer the above
question. WRT eventlog, the compiler has 2 versions of the RTS. One with
Expand All @@ -32,7 +32,7 @@ the RTS with the eventlog enabled when the `-eventlog` flag is enabled.

We need to add 2 types of flags:
1. A Compiler flag to enable perf counter structures.
2. An RTS flag to enable the update the counters.
2. An RTS flag to enable the update of the counters.

This is similar to the eventlog approach.
- `-eventlog` (Compiler flag) to enable the eventlog.
Expand Down

0 comments on commit 1a1d192

Please sign in to comment.