| 26 Apr 2025 |
aleksana 🏳️⚧️ (force me to bed after 18:00 UTC) | There are two issues here, the less significant issue is that I need to change the default ghc version to 9.12, but I don't know how compatible our stackage is with this version. | 03:55:29 |
aleksana 🏳️⚧️ (force me to bed after 18:00 UTC) | The bigger issue is that I can't rely on 9.10 to compile 9.12, like we do now, so I should package a binary distribution of 9.12, but upstream does not publish binary distribution built for loongarch64. | 03:56:56 |
aleksana 🏳️⚧️ (force me to bed after 18:00 UTC) | Oh, there's hadrian bootstrap source, but upstream only publishes 9.8 and 9.10 | 04:01:30 |
aleksana 🏳️⚧️ (force me to bed after 18:00 UTC) | Wait, seems like the support is older than I got, I just have to get a set of patches | 04:10:25 |
aleksana 🏳️⚧️ (force me to bed after 18:00 UTC) | In reply to @aleksana:mozilla.org Oh, there's hadrian bootstrap source, but upstream only publishes 9.8 and 9.10 It's not ghc with hc files generated 😣 | 04:38:25 |
Alex | In reply to @aleksana:mozilla.org The bigger issue is that I can't rely on 9.10 to compile 9.12, like we do now, so I should package a binary distribution of 9.12, but upstream does not publish binary distribution built for loongarch64. You can cross-compile 9.4 using the LLVM backend and use that to natively compile newer versions. | 09:10:30 |
aleksana 🏳️⚧️ (force me to bed after 18:00 UTC) | In reply to @alex:tunstall.xyz You can cross-compile 9.4 using the LLVM backend and use that to natively compile newer versions. There's no loongarch64 support in ghc94 at all | 09:15:18 |
aleksana 🏳️⚧️ (force me to bed after 18:00 UTC) | I'm trying to cross compile ghc 9.8.4 with no luck | 09:15:37 |
Alex | It doesn't matter. You can use unregisterised mode. | 09:15:40 |
Alex | AFAIK cross is completely broken with Hadrian.
If you can get it to work, I'd love to know how. | 09:16:05 |
aleksana 🏳️⚧️ (force me to bed after 18:00 UTC) | In reply to @alex:tunstall.xyz AFAIK cross is completely broken with Hadrian.
If you can get it to work, I'd love to know how. I don't write haskell at all tbh | 09:16:27 |
aleksana 🏳️⚧️ (force me to bed after 18:00 UTC) | In reply to @alex:tunstall.xyz It doesn't matter. You can use unregisterised mode. Do we have nix code for unregisterised mode already? | 09:17:14 |
Alex | Unregisterised GHC relies entirely on the C compiler and needs no knowledge of the target architecture. | 09:17:16 |
Alex | Yes, you can set it explicitly, but GHC will do so automatically if it doesn't recognise the architecture anyway. | 09:17:49 |
aleksana 🏳️⚧️ (force me to bed after 18:00 UTC) | Oh so pkgsCross.loongarch64-linux.haskell.packages.ghc984.ghc is hadrian | 09:21:05 |
aleksana 🏳️⚧️ (force me to bed after 18:00 UTC) | I have to use pkgsCross.loongarch64-linux.haskell.packages.native-bignum.ghc984.ghc and temporarily override enableUnregisterised | 09:22:57 |
magic_rb | Youre porting ghc to loongarch? | 09:26:26 |
aleksana 🏳️⚧️ (force me to bed after 18:00 UTC) | In reply to @magic_rb:matrix.redalder.org Youre porting ghc to loongarch? Not porting, just making it work in nixpkgs | 09:26:42 |
aleksana 🏳️⚧️ (force me to bed after 18:00 UTC) | The porting work has largely done on ghc>=9.6.6 and llvm>=16 actually | 09:27:06 |
magic_rb | Ah, i went to aliexpress, punched in loongarch64, got a page full of toothbrushes lol | 09:27:21 |
magic_rb | In reply to @aleksana:mozilla.org The porting work has largely done on ghc>=9.6.6 and llvm>=16 actually Does the NCG support loongarch64 these days? | 09:27:38 |
aleksana 🏳️⚧️ (force me to bed after 18:00 UTC) | In reply to @magic_rb:matrix.redalder.org Does the NCG support loongarch64 these days? I don't think so | 09:27:54 |
aleksana 🏳️⚧️ (force me to bed after 18:00 UTC) | In reply to @aleksana:mozilla.org I have to use pkgsCross.loongarch64-linux.haskell.packages.native-bignum.ghc984.ghc and temporarily override enableUnregisterised Both results in
/nix/store/yfnsdzxp90xkwaxnm467y660nsj4zzgb-libffi-loongarch64-unknown-linux-gnu-3.4.7-dev/include/ffitarget.h:38:2: error: #error "libffi was configured for a LoongArch target but this does not appear to be a LoongArch compiler."
38 | #error \
| ^~~~~
/nix/store/yfnsdzxp90xkwaxnm467y660nsj4zzgb-libffi-loongarch64-unknown-linux-gnu-3.4.7-dev/include/ffitarget.h:66:2: error: #error unsupported LoongArch base architecture
66 | #error unsupported LoongArch base architecture
| ^~~~~
In file included from _build/stage0/libraries/ghci/build/GHCi/FFI_hsc_make.c:1:
FFI.hsc: In function ‘main’:
FFI.hsc:171:16: error: ‘FFI_DEFAULT_ABI’ undeclared (first use in this function); did you mean ‘FFI_LAST_ABI’?
/build/ghc-9.8.4-source/_build/stageBoot/lib/template-hsc.h:45:10: note: in definition of macro ‘hsc_const’
45 | if ((x) < 0) \
| ^
FFI.hsc:171:16: note: each undeclared identifier is reported only once for each function it appears in
/build/ghc-9.8.4-source/_build/stageBoot/lib/template-hsc.h:45:10: note: in definition of macro ‘hsc_const’
45 | if ((x) < 0) \
| ^
| 09:28:10 |
aleksana 🏳️⚧️ (force me to bed after 18:00 UTC) | Is because of this
#ifndef __loongarch__
#error \
"libffi was configured for a LoongArch target but this does not appear to be a LoongArch compiler."
#endif
| 09:30:56 |
Alex | Have you tried pkgsCross.loongarch64-linux.haskell.compilers.native-bignum.ghc94 instead? | 09:33:09 |
aleksana 🏳️⚧️ (force me to bed after 18:00 UTC) | In reply to @alex:tunstall.xyz Have you tried pkgsCross.loongarch64-linux.haskell.compilers.native-bignum.ghc94 instead? host platform inferred as: x86_64-unknown-linux
Unknown CPU loongarch64
I have enableUnregistered set to true | 09:35:14 |
aleksana 🏳️⚧️ (force me to bed after 18:00 UTC) | enableUnregisterised | 09:35:31 |
Alex | In configurePhase? Might need a bit of patching then :/ | 09:35:59 |
aleksana 🏳️⚧️ (force me to bed after 18:00 UTC) | Is cross broken in newer versions? | 09:36:26 |
Alex | Last I checked, yes. | 09:36:44 |