Skip to content

pkgsCross.mingw32.stdenv.cc provides slightly incomplete linking environment: cannot find -lmcfgthread #156343

@trofi

Description

@trofi

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`

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: bugSomething is broken6.topic: cross-compilationBuilding packages on a different platform than they will be used on6.topic: windowsRunning, or buiding, packages on Windows
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions