Guix release binaries use GCC’s POSIX thread model, while the pinned Nixpkgs toolchain defaults to mcf. This makes POSIX the default for Nix Windows cross builds. Nightly builds can select mcf or win32 with the threadModel argument.
The Nixpkgs threads setting selects the model before GCC is built. Only the mcf model pulls in mcfgthreads. For POSIX, GCC’s target libraries need winpthreads headers and libraries during the compiler build. The EXTRA_*_FOR_TARGET flags provide those paths without exposing target headers to GCC’s native build tools, which caused the earlier build failure.
The compiler wrapper includes winpthreads through extraPackages, so the shell no longer needs to export pthread include and library flags manually. CI also prints GCC’s configured thread model to make mismatches visible.
Fixes #36314