From 890d0576c5f68852cd3d6ca81c5428122c620560 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sun, 6 Nov 2022 19:53:50 +0100 Subject: [PATCH] cross/mingw: make threading library configureable --- pkgs/development/compilers/gcc/10/default.nix | 8 ++--- pkgs/development/compilers/gcc/11/default.nix | 8 ++--- pkgs/development/compilers/gcc/12/default.nix | 8 ++--- .../development/compilers/gcc/4.8/default.nix | 6 ++-- .../development/compilers/gcc/4.9/default.nix | 6 ++-- pkgs/development/compilers/gcc/6/default.nix | 8 ++--- pkgs/development/compilers/gcc/7/default.nix | 8 ++--- pkgs/development/compilers/gcc/8/default.nix | 9 +++--- pkgs/development/compilers/gcc/9/default.nix | 8 ++--- .../compilers/gcc/common/configure-flags.nix | 3 +- .../gcc/common/extra-target-flags.nix | 4 +-- pkgs/development/compilers/go/1.18.nix | 2 +- pkgs/development/compilers/go/1.19.nix | 2 +- pkgs/top-level/all-packages.nix | 31 ++++++++++--------- 14 files changed, 57 insertions(+), 54 deletions(-) diff --git a/pkgs/development/compilers/gcc/10/default.nix b/pkgs/development/compilers/gcc/10/default.nix index 207860b90c0e..e4cebab266e8 100644 --- a/pkgs/development/compilers/gcc/10/default.nix +++ b/pkgs/development/compilers/gcc/10/default.nix @@ -37,7 +37,7 @@ assert langGo -> langCC; assert langAda -> gnatboot != null; # threadsCross is just for MinGW -assert threadsCross != null -> stdenv.targetPlatform.isWindows; +assert threadsCross != {} -> stdenv.targetPlatform.isWindows; # profiledCompiler builds inject non-determinism in one of the compilation stages. # If turned on, we can't provide reproducible builds anymore @@ -65,7 +65,7 @@ let majorVersion = "10"; ++ optional (targetPlatform.libc == "musl" && targetPlatform.isPower) ../ppc-musl.patch # Obtain latest patch with ../update-mcfgthread-patches.sh - ++ optional (!crossStageStatic && targetPlatform.isMinGW) ./Added-mcf-thread-model-support-from-mcfgthread.patch + ++ optional (!crossStageStatic && targetPlatform.isMinGW && threadsCross.model == "mcf") ./Added-mcf-thread-model-support-from-mcfgthread.patch ++ optional (buildPlatform.system == "aarch64-darwin" && targetPlatform != buildPlatform) (fetchpatch { url = "https://raw.githubusercontent.com/richard-vd/musl-cross-make/5e9e87f06fc3220e102c29d3413fbbffa456fcd6/patches/gcc-${version}/0008-darwin-aarch64-self-host-driver.patch"; @@ -179,7 +179,7 @@ stdenv.mkDerivation ({ ++ (optional (zlib != null) zlib) ; - depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross; + depsTargetTarget = optional (!crossStageStatic && threadsCross != {} && threadsCross.package != null) threadsCross.package; NIX_LDFLAGS = lib.optionalString hostPlatform.isSunOS "-lm -ldl"; @@ -199,7 +199,7 @@ stdenv.mkDerivation ({ lib stdenv targetPackages - crossStageStatic libcCross + crossStageStatic libcCross threadsCross version gmp mpfr libmpc isl diff --git a/pkgs/development/compilers/gcc/11/default.nix b/pkgs/development/compilers/gcc/11/default.nix index 3b03e185dd86..220339c29595 100644 --- a/pkgs/development/compilers/gcc/11/default.nix +++ b/pkgs/development/compilers/gcc/11/default.nix @@ -37,7 +37,7 @@ assert langGo -> langCC; assert langAda -> gnatboot != null; # threadsCross is just for MinGW -assert threadsCross != null -> stdenv.targetPlatform.isWindows; +assert threadsCross != {} -> stdenv.targetPlatform.isWindows; # profiledCompiler builds inject non-determinism in one of the compilation stages. # If turned on, we can't provide reproducible builds anymore @@ -76,7 +76,7 @@ let majorVersion = "11"; }) # Obtain latest patch with ../update-mcfgthread-patches.sh - ++ optional (!crossStageStatic && targetPlatform.isMinGW) ./Added-mcf-thread-model-support-from-mcfgthread.patch; + ++ optional (!crossStageStatic && targetPlatform.isMinGW && threadsCross.model == "mcf") ./Added-mcf-thread-model-support-from-mcfgthread.patch; /* Cross-gcc settings (build == host != target) */ crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; @@ -187,7 +187,7 @@ stdenv.mkDerivation ({ ++ (optional (zlib != null) zlib) ; - depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross; + depsTargetTarget = optional (!crossStageStatic && threadsCross != {} && threadsCross.package != null) threadsCross.package; NIX_LDFLAGS = lib.optionalString hostPlatform.isSunOS "-lm -ldl"; @@ -207,7 +207,7 @@ stdenv.mkDerivation ({ lib stdenv targetPackages - crossStageStatic libcCross + crossStageStatic libcCross threadsCross version gmp mpfr libmpc isl diff --git a/pkgs/development/compilers/gcc/12/default.nix b/pkgs/development/compilers/gcc/12/default.nix index c7fcd5475ade..78c7a12027ce 100644 --- a/pkgs/development/compilers/gcc/12/default.nix +++ b/pkgs/development/compilers/gcc/12/default.nix @@ -41,7 +41,7 @@ assert langAda -> gnatboot != null; assert !langD; # threadsCross is just for MinGW -assert threadsCross != null -> stdenv.targetPlatform.isWindows; +assert threadsCross != {} -> stdenv.targetPlatform.isWindows; # profiledCompiler builds inject non-determinism in one of the compilation stages. # If turned on, we can't provide reproducible builds anymore @@ -71,7 +71,7 @@ let majorVersion = "12"; ++ optional langD ../libphobos.patch # Obtain latest patch with ../update-mcfgthread-patches.sh - ++ optional (!crossStageStatic && targetPlatform.isMinGW) ./Added-mcf-thread-model-support-from-mcfgthread.patch; + ++ optional (!crossStageStatic && targetPlatform.isMinGW && threadsCross.model == "mcf") ./Added-mcf-thread-model-support-from-mcfgthread.patch; /* Cross-gcc settings (build == host != target) */ crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; @@ -180,7 +180,7 @@ stdenv.mkDerivation ({ ++ (optional (zlib != null) zlib) ; - depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross; + depsTargetTarget = optional (!crossStageStatic && threadsCross != {}) threadsCross.package; NIX_LDFLAGS = lib.optionalString hostPlatform.isSunOS "-lm -ldl"; @@ -201,7 +201,7 @@ stdenv.mkDerivation ({ lib stdenv targetPackages - crossStageStatic libcCross + crossStageStatic libcCross threadsCross version gmp mpfr libmpc isl diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix index 0bd2e5e1b91e..ba084af53ee5 100644 --- a/pkgs/development/compilers/gcc/4.8/default.nix +++ b/pkgs/development/compilers/gcc/4.8/default.nix @@ -45,7 +45,7 @@ assert stdenv.buildPlatform.isDarwin -> gnused != null; assert langGo -> langCC; # threadsCross is just for MinGW -assert threadsCross != null -> stdenv.targetPlatform.isWindows; +assert threadsCross != {} -> stdenv.targetPlatform.isWindows; # profiledCompiler builds inject non-determinism in one of the compilation stages. # If turned on, we can't provide reproducible builds anymore @@ -188,7 +188,7 @@ stdenv.mkDerivation ({ ++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs)) ; - depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross; + depsTargetTarget = optional (!crossStageStatic && threadsCross != {}) threadsCross; preConfigure = import ../common/pre-configure.nix { inherit lib; @@ -204,7 +204,7 @@ stdenv.mkDerivation ({ lib stdenv targetPackages - crossStageStatic libcCross + crossStageStatic libcCross threadsCross version gmp mpfr libmpc isl diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix index 9a977392aeb3..516cdee708d3 100644 --- a/pkgs/development/compilers/gcc/4.9/default.nix +++ b/pkgs/development/compilers/gcc/4.9/default.nix @@ -45,7 +45,7 @@ assert stdenv.buildPlatform.isDarwin -> gnused != null; assert langGo -> langCC; # threadsCross is just for MinGW -assert threadsCross != null -> stdenv.targetPlatform.isWindows; +assert threadsCross != {} -> stdenv.targetPlatform.isWindows; # profiledCompiler builds inject non-determinism in one of the compilation stages. # If turned on, we can't provide reproducible builds anymore @@ -208,7 +208,7 @@ stdenv.mkDerivation ({ ++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs)) ; - depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross; + depsTargetTarget = optional (!crossStageStatic && threadsCross != {}) threadsCross; preConfigure = import ../common/pre-configure.nix { inherit lib; @@ -224,7 +224,7 @@ stdenv.mkDerivation ({ lib stdenv targetPackages - crossStageStatic libcCross + crossStageStatic libcCross threadsCross version gmp mpfr libmpc isl diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix index 8c28e9b4b466..8bd9d41f1eae 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -48,7 +48,7 @@ assert langGo -> langCC; assert langAda -> gnatboot != null; # threadsCross is just for MinGW -assert threadsCross != null -> stdenv.targetPlatform.isWindows; +assert threadsCross != {} -> stdenv.targetPlatform.isWindows; # profiledCompiler builds inject non-determinism in one of the compilation stages. # If turned on, we can't provide reproducible builds anymore @@ -72,7 +72,7 @@ let majorVersion = "6"; ++ optional (targetPlatform.libc == "musl") ../libgomp-dont-force-initial-exec.patch # Obtain latest patch with ../update-mcfgthread-patches.sh - ++ optional (!crossStageStatic && targetPlatform.isMinGW) ./Added-mcf-thread-model-support-from-mcfgthread.patch + ++ optional (!crossStageStatic && targetPlatform.isMinGW && threadsCross.model == "mcf") ./Added-mcf-thread-model-support-from-mcfgthread.patch ++ optional (targetPlatform.libc == "musl" && targetPlatform.isx86_32) (fetchpatch { url = "https://git.alpinelinux.org/aports/plain/main/gcc/gcc-6.1-musl-libssp.patch?id=5e4b96e23871ee28ef593b439f8c07ca7c7eb5bb"; sha256 = "1jf1ciz4gr49lwyh8knfhw6l5gvfkwzjy90m7qiwkcbsf4a3fqn2"; @@ -217,7 +217,7 @@ stdenv.mkDerivation ({ ++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs)) ; - depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross; + depsTargetTarget = optional (!crossStageStatic && threadsCross != {}) threadsCross.package; NIX_LDFLAGS = lib.optionalString hostPlatform.isSunOS "-lm -ldl"; @@ -235,7 +235,7 @@ stdenv.mkDerivation ({ lib stdenv targetPackages - crossStageStatic libcCross + crossStageStatic libcCross threadsCross version gmp mpfr libmpc isl diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix index 4097d6999d7a..637be9fd971c 100644 --- a/pkgs/development/compilers/gcc/7/default.nix +++ b/pkgs/development/compilers/gcc/7/default.nix @@ -32,7 +32,7 @@ assert stdenv.buildPlatform.isDarwin -> gnused != null; assert langGo -> langCC; # threadsCross is just for MinGW -assert threadsCross != null -> stdenv.targetPlatform.isWindows; +assert threadsCross != {} -> stdenv.targetPlatform.isWindows; # profiledCompiler builds inject non-determinism in one of the compilation stages. # If turned on, we can't provide reproducible builds anymore @@ -75,7 +75,7 @@ let majorVersion = "7"; ++ optional (targetPlatform.libc == "musl") ../libgomp-dont-force-initial-exec.patch # Obtain latest patch with ../update-mcfgthread-patches.sh - ++ optional (!crossStageStatic && targetPlatform.isMinGW) ./Added-mcf-thread-model-support-from-mcfgthread.patch + ++ optional (!crossStageStatic && targetPlatform.isMinGW && threadsCross.model == "mcf") ./Added-mcf-thread-model-support-from-mcfgthread.patch ++ [ ../libsanitizer-no-cyclades-9.patch ]; @@ -184,7 +184,7 @@ stdenv.mkDerivation ({ ++ (optional (zlib != null) zlib) ; - depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross; + depsTargetTarget = optional (!crossStageStatic && threadsCross != {}) threadsCross.package; NIX_CFLAGS_COMPILE = lib.optionalString (stdenv.cc.isClang && langFortran) "-Wno-unused-command-line-argument"; NIX_LDFLAGS = lib.optionalString hostPlatform.isSunOS "-lm -ldl"; @@ -203,7 +203,7 @@ stdenv.mkDerivation ({ lib stdenv targetPackages - crossStageStatic libcCross + crossStageStatic libcCross threadsCross version gmp mpfr libmpc isl diff --git a/pkgs/development/compilers/gcc/8/default.nix b/pkgs/development/compilers/gcc/8/default.nix index 26591000fd8e..4eb47d00c5c2 100644 --- a/pkgs/development/compilers/gcc/8/default.nix +++ b/pkgs/development/compilers/gcc/8/default.nix @@ -32,7 +32,7 @@ assert stdenv.buildPlatform.isDarwin -> gnused != null; assert langGo -> langCC; # threadsCross is just for MinGW -assert threadsCross != null -> stdenv.targetPlatform.isWindows; +assert threadsCross != {} -> stdenv.targetPlatform.isWindows; # profiledCompiler builds inject non-determinism in one of the compilation stages. # If turned on, we can't provide reproducible builds anymore @@ -59,8 +59,7 @@ let majorVersion = "8"; ++ optional (targetPlatform.libc == "musl") ../libgomp-dont-force-initial-exec.patch # Obtain latest patch with ../update-mcfgthread-patches.sh - ++ optional (!crossStageStatic && targetPlatform.isMinGW) ./Added-mcf-thread-model-support-from-mcfgthread.patch - + ++ optional (!crossStageStatic && targetPlatform.isMinGW && threadsCross.model == "mcf") ./Added-mcf-thread-model-support-from-mcfgthread.patch ++ [ ../libsanitizer-no-cyclades-9.patch ]; /* Cross-gcc settings (build == host != target) */ @@ -168,7 +167,7 @@ stdenv.mkDerivation ({ ++ (optional (zlib != null) zlib) ; - depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross; + depsTargetTarget = optional (!crossStageStatic && threadsCross != {}) threadsCross.package; NIX_LDFLAGS = lib.optionalString hostPlatform.isSunOS "-lm -ldl"; @@ -186,7 +185,7 @@ stdenv.mkDerivation ({ lib stdenv targetPackages - crossStageStatic libcCross + crossStageStatic libcCross threadsCross version gmp mpfr libmpc isl diff --git a/pkgs/development/compilers/gcc/9/default.nix b/pkgs/development/compilers/gcc/9/default.nix index b970785d38ef..4c49cdaa3e25 100644 --- a/pkgs/development/compilers/gcc/9/default.nix +++ b/pkgs/development/compilers/gcc/9/default.nix @@ -41,7 +41,7 @@ assert langGo -> langCC; assert langAda -> gnatboot != null; # threadsCross is just for MinGW -assert threadsCross != null -> stdenv.targetPlatform.isWindows; +assert threadsCross != {} -> stdenv.targetPlatform.isWindows; # profiledCompiler builds inject non-determinism in one of the compilation stages. # If turned on, we can't provide reproducible builds anymore @@ -71,7 +71,7 @@ let majorVersion = "9"; ++ optional (targetPlatform.libc == "musl" && targetPlatform.isPower) ../ppc-musl.patch # Obtain latest patch with ../update-mcfgthread-patches.sh - ++ optional (!crossStageStatic && targetPlatform.isMinGW) ./Added-mcf-thread-model-support-from-mcfgthread.patch + ++ optional (!crossStageStatic && targetPlatform.isMinGW && threadsCross.model == "mcf") ./Added-mcf-thread-model-support-from-mcfgthread.patch ; /* Cross-gcc settings (build == host != target) */ @@ -180,7 +180,7 @@ stdenv.mkDerivation ({ ++ (optional (zlib != null) zlib) ; - depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross; + depsTargetTarget = optional (!crossStageStatic && threadsCross != {}) threadsCross.package; NIX_LDFLAGS = lib.optionalString hostPlatform.isSunOS "-lm -ldl"; @@ -198,7 +198,7 @@ stdenv.mkDerivation ({ lib stdenv targetPackages - crossStageStatic libcCross + crossStageStatic libcCross threadsCross version gmp mpfr libmpc isl diff --git a/pkgs/development/compilers/gcc/common/configure-flags.nix b/pkgs/development/compilers/gcc/common/configure-flags.nix index 09533163cbfe..8e444d54bf39 100644 --- a/pkgs/development/compilers/gcc/common/configure-flags.nix +++ b/pkgs/development/compilers/gcc/common/configure-flags.nix @@ -2,6 +2,7 @@ , targetPackages , crossStageStatic, libcCross +, threadsCross , version , gmp, mpfr, libmpc, isl @@ -86,7 +87,7 @@ let "--enable-__cxa_atexit" "--enable-long-long" "--enable-threads=${if targetPlatform.isUnix then "posix" - else if targetPlatform.isWindows then "mcf" + else if targetPlatform.isWindows then (threadsCross.model or "win32") else "single"}" "--enable-nls" ] ++ lib.optionals (targetPlatform.libc == "uclibc" || targetPlatform.libc == "musl") [ diff --git a/pkgs/development/compilers/gcc/common/extra-target-flags.nix b/pkgs/development/compilers/gcc/common/extra-target-flags.nix index ad4ab6bcb4bd..4dedd333b002 100644 --- a/pkgs/development/compilers/gcc/common/extra-target-flags.nix +++ b/pkgs/development/compilers/gcc/common/extra-target-flags.nix @@ -15,7 +15,7 @@ in "-B${lib.getLib dep}${dep.libdir or "/lib"}" ]); in mkFlags libcCross langD - ++ lib.optionals (!crossStageStatic) (mkFlags threadsCross langD) + ++ lib.optionals (!crossStageStatic) (mkFlags (threadsCross.package or null) langD) ; EXTRA_LDFLAGS_FOR_TARGET = let @@ -28,6 +28,6 @@ in "-Wl,-rpath-link,${lib.getLib dep}${dep.libdir or "/lib"}" ])); in mkFlags libcCross - ++ lib.optionals (!crossStageStatic) (mkFlags threadsCross) + ++ lib.optionals (!crossStageStatic) (mkFlags (threadsCross.package or null)) ; } diff --git a/pkgs/development/compilers/go/1.18.nix b/pkgs/development/compilers/go/1.18.nix index 07a590f38845..7f6e2ce6ace8 100644 --- a/pkgs/development/compilers/go/1.18.nix +++ b/pkgs/development/compilers/go/1.18.nix @@ -61,7 +61,7 @@ stdenv.mkDerivation rec { depsBuildTarget = lib.optional isCross targetCC; - depsTargetTarget = lib.optional stdenv.targetPlatform.isWindows threadsCross; + depsTargetTarget = lib.optional stdenv.targetPlatform.isWindows threadsCross.package; postPatch = '' patchShebangs . diff --git a/pkgs/development/compilers/go/1.19.nix b/pkgs/development/compilers/go/1.19.nix index 0d977ec3af3a..a406b21458dc 100644 --- a/pkgs/development/compilers/go/1.19.nix +++ b/pkgs/development/compilers/go/1.19.nix @@ -61,7 +61,7 @@ stdenv.mkDerivation rec { depsBuildTarget = lib.optional isCross targetCC; - depsTargetTarget = lib.optional stdenv.targetPlatform.isWindows threadsCross; + depsTargetTarget = lib.optional stdenv.targetPlatform.isWindows threadsCross.package; postPatch = '' patchShebangs . diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8fe5c03a38c8..d6220b12f68d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -13856,7 +13856,7 @@ with pkgs; profiledCompiler = false; libcCross = if stdenv.targetPlatform != stdenv.buildPlatform then libcCross else null; - threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross else null; + threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross else {}; isl = if !stdenv.isDarwin then isl_0_14 else null; cloog = if !stdenv.isDarwin then cloog else null; @@ -13870,7 +13870,7 @@ with pkgs; profiledCompiler = false; libcCross = if stdenv.targetPlatform != stdenv.buildPlatform then libcCross else null; - threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross else null; + threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross else {}; isl = if !stdenv.isDarwin then isl_0_11 else null; @@ -13887,7 +13887,7 @@ with pkgs; profiledCompiler = false; libcCross = if stdenv.targetPlatform != stdenv.buildPlatform then libcCross else null; - threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross else null; + threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross else {}; # gcc 10 is too strict to cross compile gcc <= 8 stdenv = if (stdenv.targetPlatform != stdenv.buildPlatform) && stdenv.cc.isGNU then gcc7Stdenv else stdenv; @@ -13906,7 +13906,7 @@ with pkgs; profiledCompiler = false; libcCross = if stdenv.targetPlatform != stdenv.buildPlatform then libcCross else null; - threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross else null; + threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross else {}; # gcc 10 is too strict to cross compile gcc <= 8 stdenv = if (stdenv.targetPlatform != stdenv.buildPlatform) && stdenv.cc.isGNU then gcc7Stdenv else stdenv; @@ -13921,7 +13921,7 @@ with pkgs; profiledCompiler = false; libcCross = if stdenv.targetPlatform != stdenv.buildPlatform then libcCross else null; - threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross else null; + threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross else {}; # gcc 10 is too strict to cross compile gcc <= 8 stdenv = if (stdenv.targetPlatform != stdenv.buildPlatform) && stdenv.cc.isGNU then gcc7Stdenv else stdenv; @@ -13936,7 +13936,7 @@ with pkgs; profiledCompiler = false; libcCross = if stdenv.targetPlatform != stdenv.buildPlatform then libcCross else null; - threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross else null; + threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross else {}; isl = if !stdenv.isDarwin then isl_0_20 else null; })); @@ -13948,7 +13948,7 @@ with pkgs; profiledCompiler = false; libcCross = if stdenv.targetPlatform != stdenv.buildPlatform then libcCross else null; - threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross else null; + threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross else {}; isl = if !stdenv.isDarwin then isl_0_20 else null; })); @@ -13960,7 +13960,7 @@ with pkgs; profiledCompiler = false; libcCross = if stdenv.targetPlatform != stdenv.buildPlatform then libcCross else null; - threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross else null; + threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross else {}; isl = if !stdenv.isDarwin then isl_0_20 else null; })); @@ -13972,7 +13972,7 @@ with pkgs; profiledCompiler = false; libcCross = if stdenv.targetPlatform != stdenv.buildPlatform then libcCross else null; - threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross else null; + threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross else {}; isl = if !stdenv.isDarwin then isl_0_20 else null; })); @@ -15413,7 +15413,7 @@ with pkgs; # want the C++ library to be explicitly chosen by the caller, and null by # default. libcxx ? null - , extraPackages ? lib.optional (cc.isGNU or false && stdenv.targetPlatform.isMinGW) threadsCross + , extraPackages ? lib.optional (cc.isGNU or false && stdenv.targetPlatform.isMinGW) threadsCross.package , nixSupport ? {} , ... } @ extraArgs: @@ -19140,10 +19140,13 @@ with pkgs; libcCross = assert stdenv.targetPlatform != stdenv.buildPlatform; libcCrossChooser stdenv.targetPlatform.libc; - threadsCross = - if stdenv.targetPlatform.isMinGW && !(stdenv.targetPlatform.useLLVM or false) - then targetPackages.windows.mcfgthreads or windows.mcfgthreads - else null; + threadsCross = if stdenv.targetPlatform.isMinGW && !(stdenv.targetPlatform.useLLVM or false) + then { + # other possible values: win32 or posix + model = "mcf"; + # For win32 or posix set this to null + package = targetPackages.windows.mcfgthreads or windows.mcfgthreads; + } else {}; wasilibc = callPackage ../development/libraries/wasilibc { stdenv = crossLibcStdenv;