I was trying to install a few cross-compilers to be available in parallel in a single environment as ${target}-gcc. Looks like mingw one are slightly broken currently. Here is a minimal reproducer:
// $ cat a.c
int main(){}
Porblematic attempt mingw32:
$ nix build -f ~/nm pkgsCross.mingw32.stdenv.cc
$ ./result/bin/i686-w64-mingw32-gcc a.c -o a
/nix/store/wlcxwq9ll6jprhjfn5iwv6mk5ip9g8d1-i686-w64-mingw32-binutils-2.35.2/bin/i686-w64-mingw32-ld: cannot find -lmcfgthread
collect2: error: ld returned 1 exit status
Working gnu32 attempt:
$ nix build -f ~/nm pkgsCross.gnu32.stdenv.cc
$ ./result/bin/i686-unknown-linux-gnu-gcc a.c -o a
Expected behavior
I expect both cases of compiler to be able to link minimal int main(){} example without extra environment settings.
Metadata
$ nix-shell -p nix-info --run "nix-info -m"
- system: `"x86_64-linux"`
- host os: `Linux 5.16.0, NixOS, 22.05 (Quokka)`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.6.0pre20211217_6e6e998`
- channels(root): `"nixos"`
- nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
I was trying to install a few cross-compilers to be available in parallel in a single environment as
${target}-gcc. Looks like mingw one are slightly broken currently. Here is a minimal reproducer:Porblematic attempt
mingw32:Working
gnu32attempt:Expected behavior
I expect both cases of compiler to be able to link minimal
int main(){}example without extra environment settings.Metadata