Gcc-arm-embedded: gcc-7

Hi all!

I am using shell.nix file to declare the environment for developing my project. I have this line in my shell.nix:

buildInputs = [ gnumake gcc-arm-embedded ];

I read that this method is obsolete now, that’s why the gcc-arm-embedded package is not updated beyond gcc-6. Is that correct? If yes, what is the best way how to get the gcc-7 for arm in my shell environment?

I read something about crossSystem but i cannot figure that out. :-/ I also have feeling this is used in nix-build when one wants to cross-compile a nix package, but this is not my usecase. I want to have arm-none-eabi-gcc cross-compiler in my shell environment for development of a project unrelated to nix.

Unfortunately there’s not a GCC that’s exactly the same as gcc-arm-embedded. It’s going to depend on exactly what you are targeting (all GCCs in Nixpkgs are single target but gcc-arm-embedded might be multi-target?)

This gets a little bit awkward right now, but I think this is roughly equivalent:

  buildInputs = [ gnumake pkgsCross.muslpi.buildPackages.gcc ];

There is some discrepancy between gcc-arm-embedded and pkgsCross.muslpi.buildPackages.gcc. gcc-arm-embedded uses newlib while muslpi will use musl. We need to work to get a newlib target. It shouldn’t be too hard but I don’t really have any newlib embedded arm hardware to test on.