nixpkgs/systems: Add ucrt64 as MinGW libc

The Minimalist Gnu for Windows distribution comes with support for
the traditional msvcrt libc, as well as ucrt64 libc. The latter
being the newer universal compiler runtime. We follow the msys2
environment naming convention[1]:

| name       | toolchain | arch    | libc   | libc++    |
|------------|-----------|---------|--------|-----------|
| mingw32    | gcc       | i686    | msvcrt | libstdc++ |
| mingw64    | gcc       | x86_64  | msvcrt | libstdc++ |
| ucrt64     | gcc       | x86_64  | ucrt   | libstdc++ |
| clang32    | llvm      | i686    | ucrt   | libc++    |
| clang64    | llvm      | x86_64  | ucrt   | libc++    |
| clangarm64 | llvm      | aarch64 | ucrt   | libc++    |

For now nixpkgs only supports the first three with this commit.

--
[1]: https://www.msys2.org/docs/environments/
This commit is contained in:
Moritz Angermann 2023-09-08 14:29:54 +08:00
parent a81e3dcd75
commit 1e0561d78a
3 changed files with 8 additions and 0 deletions

View file

@ -313,6 +313,11 @@ rec {
libc = "msvcrt"; # This distinguishes the mingw (non posix) toolchain
};
ucrt64 = {
config = "x86_64-w64-mingw32";
libc = "ucrt"; # This distinguishes the mingw (non posix) toolchain
};
# BSDs
x86_64-freebsd = {

View file

@ -36,6 +36,8 @@ in stdenv.mkDerivation {
configureFlags = [
"--enable-idl"
"--enable-secure-api"
] ++ lib.optionals (stdenv.targetPlatform.libc == "ucrt") [
"--with-default-msvcrt=ucrt"
];
enableParallelBuilding = true;

View file

@ -21762,6 +21762,7 @@ with pkgs;
else if name == "newlib-nano" then targetPackages.newlib-nanoCross or newlib-nanoCross
else if name == "musl" then targetPackages.muslCross or muslCross
else if name == "msvcrt" then targetPackages.windows.mingw_w64 or windows.mingw_w64
else if name == "ucrt" then targetPackages.windows.mingw_w64 or windows.mingw_w64
else if name == "libSystem" then
if stdenv.targetPlatform.useiOSPrebuilt
then targetPackages.darwin.iosSdkPkgs.libraries or darwin.iosSdkPkgs.libraries