diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2018-12-16 08:58:41 +0000 |
---|---|---|
committer | Matthew Pickering <matthewtpickering@gmail.com> | 2019-01-09 14:32:21 +0000 |
commit | 6486c6e49c53e75f37ed732b38c5be7ae64785e8 (patch) | |
tree | 187785dd532474cd34aa4e66846b12f28f09f8b9 /hadrian/doc | |
parent | 6b70cf611e5ddc475edaa54b893d20990699ddb8 (diff) | |
download | haskell-6486c6e49c53e75f37ed732b38c5be7ae64785e8.tar.gz |
Hadrian: Add support for building stage3
This ticket enables the building of a `stage3` compiler by making the
build logic more consistent and predictable in Hadrian.
Two of the main changes are:
1. In order to build anything at stageN we use the package database
present at stageN. Fixing #16069
2. `haddock` and `ghc-tags` are built
as stage1 executables (with the stage1 compiler) rather than as
stage2 compiler. Fixing
[hadrian#661](https://github.com/snowleopard/hadrian/issues/661)
In order to build a stage3 compiler, you have to set the new `finalStage` hadrian option to `Stage3`.
Diffstat (limited to 'hadrian/doc')
-rw-r--r-- | hadrian/doc/cross-compile.md | 1 | ||||
-rw-r--r-- | hadrian/doc/user-settings.md | 20 |
2 files changed, 16 insertions, 5 deletions
diff --git a/hadrian/doc/cross-compile.md b/hadrian/doc/cross-compile.md index 724d0e17bd..6bd4fe8ef8 100644 --- a/hadrian/doc/cross-compile.md +++ b/hadrian/doc/cross-compile.md @@ -16,7 +16,6 @@ After all the dependencies are in place: - `git submodule update --init` - `./configure --target=arm-linux-gnueabihf` - `cd hadrian` -- Modify `src/UserSettings.hs`, set `stage1Only` to `True`. - Build the compiler by e.g. `./build.sh --flavour=quickest --integer-simple -V -j` After that, you should have built `inplace/bin/ghc-stage1` cross compiler. We will go to the next section to validate this. diff --git a/hadrian/doc/user-settings.md b/hadrian/doc/user-settings.md index 0c6d4ba3cd..6c6aab7a9f 100644 --- a/hadrian/doc/user-settings.md +++ b/hadrian/doc/user-settings.md @@ -138,6 +138,22 @@ You can choose which integer library to use when builing GHC using the userFlavour :: Flavour userFlavour = defaultFlavour { name = "user", integerLibrary = integerSimple } ``` + +### Specifying the final stage to build + +The `finalStage` variable can be set to indicate after which stage we should +stop the compilation pipeline. By default it is set to `Stage2` which indicates +that we will build everything which uses the `Stage1` `ghc` and then stop. + +``` +finalStage :: Stage +finalStage = Stage2 +``` + +Using this mechanism we can also build a `Stage3` compiler by setting +`finalStage = Stage3` or just a `Stage1` compiler by setting +`finalStage = Stage1`. + ## Build ways Packages can be built in a number of ways, such as `vanilla`, `profiling` (with @@ -202,10 +218,6 @@ verboseCommand = return True ## Miscellaneous -By setting `stage1Only = True` you can disable building Stage2 GHC and Stage2 -utilities such as `haddock`. Note that all Stage0 and Stage1 libraries will -still be built. - To change the default behaviour of Hadrian with respect to building split objects, override the `splitObjects` setting of the `Flavour` record: ```haskell |