RISC-V/GHC: Difference between revisions
Created page with "{{RISC-V/breadcrumb}} <span id="ghc"></span> === GHC === <code>cannot bootstrap GHC on this platform ('riscv64-linux' with libc 'defaultLibc')</code> see: * https://gitlab.haskell.org/ghc/ghc/-/issues/23179 * https://gitlab.haskell.org/ghc/ghc/-/issues/16783 * https://gitlab.haskell.org/ghc/ghc/-/issues/14903 * https://gitlab.haskell.org/ghc/ghc/-/commit/31e265c1df948d1bcc82d08affe995fd1d1c1438 * '''https://gitlab.haskell.org/ghc/ghc/-/issues/23519''' ← we need this..." |
Add link to sterni's GHC cross PR |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{RISC-V/breadcrumb}} | {{RISC-V/breadcrumb}} | ||
== Current status == | |||
<code>cannot bootstrap GHC on this platform ('riscv64-linux' with libc 'defaultLibc')</code> | |||
* [https://gitlab.haskell.org/ghc/ghc/-/issues/16783 Main issue] | |||
= | * [https://gitlab.haskell.org/ghc/ghc/-/issues/23179 NCG] | ||
* [https://gitlab.haskell.org/ghc/ghc/-/commit/31e265c1df948d1bcc82d08affe995fd1d1c1438 LLVM backend] | |||
* '''[https://gitlab.haskell.org/ghc/ghc/-/issues/23519 Binary tarballs] (needed for bootstrap)''' | |||
* [https://gitlab.haskell.org/ghc/ghc/-/issues/?label_name%5B%5D=RISC-V RISC-V Label] | |||
Some popular affected packages are: | |||
* nix-tree | |||
* nixfmt | |||
* hledger | |||
* hledger-ui | |||
* hledger-web | |||
* exa | |||
* pandoc | |||
* nix-output-monitor | |||
* xmonad | |||
== Booting GHC via cross-compilation == | |||
On a platform where Nixpkgs supports compiling GHC (e.g. <code>x86_64-linux</code>): | On a platform where Nixpkgs supports compiling GHC (e.g. <code>x86_64-linux</code>): | ||
Line 152: | Line 155: | ||
For newer GHCs, refer to the GHC documentation or the Nixpkgs source to find which version of GHC and LLVM is needed for compilation. | For newer GHCs, refer to the GHC documentation or the Nixpkgs source to find which version of GHC and LLVM is needed for compilation. | ||
GHC >=9.2 is unable to boot | GHC >=9.2 is unable to boot 9.2 and 9.4. GHC >=9.6 cannot be cross-compiled at all due to issues with Hadrian. Newer GHCs can be booted using natively compiled versions of GHC instead. | ||
See https://github.com/AlexandreTunstall/nixos-riscv for an example of a pure flake that uses this trick to compile Haskell programs for RISC-V. | See https://github.com/AlexandreTunstall/nixos-riscv for an example of a pure flake that uses this trick to compile Haskell programs for RISC-V. | ||
== See also == | |||
* [https://github.com/NixOS/nixpkgs/pull/243619 Nixpkgs PR 243619 (fix cross-built native GHC)] | |||
* [https://github.com/NixOS/nixpkgs/pull/305392 Nixpkgs PR 305392 (fix cross-built native GHC, version 2)] |