8 Oct 2024 |
Artturin |
I also switched from using buildPackages to pkgs to improve cross-compilation compatibility.
| 02:10:47 |
Artturin | Comment on the pr and tell what you're doing and how it broke @colemickens:matrix.org | 02:11:06 |
colemickens | Thanks Artturin I'll play on my hm branch and then send feedback. :). | 02:12:04 |
colemickens | * Thanks Artturin I'll play on my hm branch and then send feedback. :). (EDIT: and thanks again for replying) | 02:17:13 |
9 Oct 2024 |
| Alexandros Liarokapis joined the room. | 20:12:12 |
Alexandros Liarokapis | is there an easy way to get a proper cross-compilation stdenv based on clang and the target approach ? | 20:13:04 |
Tristan Ross | In reply to @aliarokapis:matrix.org is there an easy way to get a proper cross-compilation stdenv based on clang and the target approach ? Cross compile between arch's while using clang? | 20:14:21 |
Tristan Ross | pkgsLLVM exists | 20:14:27 |
Tristan Ross | But that might not work until a certain PR is merged with pkgsCross | 20:14:41 |
Alexandros Liarokapis | currently I do the usual explicit instantiation stuff with crossSystem etc. | 20:15:55 |
Tristan Ross | Oh yeah, you can look at how pkgsLLVM is defined in pkgs/top-level/stage.nix | 20:17:13 |
Alexandros Liarokapis | thanks! | 20:17:25 |
Alexandros Liarokapis | is this new? | 20:17:36 |
Tristan Ross | No, it's been there for quite some time. | 20:17:46 |
Tristan Ross | At least like 3 years I think. | 20:17:59 |
Tristan Ross | Not everything is going to work, I have actually been one of the few people trying to make LLVM built nixpkgs better. I have https://github.com/RossComputerGuy/nixpkgs-llvm-ws/ which is a Flake that has an overlay which introduces fixes. | 20:19:00 |
Alexandros Liarokapis | This would be hugely helpful. I need to cross-compile for embedded platforms and I actually had to create a fully custom stdenv based on the arm toolchain which basically mimic-ed the whole cross stage. Gcc is not great in this regard either, the bootstrapping is cursed. LLVM has much better cross compilation support. | 20:21:45 |
Tristan Ross | If you like LLVM cross compiling, you should look at Zig. It ships libc sources so no need to bootstrap an entire cross compiling environment. | 20:22:55 |
Alexandros Liarokapis | Yea Zig is awesome in this regard. | 20:23:12 |
Tristan Ross | We actually have a pkgsZig in nixpkgs | 20:23:31 |
Tristan Ross | So you can use Zig to cross compile | 20:23:38 |
ToxicFrog | Ooo | 20:23:56 |
ToxicFrog | I should look at that sometime | 20:23:59 |
Tristan Ross | We also have pkgsArocc which arocc is a Zig written C compiler but Arocc is still quite experimental. | 20:24:39 |
Alexandros Liarokapis | main issue is I really need a cross-compiling C++ compiler as well. | 20:25:06 |
Tristan Ross | I think Zig has some C++ stuff but no C++ stdlib | 20:25:25 |
Tristan Ross | Mainly just the compiler itself | 20:25:33 |
Tristan Ross | If you use Zig built with LLVM then it uses libclang which I believe includes the C++ compiler | 20:28:11 |
Alexandros Liarokapis | I will definitely look into this, also the repo. | 20:28:38 |
Alexandros Liarokapis | is this just delegating to clang ? | 20:32:23 |