Commit 1e0561d7 authored by Moritz Angermann's avatar Moritz Angermann
Browse files

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/
parent a81e3dcd
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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 = {
+2 −0
Original line number Diff line number Diff line
@@ -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;
+1 −0
Original line number Diff line number Diff line
@@ -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