diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2021-09-14 11:19:12 +0100 |
---|---|---|
committer | Matthew Pickering <matthewtpickering@gmail.com> | 2021-09-14 11:21:12 +0100 |
commit | ae511b7376ded5836a728e69e35bf120fd5d08c3 (patch) | |
tree | e058d3cd54718ba6b9d6be9c7eb09907fef6ba71 | |
parent | 2d15175266d0e0d9ca6565124b0c17e207b5541c (diff) | |
download | haskell-ae511b7376ded5836a728e69e35bf120fd5d08c3.tar.gz |
Add "ipe" flavour transformer to add support for building with IPE debug infowip/ipe-trans
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 {- |