| 23 | | Note that this builds a profiled ''stage-2'' compiler. In principle it's possible to build a profiled ''stage-1'' compiler, but the build system isn't set up to do that right now. Notably, various libraries (eg Cabal) are built and installed by the bootstrap compiler before building GHC; these would need to be built and installed in a profiled way too. |
| | 23 | Note that this builds a profiled ''stage-2'' compiler. In principle it's possible to build a profiled ''stage-1'' compiler, but the build system isn't set up to do that right now. Notably, various libraries (eg Cabal) are built and installed by the bootstrap compiler before building GHC; these would need to be built and installed in a profiled way too. Additionally, the built compiler will manifest any profiling bugs that were in your bootstrapping compiler. |
| | 24 | |
| | 25 | If you want to profile GHC while compiling GHC, the easiest way to do this is to build a ''stage-3'' compiler with your profiled ''stage-2'' compiler. You’ll need to run `make stage=3` the first time you do this in order to build the dependencies for the stage3 compiler; see [wiki:Building/Using#RebuildingtheGHCbinaryaftermakingchanges] and below for more details. |