Description
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:
nix-build -E "with import ../nixpkgs-channels/default.nix (import ./. {}).nixpkgsArgs; haskell-nix.compiler.ghc883"
Where ../nixpkgs-channels
is pointed at current nixos-20.03
, the build fails at the very end with this:
ghc-stage2: internal error: evacuate: strange closure type -1860476400
(GHC version 8.8.3 for aarch64_unknown_linux)
ghc-stage2: internal error: Please report this as a GHC bug: https://www.haskell.org/ghc/reportabug
evacuate: strange closure type -1860476400
(GHC version 8.8.3 for aarch64_unknown_linux)
Please report this as a GHC bug: https://www.haskell.org/ghc/reportabug
ghc-stage2: internal error: evacuate: strange closure type -1860476400
(GHC version 8.8.3 for aarch64_unknown_linux)
Please report this as a GHC bug: https://www.haskell.org/ghc/reportabug
ghc-stage2: internal error: evacuate: strange closure type -1860476400
(GHC version 8.8.3 for aarch64_unknown_linux)
Please report this as a GHC bug: https://www.haskell.org/ghc/reportabug
ghc-stage2: internal error: evacuate: strange closure type -1860476400
(GHC version 8.8.3 for aarch64_unknown_linux)
Please report this as a GHC bug: https://www.haskell.org/ghc/reportabug
ghc-stage2: internal error: evacuate: strange closure type -1860476400
(GHC version 8.8.3 for aarch64_unknown_linux)
Please report this as a GHC bug: https://www.haskell.org/ghc/reportabug
ghc-stage2: internal error: evacuate: strange closure type -1860476400
(GHC version 8.8.3 for aarch64_unknown_linux)
Please report this as a GHC bug: https://www.haskell.org/ghc/reportabug
ghc-stage2: internal error: evacuate: strange closure type -1860476400
(GHC version 8.8.3 for aarch64_unknown_linux)
Please report this as a GHC bug: https://www.haskell.org/ghc/reportabug
ghc-stage2: internal error: evacuate: strange closure type -1860476400
(GHC version 8.8.3 for aarch64_unknown_linux)
Please report this as a GHC bug: https://www.haskell.org/ghc/reportabug
ghc-stage2: internal error: evacuate: strange closure type -1860476400
(GHC version 8.8.3 for aarch64_unknown_linux)
Please report this as a GHC bug: https://www.haskell.org/ghc/reportabug
make[1]: *** [utils/haddock/ghc.mk:20: utils/haddock/dist/build/Paths_haddock.dyn_o] Aborted (core dumped)
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.