-
Notifications
You must be signed in to change notification settings - Fork 248
GHC binaries from haskell.nix don't work on aarch64 #621
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@TravisWhitaker try disabling |
Looks like this is due to “-fast-llvm.” If I remove it from the generated build.mk, I get a GHC 8.8.3 that works just fine. |
@TravisWhitaker did you have |
@TravisWhitaker there is also |
Again,
|
@angerman What I just tried on a hunch was my branch here with the bit here that adds -fast-llvm to GhcStage2HcOpts and GhcLibHcOpts commented out. Looking at compiler/ghc/default.nix, I think we're breaking your first rule when building GHC itself; I don't see |
Should we build GHC itself with -fno-plt, or should we build it without -fast-llvm? |
|
I’ll give that a go and see if we get a working aarch64 GHC. |
to validate it's the function -> object rewrite, you could build without |
Actually, I think this might be more tricky than using |
The relevant check is in https://github.com/microsoft/llvm/blob/master/test/CodeGen/AArch64/nonlazybind.ll |
Here's a rough patch of what the llvm codegen probably needs to do: https://gist.github.com/angerman/0dbc0b6587ed4d3ca01299924d26c255 |
Can we disable |
Yes, I would agree with @TravisWhitaker; the solution here seems obvious: disable |
@TravisWhitaker yes we should drop it. Even though I remain highly skeptical about using the Mangler, and using two different toolchains for code gen and assembly. However as this seems to be rather poorly supported in llvm, even nonlazybind is not guaranteed to be respected by every lowering backend. |
I believe that haskell.nix is patching GHC (or making some other change vs. upstream) in a way that impacts memory safety on aarch64.
With minor changes, haskell.nix can be used to build e.g. an 8.8.3 bootstrapped with 8.8.2 on aarch64: #620
Building this way with the branch from that linked PR:
Where
../nixpkgs-channels
is pointed at currentnixos-20.03
, the build fails at the very end with this:This occurs at the very end, where stage 2 is being used to build haddock. I initially suspected some memory barrier regressions in the 8.8 branch (and opened this https://gitlab.haskell.org/ghc/ghc/issues/18201), but I've failed to reproduce this issue with vanilla upstream 8.8.3.
I'm sifting through the build.mk and configure flags that haskell.nix chooses to see if I work out what might be causing this, next will be sifting through the patches that are applied.
The text was updated successfully, but these errors were encountered: