From 205faabfebf134a403e25916d9c73dc82bf703a3 Mon Sep 17 00:00:00 2001 From: seth Date: Fri, 16 Aug 2024 02:12:45 -0400 Subject: [PATCH 1/8] lib.systems.doubles: add aarch64-windows double --- lib/systems/doubles.nix | 2 +- lib/tests/systems.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/systems/doubles.nix b/lib/systems/doubles.nix index 6939e9a40c2d..f60c6a8addef 100644 --- a/lib/systems/doubles.nix +++ b/lib/systems/doubles.nix @@ -55,7 +55,7 @@ let "wasm64-wasi" "wasm32-wasi" # Windows - "x86_64-windows" "i686-windows" + "aarch64-windows" "x86_64-windows" "i686-windows" ]; allParsed = map parse.mkSystemFromString all; diff --git a/lib/tests/systems.nix b/lib/tests/systems.nix index f5e7bdd5b705..3a8054ef4bc8 100644 --- a/lib/tests/systems.nix +++ b/lib/tests/systems.nix @@ -60,7 +60,7 @@ lib.runTests ( testlinux = mseteq linux [ "aarch64-linux" "armv5tel-linux" "armv6l-linux" "armv7a-linux" "armv7l-linux" "i686-linux" "loongarch64-linux" "m68k-linux" "microblaze-linux" "microblazeel-linux" "mips-linux" "mips64-linux" "mips64el-linux" "mipsel-linux" "powerpc64-linux" "powerpc64le-linux" "riscv32-linux" "riscv64-linux" "s390-linux" "s390x-linux" "x86_64-linux" ]; testnetbsd = mseteq netbsd [ "aarch64-netbsd" "armv6l-netbsd" "armv7a-netbsd" "armv7l-netbsd" "i686-netbsd" "m68k-netbsd" "mipsel-netbsd" "powerpc-netbsd" "riscv32-netbsd" "riscv64-netbsd" "x86_64-netbsd" ]; testopenbsd = mseteq openbsd [ "i686-openbsd" "x86_64-openbsd" ]; - testwindows = mseteq windows [ "i686-cygwin" "x86_64-cygwin" "i686-windows" "x86_64-windows" ]; + testwindows = mseteq windows [ "i686-cygwin" "x86_64-cygwin" "aarch64-windows" "i686-windows" "x86_64-windows" ]; testunix = mseteq unix (linux ++ darwin ++ freebsd ++ openbsd ++ netbsd ++ illumos ++ cygwin ++ redox); }) From b5bf8e3fc7ecb579fc9a30484bcb31554d28b076 Mon Sep 17 00:00:00 2001 From: seth Date: Fri, 16 Aug 2024 02:14:36 -0400 Subject: [PATCH 2/8] lib.systems.examples: add aarch64-w64-mingw32 --- lib/systems/examples.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/systems/examples.nix b/lib/systems/examples.nix index 5059f6e0c838..20f96f0849d1 100644 --- a/lib/systems/examples.nix +++ b/lib/systems/examples.nix @@ -325,6 +325,13 @@ rec { libc = "ucrt"; # This distinguishes the mingw (non posix) toolchain }; + # LLVM-based mingw-w64 for ARM + ucrtAarch64 = { + config = "aarch64-w64-mingw32"; + libc = "ucrt"; + useLLVM = true; + }; + # BSDs x86_64-freebsd = { From 613a1dafd55a909ba53292cde11ca60f2f06dd42 Mon Sep 17 00:00:00 2001 From: seth Date: Fri, 16 Aug 2024 04:35:01 -0400 Subject: [PATCH 3/8] windows.*: format with nixfmt --- .../windows/cygwin-setup/default.nix | 48 ++++++++++--- pkgs/os-specific/windows/default.nix | 70 ++++++++++--------- pkgs/os-specific/windows/dlfcn/default.nix | 7 +- pkgs/os-specific/windows/libgnurx/default.nix | 9 ++- .../windows/mcfgthreads/default.nix | 18 ++--- .../os-specific/windows/mingw-w64/default.nix | 25 ++++--- .../os-specific/windows/mingw-w64/headers.nix | 6 +- pkgs/os-specific/windows/mingwrt/default.nix | 11 ++- .../windows/npiperelay/default.nix | 6 +- .../windows/pthread-w32/default.nix | 11 ++- pkgs/os-specific/windows/w32api/default.nix | 6 +- 11 files changed, 146 insertions(+), 71 deletions(-) diff --git a/pkgs/os-specific/windows/cygwin-setup/default.nix b/pkgs/os-specific/windows/cygwin-setup/default.nix index a88d802c5cf7..9cc920829ecd 100644 --- a/pkgs/os-specific/windows/cygwin-setup/default.nix +++ b/pkgs/os-specific/windows/cygwin-setup/default.nix @@ -1,5 +1,17 @@ -{ lib, stdenv, fetchcvs, autoconf, automake, libtool, flex, bison, pkg-config -, zlib, bzip2, xz, libgcrypt +{ + lib, + stdenv, + fetchcvs, + autoconf, + automake, + libtool, + flex, + bison, + pkg-config, + zlib, + bzip2, + xz, + libgcrypt, }: stdenv.mkDerivation rec { @@ -13,16 +25,30 @@ stdenv.mkDerivation rec { sha256 = "024wxaaxkf7p1i78bh5xrsqmfz7ss2amigbfl2r5w9h87zqn9aq3"; }; - nativeBuildInputs = [ autoconf automake libtool flex bison pkg-config ]; + nativeBuildInputs = [ + autoconf + automake + libtool + flex + bison + pkg-config + ]; - buildInputs = let - mkStatic = lib.flip lib.overrideDerivation (o: { - dontDisableStatic = true; - configureFlags = lib.toList (o.configureFlags or []) ++ [ "--enable-static" ]; - buildInputs = map mkStatic (o.buildInputs or []); - propagatedBuildInputs = map mkStatic (o.propagatedBuildInputs or []); - }); - in map mkStatic [ zlib bzip2 xz libgcrypt ]; + buildInputs = + let + mkStatic = lib.flip lib.overrideDerivation (o: { + dontDisableStatic = true; + configureFlags = lib.toList (o.configureFlags or [ ]) ++ [ "--enable-static" ]; + buildInputs = map mkStatic (o.buildInputs or [ ]); + propagatedBuildInputs = map mkStatic (o.propagatedBuildInputs or [ ]); + }); + in + map mkStatic [ + zlib + bzip2 + xz + libgcrypt + ]; configureFlags = [ "--disable-shared" ]; diff --git a/pkgs/os-specific/windows/default.nix b/pkgs/os-specific/windows/default.nix index 7b9bbcc52f79..59806318a23e 100644 --- a/pkgs/os-specific/windows/default.nix +++ b/pkgs/os-specific/windows/default.nix @@ -1,46 +1,52 @@ -{ lib, stdenv, buildPackages -, newScope, overrideCC, stdenvNoLibc, libcCross +{ + lib, + stdenv, + buildPackages, + newScope, + overrideCC, + stdenvNoLibc, + libcCross, }: -lib.makeScope newScope (self: with self; { +lib.makeScope newScope ( + self: with self; { - cygwinSetup = callPackage ./cygwin-setup { }; + cygwinSetup = callPackage ./cygwin-setup { }; - dlfcn = callPackage ./dlfcn { }; + dlfcn = callPackage ./dlfcn { }; - w32api = callPackage ./w32api { }; + w32api = callPackage ./w32api { }; - mingwrt = callPackage ./mingwrt { }; - mingw_runtime = mingwrt; + mingwrt = callPackage ./mingwrt { }; + mingw_runtime = mingwrt; - mingw_w64 = callPackage ./mingw-w64 { - stdenv = stdenvNoLibc; - }; + mingw_w64 = callPackage ./mingw-w64 { + stdenv = stdenvNoLibc; + }; - # FIXME untested with llvmPackages_16 was using llvmPackages_8 - crossThreadsStdenv = overrideCC stdenvNoLibc - (if stdenv.hostPlatform.useLLVM or false - then buildPackages.llvmPackages.clangNoLibcxx - else buildPackages.gccWithoutTargetLibc.override (old: { - bintools = old.bintools.override { - libc = libcCross; - }; - libc = libcCross; - })); + # FIXME untested with llvmPackages_16 was using llvmPackages_8 + crossThreadsStdenv = overrideCC stdenvNoLibc ( + if stdenv.hostPlatform.useLLVM or false then + buildPackages.llvmPackages.clangNoLibcxx + else + buildPackages.gccWithoutTargetLibc.override (old: { + bintools = old.bintools.override { + libc = libcCross; + }; + libc = libcCross; + }) + ); - mingw_w64_headers = callPackage ./mingw-w64/headers.nix { }; + mingw_w64_headers = callPackage ./mingw-w64/headers.nix { }; - mingw_w64_pthreads = callPackage ./mingw-w64/pthreads.nix { - stdenv = crossThreadsStdenv; - }; + mingw_w64_pthreads = callPackage ./mingw-w64/pthreads.nix { stdenv = crossThreadsStdenv; }; - mcfgthreads = callPackage ./mcfgthreads { - stdenv = crossThreadsStdenv; - }; + mcfgthreads = callPackage ./mcfgthreads { stdenv = crossThreadsStdenv; }; - npiperelay = callPackage ./npiperelay { }; + npiperelay = callPackage ./npiperelay { }; - pthreads = callPackage ./pthread-w32 { }; + pthreads = callPackage ./pthread-w32 { }; - libgnurx = callPackage ./libgnurx { }; -}) + libgnurx = callPackage ./libgnurx { }; + } +) diff --git a/pkgs/os-specific/windows/dlfcn/default.nix b/pkgs/os-specific/windows/dlfcn/default.nix index d1fba98e840a..1f4ea20d550d 100644 --- a/pkgs/os-specific/windows/dlfcn/default.nix +++ b/pkgs/os-specific/windows/dlfcn/default.nix @@ -1,4 +1,9 @@ -{ stdenv, lib, fetchFromGitHub, cmake }: +{ + stdenv, + lib, + fetchFromGitHub, + cmake, +}: stdenv.mkDerivation rec { pname = "dlfcn"; diff --git a/pkgs/os-specific/windows/libgnurx/default.nix b/pkgs/os-specific/windows/libgnurx/default.nix index e760bddabfbf..f3bc160e0cff 100644 --- a/pkgs/os-specific/windows/libgnurx/default.nix +++ b/pkgs/os-specific/windows/libgnurx/default.nix @@ -1,8 +1,13 @@ -{ lib, stdenv, fetchurl }: +{ + lib, + stdenv, + fetchurl, +}: let version = "2.5.1"; -in stdenv.mkDerivation rec { +in +stdenv.mkDerivation rec { pname = "libgnurx"; inherit version; src = fetchurl { diff --git a/pkgs/os-specific/windows/mcfgthreads/default.nix b/pkgs/os-specific/windows/mcfgthreads/default.nix index 9eabaf21e44f..2d5771068dc9 100644 --- a/pkgs/os-specific/windows/mcfgthreads/default.nix +++ b/pkgs/os-specific/windows/mcfgthreads/default.nix @@ -1,7 +1,8 @@ -{ lib -, stdenv -, fetchFromGitHub -, autoreconfHook +{ + lib, + stdenv, + fetchFromGitHub, + autoreconfHook, }: stdenv.mkDerivation rec { @@ -15,12 +16,13 @@ stdenv.mkDerivation rec { hash = "sha256-FrmeaQhwLrNewS0HDlbWgCvVQ5U1l0jrw0YVuQdt9Ck="; }; - outputs = [ "out" "dev" ]; - - nativeBuildInputs = [ - autoreconfHook + outputs = [ + "out" + "dev" ]; + nativeBuildInputs = [ autoreconfHook ]; + meta = { description = "Threading support library for Windows 7 and above"; homepage = "https://github.com/lhmouse/mcfgthread/wiki"; diff --git a/pkgs/os-specific/windows/mingw-w64/default.nix b/pkgs/os-specific/windows/mingw-w64/default.nix index 36cdaf84aab6..ed09a560d42b 100644 --- a/pkgs/os-specific/windows/mingw-w64/default.nix +++ b/pkgs/os-specific/windows/mingw-w64/default.nix @@ -1,26 +1,31 @@ -{ lib -, stdenv -, windows -, autoreconfHook -, mingw_w64_headers +{ + lib, + stdenv, + windows, + autoreconfHook, + mingw_w64_headers, }: stdenv.mkDerivation { pname = "mingw-w64"; inherit (mingw_w64_headers) version src meta; - outputs = [ "out" "dev" ]; + outputs = [ + "out" + "dev" + ]; configureFlags = [ "--enable-idl" "--enable-secure-api" - ] ++ lib.optionals (stdenv.targetPlatform.libc == "ucrt") [ - "--with-default-msvcrt=ucrt" - ]; + ] ++ lib.optionals (stdenv.targetPlatform.libc == "ucrt") [ "--with-default-msvcrt=ucrt" ]; enableParallelBuilding = true; nativeBuildInputs = [ autoreconfHook ]; buildInputs = [ windows.mingw_w64_headers ]; - hardeningDisable = [ "stackprotector" "fortify" ]; + hardeningDisable = [ + "stackprotector" + "fortify" + ]; } diff --git a/pkgs/os-specific/windows/mingw-w64/headers.nix b/pkgs/os-specific/windows/mingw-w64/headers.nix index d5edaeaa2bd1..aec85256545e 100644 --- a/pkgs/os-specific/windows/mingw-w64/headers.nix +++ b/pkgs/os-specific/windows/mingw-w64/headers.nix @@ -1,4 +1,8 @@ -{ lib, stdenvNoCC, fetchurl }: +{ + lib, + stdenvNoCC, + fetchurl, +}: stdenvNoCC.mkDerivation (finalAttrs: { pname = "mingw_w64-headers"; diff --git a/pkgs/os-specific/windows/mingwrt/default.nix b/pkgs/os-specific/windows/mingwrt/default.nix index 5bf6951cd434..7a116bcfeb80 100644 --- a/pkgs/os-specific/windows/mingwrt/default.nix +++ b/pkgs/os-specific/windows/mingwrt/default.nix @@ -1,4 +1,8 @@ -{ stdenv, lib, fetchurl }: +{ + stdenv, + lib, + fetchurl, +}: stdenv.mkDerivation rec { pname = "mingwrt"; @@ -14,5 +18,8 @@ stdenv.mkDerivation rec { }; dontStrip = true; - hardeningDisable = [ "stackprotector" "fortify" ]; + hardeningDisable = [ + "stackprotector" + "fortify" + ]; } diff --git a/pkgs/os-specific/windows/npiperelay/default.nix b/pkgs/os-specific/windows/npiperelay/default.nix index d2347edcbaff..a0c22a8552c5 100644 --- a/pkgs/os-specific/windows/npiperelay/default.nix +++ b/pkgs/os-specific/windows/npiperelay/default.nix @@ -1,4 +1,8 @@ -{ lib, buildGoModule, fetchFromGitHub }: +{ + lib, + buildGoModule, + fetchFromGitHub, +}: buildGoModule rec { pname = "npiperelay"; diff --git a/pkgs/os-specific/windows/pthread-w32/default.nix b/pkgs/os-specific/windows/pthread-w32/default.nix index b17d839554f5..0db99bf4c97d 100644 --- a/pkgs/os-specific/windows/pthread-w32/default.nix +++ b/pkgs/os-specific/windows/pthread-w32/default.nix @@ -1,4 +1,8 @@ -{ lib, stdenv, fetchzip }: +{ + lib, + stdenv, + fetchzip, +}: stdenv.mkDerivation { pname = "pthreads-w32"; @@ -9,7 +13,10 @@ stdenv.mkDerivation { sha256 = "1s8iny7g06z289ahdj0kzaxj0cd3wvjbd8j3bh9xlg7g444lhy9w"; }; - makeFlags = [ "CROSS=${stdenv.cc.targetPrefix}" "GC-static" ]; + makeFlags = [ + "CROSS=${stdenv.cc.targetPrefix}" + "GC-static" + ]; installPhase = '' runHook preInstall diff --git a/pkgs/os-specific/windows/w32api/default.nix b/pkgs/os-specific/windows/w32api/default.nix index 99faeeb7a8bf..e36833852566 100644 --- a/pkgs/os-specific/windows/w32api/default.nix +++ b/pkgs/os-specific/windows/w32api/default.nix @@ -1,4 +1,8 @@ -{ stdenv, fetchurl, lib }: +{ + stdenv, + fetchurl, + lib, +}: stdenv.mkDerivation rec { pname = "w32api"; From 14e440390afe2418b3004afbd6b5ae27ad0db7fd Mon Sep 17 00:00:00 2001 From: seth Date: Fri, 16 Aug 2024 04:36:42 -0400 Subject: [PATCH 4/8] windows.mingw_w64*: 11.0.1 -> 12.0.0 Changelog: https://www.mingw-w64.org/changelog/#v1200-2024-05-29 Only notable change for our purposes is UCRT now being the default, so either it or MSVCRT must be explicitly passed --- pkgs/os-specific/windows/mingw-w64/default.nix | 9 ++++++++- pkgs/os-specific/windows/mingw-w64/headers.nix | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/pkgs/os-specific/windows/mingw-w64/default.nix b/pkgs/os-specific/windows/mingw-w64/default.nix index ed09a560d42b..1d23bab70692 100644 --- a/pkgs/os-specific/windows/mingw-w64/default.nix +++ b/pkgs/os-specific/windows/mingw-w64/default.nix @@ -4,8 +4,14 @@ windows, autoreconfHook, mingw_w64_headers, + crt ? stdenv.hostPlatform.libc, }: +assert lib.assertOneOf "crt" crt [ + "msvcrt" + "ucrt" +]; + stdenv.mkDerivation { pname = "mingw-w64"; inherit (mingw_w64_headers) version src meta; @@ -18,7 +24,8 @@ stdenv.mkDerivation { configureFlags = [ "--enable-idl" "--enable-secure-api" - ] ++ lib.optionals (stdenv.targetPlatform.libc == "ucrt") [ "--with-default-msvcrt=ucrt" ]; + "--with-default-msvcrt=${crt}" + ]; enableParallelBuilding = true; diff --git a/pkgs/os-specific/windows/mingw-w64/headers.nix b/pkgs/os-specific/windows/mingw-w64/headers.nix index aec85256545e..daae7ee0aa42 100644 --- a/pkgs/os-specific/windows/mingw-w64/headers.nix +++ b/pkgs/os-specific/windows/mingw-w64/headers.nix @@ -6,11 +6,11 @@ stdenvNoCC.mkDerivation (finalAttrs: { pname = "mingw_w64-headers"; - version = "11.0.1"; + version = "12.0.0"; src = fetchurl { url = "mirror://sourceforge/mingw-w64/mingw-w64-v${finalAttrs.version}.tar.bz2"; - hash = "sha256-P2a84Gnui+10OaGhPafLkaXmfqYXDyExesf1eUYl7hA="; + hash = "sha256-zEGJiqxLbo3Vz/1zMbnZUVuRLfRCCjphK16ilVu+7S8="; }; preConfigure = '' From 3d51188a761be97ac5e0afd9764f9a0ba213463e Mon Sep 17 00:00:00 2001 From: seth Date: Fri, 16 Aug 2024 04:43:27 -0400 Subject: [PATCH 5/8] windows.mingw_w64*: use lib for autoconf flags --- pkgs/os-specific/windows/mingw-w64/default.nix | 6 +++--- pkgs/os-specific/windows/mingw-w64/pthreads.nix | 15 +++++++++------ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/pkgs/os-specific/windows/mingw-w64/default.nix b/pkgs/os-specific/windows/mingw-w64/default.nix index 1d23bab70692..2d335af051cf 100644 --- a/pkgs/os-specific/windows/mingw-w64/default.nix +++ b/pkgs/os-specific/windows/mingw-w64/default.nix @@ -22,9 +22,9 @@ stdenv.mkDerivation { ]; configureFlags = [ - "--enable-idl" - "--enable-secure-api" - "--with-default-msvcrt=${crt}" + (lib.enableFeature true "idl") + (lib.enableFeature true "secure-api") + (lib.withFeatureAs true "default-msvcrt" crt) ]; enableParallelBuilding = true; diff --git a/pkgs/os-specific/windows/mingw-w64/pthreads.nix b/pkgs/os-specific/windows/mingw-w64/pthreads.nix index 3c5fab4fa708..690bd7ecf662 100644 --- a/pkgs/os-specific/windows/mingw-w64/pthreads.nix +++ b/pkgs/os-specific/windows/mingw-w64/pthreads.nix @@ -1,14 +1,17 @@ -{ stdenv, mingw_w64_headers }: +{ + lib, + stdenv, + mingw_w64_headers, + # Rustc require 'libpthread.a' when targeting 'x86_64-pc-windows-gnu'. + # Enabling this makes it work out of the box instead of failing. + withStatic ? true, +}: stdenv.mkDerivation { pname = "mingw_w64-pthreads"; inherit (mingw_w64_headers) version src meta; - configureFlags = [ - # Rustc require 'libpthread.a' when targeting 'x86_64-pc-windows-gnu'. - # Enabling this makes it work out of the box instead of failing. - "--enable-static" - ]; + configureFlags = [ (lib.enableFeature withStatic "static") ]; preConfigure = '' cd mingw-w64-libraries/winpthreads From b57c78d02648f82bb3ff3ba69ae277a9c4ab5036 Mon Sep 17 00:00:00 2001 From: seth Date: Fri, 16 Aug 2024 04:47:26 -0400 Subject: [PATCH 6/8] windows.mingw_w64: fix building on arm --- pkgs/os-specific/windows/mingw-w64/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/os-specific/windows/mingw-w64/default.nix b/pkgs/os-specific/windows/mingw-w64/default.nix index 2d335af051cf..d8103d7b8d37 100644 --- a/pkgs/os-specific/windows/mingw-w64/default.nix +++ b/pkgs/os-specific/windows/mingw-w64/default.nix @@ -25,6 +25,11 @@ stdenv.mkDerivation { (lib.enableFeature true "idl") (lib.enableFeature true "secure-api") (lib.withFeatureAs true "default-msvcrt" crt) + + # Including other architectures causes errors with invalid asm + (lib.enableFeature stdenv.hostPlatform.isi686 "lib32") + (lib.enableFeature stdenv.hostPlatform.isx86_64 "lib64") + (lib.enableFeature stdenv.hostPlatform.isAarch64 "libarm64") ]; enableParallelBuilding = true; From ad338630ff2b316aa296c1722451e5d8b9b8b151 Mon Sep 17 00:00:00 2001 From: seth Date: Fri, 16 Aug 2024 04:49:37 -0400 Subject: [PATCH 7/8] llvmPackages_18.compiler-rt: fix building on windows --- .../development/compilers/llvm/common/compiler-rt/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/compilers/llvm/common/compiler-rt/default.nix b/pkgs/development/compilers/llvm/common/compiler-rt/default.nix index 9c634650dff2..241fad158c3c 100644 --- a/pkgs/development/compilers/llvm/common/compiler-rt/default.nix +++ b/pkgs/development/compilers/llvm/common/compiler-rt/default.nix @@ -41,8 +41,8 @@ let # use clean up the `cmakeFlags` rats nest below. haveLibcxx = stdenv.cc.libcxx != null; isDarwinStatic = stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isStatic && lib.versionAtLeast release_version "16"; - inherit (stdenv.hostPlatform) isMusl isAarch64; - noSanitizers = !haveLibc || bareMetal || isMusl || isDarwinStatic; + inherit (stdenv.hostPlatform) isMusl isAarch64 isWindows; + noSanitizers = !haveLibc || bareMetal || isMusl || isDarwinStatic || isWindows; baseName = "compiler-rt"; pname = baseName + lib.optionalString (haveLibc) "-libc"; From fb917de147f9db59ca0ec55d69e5ba83f1c1401f Mon Sep 17 00:00:00 2001 From: seth Date: Fri, 16 Aug 2024 04:51:34 -0400 Subject: [PATCH 8/8] llvmPackages_18.libcxx: fix building on windows --- pkgs/development/compilers/llvm/common/libcxx/default.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/development/compilers/llvm/common/libcxx/default.nix b/pkgs/development/compilers/llvm/common/libcxx/default.nix index 17c687f88394..d4b727bd50d2 100644 --- a/pkgs/development/compilers/llvm/common/libcxx/default.nix +++ b/pkgs/development/compilers/llvm/common/libcxx/default.nix @@ -61,7 +61,8 @@ let ]) ++ lib.optionals stdenv.hostPlatform.isWasm [ "-DLIBCXXABI_ENABLE_THREADS=OFF" "-DLIBCXXABI_ENABLE_EXCEPTIONS=OFF" - ] ++ lib.optionals (!enableShared) [ + ] ++ lib.optionals (!enableShared || stdenv.hostPlatform.isWindows) [ + # Required on Windows due to https://github.com/llvm/llvm-project/issues/55245 "-DLIBCXXABI_ENABLE_SHARED=OFF" ]; @@ -91,6 +92,9 @@ let "-DLIBCXX_ENABLE_THREADS=OFF" "-DLIBCXX_ENABLE_FILESYSTEM=OFF" "-DLIBCXX_ENABLE_EXCEPTIONS=OFF" + ] ++ lib.optionals stdenv.hostPlatform.isWindows [ + # https://github.com/llvm/llvm-project/issues/55245 + "-DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON" ] ++ lib.optionals (!enableShared) [ "-DLIBCXX_ENABLE_SHARED=OFF" ] ++ lib.optionals (cxxabi != null && cxxabi.libName == "cxxrt") [