[Git][ghc/ghc][wip/hadrian-cross-stage2] 5 commits: hadrian: Build stage 2 cross compilers

Matthew Pickering (@mpickering) gitlab at gitlab.haskell.org
Wed Sep 25 21:27:54 UTC 2024



Matthew Pickering pushed to branch wip/hadrian-cross-stage2 at Glasgow Haskell Compiler / GHC


Commits:
00e38633 by Matthew Pickering at 2024-09-25T22:27:46+01:00
hadrian: Build stage 2 cross compilers

* Most of hadrian is abstracted over the stage in order to remove the
  assumption that the target of all stages is the same platform. This
  allows the RTS to be built for two different targets for example.
* Abstracts the bindist creation logic to allow building either normal
  or cross bindists. Normal bindists use stage 1 libraries and a stage 2
  compiler. Cross bindists use stage 2 libararies and a stage 2
  compiler.
* hadrian: Make binary-dist-dir the default build target. This allows us
  to have the logic in one place about which libraries/stages to build
  with cross compilers. Fixes #24192

New hadrian target:

* `binary-dist-dir-cross`: Build a cross compiler bindist (compiler =
  stage 1, libraries = stage 2)

-------------------------
Metric Decrease:
    T10421a
    T10858
    T11195
    T11276
    T11374
    T11822
    T15630
    T17096
    T18478
    T20261
Metric Increase:
    parsing001
-------------------------

- - - - -
174780d0 by Matthew Pickering at 2024-09-25T22:27:46+01:00
ci: Test cross bindists

We remove the special logic for testing in-tree cross
compilers and instead test cross compiler bindists, like we do for all
other platforms.

- - - - -
09f6e8f0 by Matthew Pickering at 2024-09-25T22:27:46+01:00
ci: Javascript don't set CROSS_EMULATOR

There is no CROSS_EMULATOR needed to run javascript binaries, so we
don't set the CROSS_EMULATOR to some dummy value.

- - - - -
b6e30bd2 by Matthew Pickering at 2024-09-25T22:27:46+01:00
ci: Introduce CROSS_STAGE variable

In preparation for building and testing stage3 bindists we introduce the
CROSS_STAGE variable which is used by a CI job to determine what kind of
bindist the CI job should produce.

At the moment we are only using CROSS_STAGE=2 but in the future we will
have some jobs which set CROSS_STAGE=3 to produce native bindists for a
target, but produced by a cross compiler, which can be tested on by
another CI job on the native platform.

CROSS_STAGE=2: Build a normal cross compiler bindist
CROSS_STAGE=3: Build a stage 3 bindist, one which is a native compiler and library for the target

- - - - -
67ba9efe by Matthew Pickering at 2024-09-25T22:27:46+01:00
Split up system.config into host/target config files

There were a number of settings which were not applied per-stage, for
example if you specified `--ffi-include-dir` then that was applied to
both host and target. Now this will just be passed when building the
crosscompiler.

The solution for now is to separate these two files into host/target and
the host file contains very bare-bones . There isn't currently a way to
specify with configure anything in the host file, so if you are building
a cross-compiler and you need to do that, you have to modify the file
yourself.

- - - - -


30 changed files:

- .gitlab/ci.sh
- .gitlab/generate-ci/gen_ci.hs
- .gitlab/jobs.yaml
- configure.ac
- distrib/configure.ac.in
- hadrian/README.md
- hadrian/bindist/config.mk.in
- + hadrian/cfg/system.config.host.in
- hadrian/cfg/system.config.in
- + hadrian/cfg/system.config.target.in
- hadrian/hadrian.cabal
- hadrian/src/Base.hs
- + hadrian/src/BindistConfig.hs
- hadrian/src/Builder.hs
- hadrian/src/Context.hs
- hadrian/src/Expression.hs
- hadrian/src/Flavour.hs
- hadrian/src/Flavour/Type.hs
- hadrian/src/Hadrian/Expression.hs
- hadrian/src/Hadrian/Haskell/Hash.hs
- hadrian/src/Hadrian/Oracles/TextFile.hs
- hadrian/src/Oracles/Flag.hs
- hadrian/src/Oracles/Flavour.hs
- hadrian/src/Oracles/Setting.hs
- hadrian/src/Oracles/TestSettings.hs
- hadrian/src/Packages.hs
- hadrian/src/Rules.hs
- hadrian/src/Rules/BinaryDist.hs
- hadrian/src/Rules/CabalReinstall.hs
- hadrian/src/Rules/Compile.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/7dec8d6d0196ac509bff76039df2a6227439e668...67ba9efee683a93121c453e9e1cc8f43f77a25a4

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/7dec8d6d0196ac509bff76039df2a6227439e668...67ba9efee683a93121c453e9e1cc8f43f77a25a4
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20240925/077fb6eb/attachment.html>


More information about the ghc-commits mailing list