diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2021-09-14 11:19:12 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-09-17 09:43:40 -0400 |
commit | 15a5b7a5da610bcd85c825ce0b7b7b5a422dc2ae (patch) | |
tree | e0ff6530cd78d0b874172fcde39a9ea43b2e86fa | |
parent | 18283be3db288d21b79de7d65756a3442371c27f (diff) | |
download | haskell-15a5b7a5da610bcd85c825ce0b7b7b5a422dc2ae.tar.gz |
Add "ipe" flavour transformer to add support for building with IPE debug info
The "ipe" transformer compilers everything in stage2 with
`-finfo-table-map` and `-fdistinct-constructor-tables` to produce a
compiler which is usable with `-hi` profiling and ghc-debug.
-rw-r--r-- | hadrian/doc/flavours.md | 9 | ||||
-rw-r--r-- | hadrian/src/Flavour.hs | 9 |
2 files changed, 18 insertions, 0 deletions
diff --git a/hadrian/doc/flavours.md b/hadrian/doc/flavours.md index 806fe8ab81..d88122ea3f 100644 --- a/hadrian/doc/flavours.md +++ b/hadrian/doc/flavours.md @@ -220,6 +220,15 @@ The supported transformers are listed below: <td><code>no_profiled_libs</code></td> <td>Disables building of libraries in profiled build ways.</td> </tr> + <tr> + <td><code>omit_pragmas</code></td> + <td>Build the stage2 compiler with -fomit-interface-pragmas to reduce + recompilation.</td> + </tr> + <tr> + <td><code>ipe</code></td> + <td>Build the stage2 libraries with IPE debugging information for use with -hi profiling.</td> + </tr> </table> ## Ways diff --git a/hadrian/src/Flavour.hs b/hadrian/src/Flavour.hs index bacc6b3ed2..3a23fd878f 100644 --- a/hadrian/src/Flavour.hs +++ b/hadrian/src/Flavour.hs @@ -44,6 +44,7 @@ flavourTransformers = M.fromList , "no_dynamic_ghc" =: disableDynamicGhcPrograms , "no_profiled_libs" =: disableProfiledLibs , "omit_pragmas" =: omitPragmas + , "ipe" =: enableIPE ] where (=:) = (,) @@ -190,6 +191,14 @@ omitPragmas = Right transformer = applySetting kv in transformer +-- | Build stage2 dependencies with options to enable IPE debugging +-- information. +enableIPE :: Flavour -> Flavour +enableIPE = + let Right kv = parseKV "stage1.*.ghc.hs.opts += -finfo-table-map -fdistinct-constructor-tables" + Right transformer = applySetting kv + in transformer + -- * CLI and <root>/hadrian.settings options {- |