Skip to content

Updating the Bootstrap Compiler

PÁLI Gábor János edited this page Mar 25, 2014 · 10 revisions

GHC needs a working GHC in order to be built. This is currently solved by having a pre-built binary distribution of GHC prepared that is first installed and then used to build the sources.

  • GHC has some requirement on the version of the bootstrap compiler, something like version N.M can be only built with a compiler of version N.(M - 2) at least. For example, building the GHC 7.6.x ports requires a GHC 7.4.x bootstrap compiler at minimum. Usually it is fine to have the same version as the port itself, but since rolling a new version of the bootstrap out takes time and space, it is a good idea to change it only when it is really required.

  • The version of the bootstrap compiler is controlled by the BOOT_GHC_VERSION variable in the Makefile of lang/ghc. This should be always in sync with the bootstraps available in the distinfo file.

  • Optionally, the user may use the existing GHC by choosing the BOOT option at configure. Note that this is only available if ${LOCALBASE}/bin/ghc exists.

  • The bootstrap compiler is a lite version of the original compiler, without documentation and with the less (base system and port) dependencies as possible. However, those dependencies may change inevitably. In this case, the bootstrap for the affected versions and architectures must be rebuilt and lang/ghc must be updated.

  • The bootstraps shall be available for all supported operating system versions and architectures. As of the time of writing, this is 8.x (8.4), 9.x (9.1), 10.x (10.0), and head, for i386 (32-bit) and amd64 (64-bit). This means one shall maintain the bootstraps separately for every possible combination.