ghc-toolchain: Toolchain Selection
This commit integrates ghc-toolchain, the brand new way of configuring toolchains for GHC, with the Hadrian build system, with configure, and extends and improves the first iteration of ghc-toolchain. The general overview is * We introduce a program invoked `ghc-toolchain --triple=...` which, when run, produces a file with a `Target`. A `GHC.Toolchain.Target.Target` describes the properties of a target and the toolchain (executables and configured flags) to produce code for that target * Hadrian was modified to read Target files, and will both * Invoke the toolchain configured in the Target file as needed * Produce a `settings` file for GHC based on the Target file for that stage * `./configure` will invoke ghc-toolchain to generate target files, but it will also generate target files based on the flags configure itself configured (through `.in` files that are substituted) * By default, the Targets generated by configure are still (for now) the ones used by Hadrian * But we additionally validate the Target files generated by ghc-toolchain against the ones generated by configure, to get a head start on catching configuration bugs before we transition completely. * When we make that transition, we will want to drop a lot of the toolchain configuration logic from configure, but keep it otherwise. * For each compiler stage we should have 1 target file (up to a stage compiler we can't run in our machine) * We just have a HOST target file, which we use as the target for stage0 * And a TARGET target file, which we use for stage1 (and later stages, if not cross compiling) * Note there is no BUILD target file, because we only support cross compilation where BUILD=HOST * (for more details on cross-compilation see discussion on !9263) See also * Note [How we configure the bundled windows toolchain] * Note [ghc-toolchain consistency checking] * Note [ghc-toolchain overview] Ticket: #19877 MR: !9263
Showing
- compiler/GHC/Linker/Static.hs 1 addition, 0 deletionscompiler/GHC/Linker/Static.hs
- compiler/GHC/Platform.hs 0 additions, 33 deletionscompiler/GHC/Platform.hs
- configure.ac 21 additions, 0 deletionsconfigure.ac
- distrib/configure.ac.in 10 additions, 0 deletionsdistrib/configure.ac.in
- hadrian/.gitignore 4 additions, 0 deletionshadrian/.gitignore
- hadrian/bindist/Makefile 3 additions, 0 deletionshadrian/bindist/Makefile
- hadrian/bindist/config.mk.in 2 additions, 0 deletionshadrian/bindist/config.mk.in
- hadrian/cabal.project 2 additions, 0 deletionshadrian/cabal.project
- hadrian/cfg/default.host.target.in 39 additions, 0 deletionshadrian/cfg/default.host.target.in
- hadrian/cfg/default.target.in 39 additions, 0 deletionshadrian/cfg/default.target.in
- hadrian/cfg/system.config.in 7 additions, 91 deletionshadrian/cfg/system.config.in
- hadrian/hadrian.cabal 2 additions, 0 deletionshadrian/hadrian.cabal
- hadrian/src/Base.hs 19 additions, 0 deletionshadrian/src/Base.hs
- hadrian/src/Builder.hs 36 additions, 15 deletionshadrian/src/Builder.hs
- hadrian/src/Context.hs 11 additions, 12 deletionshadrian/src/Context.hs
- hadrian/src/Flavour.hs 0 additions, 1 deletionhadrian/src/Flavour.hs
- hadrian/src/Hadrian/Haskell/Hash.hs 1 addition, 2 deletionshadrian/src/Hadrian/Haskell/Hash.hs
- hadrian/src/Hadrian/Oracles/TextFile.hs 65 additions, 1 deletionhadrian/src/Hadrian/Oracles/TextFile.hs
- hadrian/src/Oracles/Flag.hs 27 additions, 40 deletionshadrian/src/Oracles/Flag.hs
- hadrian/src/Oracles/Setting.hs 77 additions, 171 deletionshadrian/src/Oracles/Setting.hs
Loading
Please register or sign in to comment