haskell.compiler.ghc94: don't roundtrip C compilation via assembly#410085
Merged
sternenseemann merged 1 commit intoNixOS:haskell-updatesfrom May 28, 2025
Merged
haskell.compiler.ghc94: don't roundtrip C compilation via assembly#410085sternenseemann merged 1 commit intoNixOS:haskell-updatesfrom
sternenseemann merged 1 commit intoNixOS:haskell-updatesfrom
Conversation
GHC can be used to compile C sources which causes it to drive the configured C compiler. This is particularly relevant during GHC's own compilation, e.g. when building the rts. GHC takes a peculiar approach, always generating intermediate assembly instead of letting the C compiler emit object files directly. This causes an assembler check in clang >= 18 to fail on rts/StgCRun.c, failing the GHC build on darwin completely. Later GHC versions don't exhibit this issue since object code is emitted directly since 9.6. The easiest way to resolve the compilation failure seems to backport this change. However, the patch only applies on GHC 9.4 which is done here. The patch may be difficult to backport further, as the changed code was extensively refactored in GHC 9.4. Reference NixOS#367686.
0bb3293 to
9d5abb9
Compare
sternenseemann
added a commit
to sternenseemann/nixpkgs
that referenced
this pull request
May 27, 2025
We can/should use 9.0.2 to bootstrap some GHC versions, having the bindist makes things easier in some cases. - To bootstrap GHC 9.4 using 9.2 is not possible and 8.10.7 doesn't always work. Since source built 9.0.2 is broken on darwin at the moment, the bindist helps. Reference NixOS#367686, NixOS#410085. - To bootstrap GHC 9.2 without GHC 8.10. Reference NixOS#346214.
13 tasks
Contributor
|
Successfully created backport PR for |
Merged
1 task
sternenseemann
added a commit
that referenced
this pull request
May 30, 2025
We can/should use 9.0.2 to bootstrap some GHC versions, having the bindist makes things easier in some cases. - To bootstrap GHC 9.4 using 9.2 is not possible and 8.10.7 doesn't always work. Since source built 9.0.2 is broken on darwin at the moment, the bindist helps. Reference #367686, #410085. - To bootstrap GHC 9.2 without GHC 8.10. Reference #346214.
wolfgangwalther
pushed a commit
that referenced
this pull request
Jun 29, 2025
We can/should use 9.0.2 to bootstrap some GHC versions, having the bindist makes things easier in some cases. - To bootstrap GHC 9.4 using 9.2 is not possible and 8.10.7 doesn't always work. Since source built 9.0.2 is broken on darwin at the moment, the bindist helps. Reference #367686, #410085. - To bootstrap GHC 9.2 without GHC 8.10. Reference #346214. (cherry picked from commit bc59fa9)
wolfgangwalther
pushed a commit
that referenced
this pull request
Jun 30, 2025
We can/should use 9.0.2 to bootstrap some GHC versions, having the bindist makes things easier in some cases. - To bootstrap GHC 9.4 using 9.2 is not possible and 8.10.7 doesn't always work. Since source built 9.0.2 is broken on darwin at the moment, the bindist helps. Reference #367686, #410085. - To bootstrap GHC 9.2 without GHC 8.10. Reference #346214. (cherry picked from commit 221e06a)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GHC can be used to compile C sources which causes it to drive the configured C compiler. This is particularly relevant during GHC's own compilation, e.g. when building the rts. GHC takes a peculiar approach, always generating intermediate assembly instead of letting the C compiler emit object files directly. This causes an assembler check in clang >= 18 to fail on rts/StgCRun.c, failing the GHC build on darwin completely.
Later GHC versions don't exhibit this issue since object code is emitted directly since 9.6. The easiest way to resolve the compilation failure seems to backport this change. However, the patch only applies on GHC 9.4 which is done here. The patch may be difficult to backport further, as the changed code was extensively refactored in GHC 9.4.
Reference #367686.
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.