Skip to content

Commit

Permalink
haskell.compiler.ghc981: build stage 2 compiler for “native cross”
Browse files Browse the repository at this point in the history
When we are building compiler for a platform we can execute ourselves,
we can build a proper stage2 compiler which unlocks some features that
are interesting for e.g. pkgsStatic.

The resulting compiler is technically a native compiler that's prefixed.
  • Loading branch information
sternenseemann committed Apr 16, 2024
1 parent 179f8e0 commit 1dc7345
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkgs/development/compilers/ghc/common-hadrian.nix
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,11 @@
-- no way to set this via the command line
finalStage :: Stage
finalStage = ${
if stdenv.hostPlatform == stdenv.targetPlatform
then "Stage2" # native compiler
# Always build the stage 2 compiler if possible. Note we can currently
# assume hostPlatform == buildPlatform.
# TODO(@sternenseemann): improve this condition when we can cross-compile GHC
if stdenv.hostPlatform.canExecute stdenv.targetPlatform
then "Stage2" # native compiler or “native” cross e.g. pkgsStatic
else "Stage1" # cross compiler
}
Expand Down

0 comments on commit 1dc7345

Please sign in to comment.