| 26 Apr 2025 |
emily | splicing issue maybe? | 12:51:02 |
Find me at aleksana:qaq.li | In reply to @emilazy:matrix.org splicing issue maybe? Very likely | 12:51:29 |
Find me at aleksana:qaq.li | Because the attribute is referenced from buildPackages: https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/haskell-packages.nix#L482 | 13:04:18 |
sterni (he/him) | haskell.packages.*.ghc is like stdenv.cc | 13:04:56 |
sterni (he/him) | haskell.compiler.* would be cross compiled | 13:05:10 |
emily | hm, wouldn't it make more sense to use buildPackages explicitly for that? | 13:08:49 |
emily | I assume that pkgsCross.foo.* is going to have host foo unless * starts with buildPackages. (with stdenv as an unfortunate exception) | 13:09:20 |
emily | I guess there are probably other unfortunate exceptions already though. | 13:09:31 |
emily | WTB universe without the GNU idea of cross… | 13:10:01 |
sterni (he/him) | as said, it’s like stdenv with all the weirdness involved, this is probably the best way to do it. You can’t even do an equivalent of libc/cc split | 13:26:18 |
Find me at aleksana:qaq.li | I think I'm on the right track now. The performance impact of enableUnregisterised is really huge | 14:36:42 |
| Grand Warden Mayhem, Punisher of Deer changed their display name from Magnolia Mayhem to Magnolia Mayhem: Rallycar Mailman. | 14:40:29 |
Find me at aleksana:qaq.li | @sterni I now get to the same point you got in https://gitlab.haskell.org/ghc/ghc/-/issues/22006 now | 15:37:01 |
Find me at aleksana:qaq.li | The log says "Run Ghc CompileHs Stage1" but the resulting ghc is stage0 | 15:38:16 |
Find me at aleksana:qaq.li | But if, say, I put this ghc into the derivation again, it would start complaining about hostPlatform != buildPlatform | 15:39:17 |
Find me at aleksana:qaq.li | Like they said in https://gitlab.haskell.org/ghc/ghc/-/issues/22006#note_448234 and https://gitlab.haskell.org/ghc/ghc/-/wikis/building/cross-compiling#terminology-and-background | 15:40:55 |
Find me at aleksana:qaq.li | "build must equal host" | 15:41:06 |
Find me at aleksana:qaq.li | But someone wrote here https://bbs.loongarch.org/d/150-ghc-loongarch that they did cross compile to loongarch64 2 years ago with ghc 9.6 and they just used --target=loongarch64-unknown-linux-gnu and hadrian/build, nothing special | 15:43:43 |
Alex | Make used nonstandard cross terminology and the configure script was designed to match.
Hadrian fixed that confused terminology, but the configure script was never updated to match. | 16:00:37 |
| 27 Apr 2025 |
sterni (he/him) | What makes you say that? stage0 is passed in (i.e. the bootstrap compiler), so you can't really get it out. | 09:38:10 |
Find me at aleksana:qaq.li | In reply to @sternenseemann:systemli.org What makes you say that? stage0 is passed in (i.e. the bootstrap compiler), so you can't really get it out. The resulting binary is x86_64-x86_64-loong64,instead of x86_64-loong64-loong64 | 09:39:26 |
Find me at aleksana:qaq.li | build-host-target | 09:39:36 |
Find me at aleksana:qaq.li | In reply to @aleksana:mozilla.org The log says "Run Ghc CompileHs Stage1" but the resulting ghc is stage0 But this took me 40 minutes | 09:39:59 |
sterni (he/him) | That's stage1 then. | 09:41:27 |
Find me at aleksana:qaq.li | In reply to @sternenseemann:systemli.org That's stage1 then. So as its document suggests the resulting binary should run on loongarch64 | 09:42:31 |
sterni (he/him) | GHC, in terms of cross really only has two variables when it comes down to it:
- stage0 you pass in and it has to be a native compiler.
- target: which sets the target for all GHCs produced by the build system.
This gives you, assuming you set target to be different from host:
- Stage0 builds Stage1. Stage1 is (host==build)->target, a cross compiler.
- Stage1 builds Stage2. Stage2 is target->target, a cross compiled native GHC.
| 09:46:30 |
sterni (he/him) | Or as the document says:
So considering the two cases we identified at the top of the page:
- Building GHC as a cross-compiler - this is the stage 1 compiler
- Cross-compiling GHC itself - this is the stage 2 compiler
both of these cases are handled in the same way.
| 09:47:13 |
Find me at aleksana:qaq.li | In reply to @sternenseemann:systemli.org
GHC, in terms of cross really only has two variables when it comes down to it:
- stage0 you pass in and it has to be a native compiler.
- target: which sets the target for all GHCs produced by the build system.
This gives you, assuming you set target to be different from host:
- Stage0 builds Stage1. Stage1 is (host==build)->target, a cross compiler.
- Stage1 builds Stage2. Stage2 is target->target, a cross compiled native GHC.
So we don't have derivation for stage2 yet? | 09:50:49 |
sterni (he/him) | Building a cross compiler (stage1) is largely unproblematic and works well with hadrian. Building Stage2 is much more problematic, precisely because it's treated as “just running stage1 again” which doesn't give many avenues for prescribing different tools, libs etc. I'm relatively sure that, for us, it just works because cc-wrapper checks the architecture of libraries before linking since GHC has no ability to differentiate the inputs. | 09:50:55 |
sterni (he/him) | We have, what where you trying to build? | 09:51:07 |