Hey, I am trying to cross compile something for arm on my x86 NixOS right now, but can’t manage to get the proper toolchain in my environment.
Basically, I only need arm-linux-gnueabihf-gcc, etc. in a nix-env or nix-shell, but cannot seem to figure out how to do this.
I found some stuff on the nixpkgs bugtracker, but that was mainly about derivations using crossSystem, which is not what I need.
This seems quite trivial, but I just cannot find a proper package or way to achieve this.
I believe you don’t want to differ much from regular cross-builds. I would go as if writing an expression for nix-build, in the respect of setting those cross parameters and specifying (native) build inputs (no need for source, build scripts, etc.) – and put that expression into a shell.nix in your development directory.
My Raspberry Pi wants to build llvm for some reason. Since it would take ages on the little chip I thought I might cross-compile it on my desktop. I tried nix-env -iA nixos.llvm_6 --arg crossSystem '{ config = "arm-linux-gnueabihf"; }' but it fails with error: missing kernelArch. How might I fix this?
Might be a good place to bring up how timeouts in aarch64 seems to be making me compile llvm_6 and gfortran myself. gfortran has been timing out for quite a while on hydra and llvm_6 only seems to be a problem for staging-next even though everything seems to finish fine but just times out.
Well, yes, we’ll need to do something systematic about these aarch64 timeouts on Hydra, but that’s actually not a practical problem with cross-compilation, as x86 builders seem fast enough not to suffer from this.