Nix Cross Compiling | 555 Members | |
| 117 Servers |
| Sender | Message | Time |
|---|---|---|
| 1 Jan 2026 | ||
| You will find a lot of agreement on this. | 17:58:21 | |
| We've moved away from implicit hooks for newer build systems | 17:58:31 | |
In favour of having an e.g. cmakeBuildHook that does all the automatic stuff, and which can be built separately. | 17:59:16 | |
| symphorien: I don't think we even need to write the toolchain to the nix store as a derivation. I'm kind of spitballing here, but I guess this could just be a pure nix string handled by the existing lib.systems.parse code | 18:00:35 | |
| thanks all for the input, I'll play around a bit more with this | 18:03:16 | |
| Speaking of the current cmake situation, the system where cmakeFlags and mesonFlags are constructed in make-derivation has quite big overhead. makeCMakeFlags and makeMesonFlags are one of the hotter functions in the whole of nixpkgs | 18:03:17 | |
| It would be nice if the hooks were bound to the stdenv and were memorised accordingly | 18:03:51 | |
| * It would be nice if the hooks were bound to the stdenv and were memoised accordingly | 18:04:04 | |
| can someone explain to me why i get a gcc that targets x86_64-linux in a derivation from a stdenv that has riscv32-none-elf as its target? | 18:06:22 | |
In reply to @zimward:zimward.moe $CC is that? | 18:55:02 | |
| Reproducer? | 18:55:07 | |
like nix develop nixpkgs#legacyPackages.x86_64-linux.pkgsCross.riscv32-embedded.newlib-nanothere is also the correct gcc in there with the target triplet prefix (and is set as the CC, but when i add cflags it tries to use the incorrect gcc) | 19:01:33 | |
| 19:54:37 | ||
| https://github.com/NixOS/nixpkgs/blob/700a15863ef33cc39478ac9a2ae5a92b3f4ad25e/pkgs/by-name/ne/newlib/package.nix#L39-L48 | 20:17:17 | |
gcc is always the for build gcc | 20:25:07 | |
| It doesn't exist when cross-compiling without buildPackages.stdenv.cc in depsBuildBuild | 20:25:29 | |
| 20:54:59 | ||
| 2 Jan 2026 | ||
| 20:26:41 | ||
| 5 Jan 2026 | ||
| Alyssa Ross: any chance you can take another look to #458935? John Ericson made some other suggestions that have been implemented. | 10:50:27 | |
| 6 Jan 2026 | ||
Thanks <3 I'm so happy :) | 17:49:19 | |
| 9 Jan 2026 | ||
| where do platform symbols like loongarch come from? I hit symbol issues in libffi when trying to build cross-compiling GHC on several platforms For instance, I'm getting https://github.com/libffi/libffi/blob/2263d6037f8ef6b8d5bef14117ad1a17c32a20b9/src/loongarch64/ffitarget.h#L66 which should mean __loongarch64 isn't defined, but loongarch is or the error on line 39 would trigger first I see both of them in https://loongson.github.io/LoongArch-Documentation/LoongArch-toolchain-conventions-EN.html but don't know where they're supposed to come from | 12:07:45 | |
* where do platform symbols like __loongarch__ come from?I hit symbol issues in libffi when trying to build cross-compiling GHC on several platforms For instance, I'm getting https://github.com/libffi/libffi/blob/2263d6037f8ef6b8d5bef14117ad1a17c32a20b9/src/loongarch64/ffitarget.h#L66 which should mean __loongarch64 isn't defined, but __loongarch__ is or the error on line 39 would trigger firstI see both of them in https://loongson.github.io/LoongArch-Documentation/LoongArch-toolchain-conventions-EN.html but don't know where they're supposed to come from | 12:08:15 | |
| the compiler defines them based on the selected/configured target | 12:12:39 | |
| https://github.com/gcc-mirror/gcc/blob/9a2402ad31db7507cb63905a8d98ce81769d9835/gcc/config/loongarch/loongarch-c.cc#L50-L56 | 12:13:18 | |
| so in this case GHC? or the c compiler? | 12:13:19 | |
| well, whichever compiler is processing that file ig | 12:13:45 | |
| hmm the actual failing command seems to be gcc | 12:15:39 | |
| oh wait a second it does hit the line 39 error | 12:37:06 | |
| both errors show up actually | 12:37:19 | |
| so maybe ghc isn't configuring gcc properly for loongarch? | 12:37:33 | |