[Nix-dev] cross toolchain howto request

Sergey Mironov ierton at gmail.com
Tue Mar 5 12:03:53 CET 2013


2013/3/5 Sergey Mironov <ierton at gmail.com>:
> $ nix-env -i -A i386_toolchain.gcc
> installing `gcc-wrapper-4.6.3-static-i386-unknown-elf'
> ... <installing the cross-compiler>
>
> $ nix-env -i -A i386_toolchain.binutils
> installing `binutils-2.21.1a-i386-unknown-elf'
> ... installing binutils
>
> Now everything is all-right. User can use i386-unknown-elf-gcc and
> other tools. But what if I want to install armv5tel_toolchain?
>
> $ nix-env -i -A armv5tel_toolchain.gcc
> replacing old `gcc-wrapper-4.6.3-static-i386-unknown-elf'
> installing `gcc-wrapper-4.6.3-static-armv5tel-unknown-elf'
>
> That is bad: I don't want to replace i386, I want to keep it but
> install armv5tel as well. Looks like Nixos treats both toolchains as
> one package, but why is that? I know that gccCrossStageStatic actually
> calls gcc-cross-wrapper, but it changes the name argument.. Any ideas?

Heh, I have an idea :) Probably, Nix-env treats all cross compilers as
versions of single gcc package. So it can't see any difference between
gcc upgrade and installing another cross-toolchain. So it basically
'helps' me to upgrade my compiler instead of installing arm version
together with i386. Nix-env has -P flag which can be used to
workaround problem I've reported. Still, IMO it is bad and nix should
treat every cross-gcc as independent package.

Sergey


More information about the nix-dev mailing list