git.iko.soy/typeable/nixpkgs
on master help sign in
gcc: Build MinGW stage two with threading library

Currently this is set up to be mcfgthreads, but it could be something else instead.

commit04cb05d20c780f0cbe76eca6dfc2f08e741a1660 authorJohn Ericson <git@JohnEricson.me> dateMon 11 Nov 2019, 00:23 (7 years ago) parent999ef20
13 files changed+130−28
pkgs/development/compilers/gcc/4.8/default.nix+9−2 pkgs/development/compilers/gcc/4.9/default.nix+9−2 pkgs/development/compilers/gcc/5/default.nix+13−2 pkgs/development/compilers/gcc/6/default.nix+14−4 pkgs/development/compilers/gcc/7/default.nix+14−3 pkgs/development/compilers/gcc/8/default.nix+15−4 pkgs/development/compilers/gcc/9/default.nix+15−4 pkgs/development/compilers/gcc/common/configure-flags.nix+1−1 pkgs/development/compilers/gcc/common/extra-target-flags.nix+3−1 pkgs/development/compilers/gcc/common/mfcgthreads-patches-repo.nix+1 pkgs/development/compilers/gcc/snapshot/default.nix+15−4 pkgs/os-specific/windows/mcfgthreads/default.nix+5 pkgs/top-level/all-packages.nix+16−1
pkgs/development/compilers/gcc/4.8/default.nix+9−2
@@ -23,6 +23,7 @@
2323, enablePlugin ? stdenv.hostPlatform == stdenv.buildPlatform # Whether to support user-supplied plug-ins
2424, name ? "gcc"
2525, libcCross ? null
26+, threadsCross ? null # for MinGW
2627, crossStageStatic ? false
2728, # Strip kills static libs of other archs (hence no cross)
2829 stripped ? stdenv.hostPlatform == stdenv.buildPlatform
@@ -47,10 +48,14 @@ assert stdenv.hostPlatform.isDarwin -> gnused != null;
4748# The go frontend is written in c++
4849assert langGo -> langCC;
4950
51+# threadsCross is just for MinGW
52+assert threadsCross != null -> stdenv.targetPlatform.isWindows;
53+
5054with stdenv.lib;
5155with builtins;
5256
53−let version = "4.8.5";
57+let majorVersion = "4";
58+ version = "${majorVersion}.8.5";
5459
5560 inherit (stdenv) buildPlatform hostPlatform targetPlatform;
5661
@@ -171,6 +176,8 @@ stdenv.mkDerivation ({
171176 ++ (optional hostPlatform.isDarwin gnused)
172177 ;
173178
179+ depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross;
180+
174181 preConfigure = import ../common/pre-configure.nix {
175182 inherit (stdenv) lib;
176183 inherit version hostPlatform langJava langGo;
@@ -253,7 +260,7 @@ stdenv.mkDerivation ({
253260
254261 inherit
255262 (import ../common/extra-target-flags.nix {
256− inherit stdenv crossStageStatic libcCross;
263+ inherit stdenv crossStageStatic libcCross threadsCross;
257264 })
258265 EXTRA_TARGET_FLAGS
259266 EXTRA_TARGET_LDFLAGS
pkgs/development/compilers/gcc/4.9/default.nix+9−2
@@ -23,6 +23,7 @@
2323, enablePlugin ? stdenv.hostPlatform == stdenv.buildPlatform # Whether to support user-supplied plug-ins
2424, name ? "gcc"
2525, libcCross ? null
26+, threadsCross ? null # for MinGW
2627, crossStageStatic ? false
2728, # Strip kills static libs of other archs (hence no cross)
2829 stripped ? stdenv.hostPlatform == stdenv.buildPlatform
@@ -47,10 +48,14 @@ assert stdenv.hostPlatform.isDarwin -> gnused != null;
4748# The go frontend is written in c++
4849assert langGo -> langCC;
4950
51+# threadsCross is just for MinGW
52+assert threadsCross != null -> stdenv.targetPlatform.isWindows;
53+
5054with stdenv.lib;
5155with builtins;
5256
53−let version = "4.9.4";
57+let majorVersion = "4";
58+ version = "${majorVersion}.9.4";
5459
5560 inherit (stdenv) buildPlatform hostPlatform targetPlatform;
5661
@@ -177,6 +182,8 @@ stdenv.mkDerivation ({
177182 ++ (optional hostPlatform.isDarwin gnused)
178183 ;
179184
185+ depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross;
186+
180187 preConfigure = import ../common/pre-configure.nix {
181188 inherit (stdenv) lib;
182189 inherit version hostPlatform langJava langGo;
@@ -259,7 +266,7 @@ stdenv.mkDerivation ({
259266
260267 inherit
261268 (import ../common/extra-target-flags.nix {
262− inherit stdenv crossStageStatic libcCross;
269+ inherit stdenv crossStageStatic libcCross threadsCross;
263270 })
264271 EXTRA_TARGET_FLAGS
265272 EXTRA_TARGET_LDFLAGS
pkgs/development/compilers/gcc/5/default.nix+13−2
@@ -23,6 +23,7 @@
2323, enablePlugin ? stdenv.hostPlatform == stdenv.buildPlatform # Whether to support user-supplied plug-ins
2424, name ? "gcc"
2525, libcCross ? null
26+, threadsCross ? null # for MinGW
2627, crossStageStatic ? false
2728, # Strip kills static libs of other archs (hence no cross)
2829 stripped ? stdenv.hostPlatform == stdenv.buildPlatform
@@ -45,10 +46,14 @@ assert stdenv.hostPlatform.isDarwin -> gnused != null;
4546# The go frontend is written in c++
4647assert langGo -> langCC;
4748
49+# threadsCross is just for MinGW
50+assert threadsCross != null -> stdenv.targetPlatform.isWindows;
51+
4852with stdenv.lib;
4953with builtins;
5054
51−let version = "5.5.0";
55+let majorVersion = "5";
56+ version = "${majorVersion}.5.0";
5257
5358 inherit (stdenv) buildPlatform hostPlatform targetPlatform;
5459
@@ -61,6 +66,10 @@ let version = "5.5.0";
6166 ++ optional stdenv.hostPlatform.isMusl (fetchpatch {
6267 url = https://raw.githubusercontent.com/richfelker/musl-cross-make/e84b1bd1fc12a3def33111ca6df522cd6e5ec361/patches/gcc-5.3.0/0001-musl.diff;
6368 sha256 = "0pppbf8myi2kjhm3z3479ihn1cm60kycfv60gj8yy1bs0pl1qcfm";
69+ })
70+ ++ optional (!crossStageStatic && targetPlatform.isMinGW) (fetchpatch {
71+ url = "https://raw.githubusercontent.com/lhmouse/MINGW-packages/${import ../common/mfcgthreads-patches-repo.nix}/mingw-w64-gcc-git/9000-gcc-${majorVersion}-branch-Added-mcf-thread-model-support-from-mcfgthread.patch";
72+ sha256 = "074bl5n27d1ksa31pvzj4vd8xd46r118k0w94gdv3s1vydg7mah0";
6473 });
6574
6675 javaEcj = fetchurl {
@@ -183,6 +192,8 @@ stdenv.mkDerivation ({
183192 ++ (optional hostPlatform.isDarwin gnused)
184193 ;
185194
195+ depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross;
196+
186197 NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl";
187198
188199 preConfigure = import ../common/pre-configure.nix {
@@ -266,7 +277,7 @@ stdenv.mkDerivation ({
266277
267278 inherit
268279 (import ../common/extra-target-flags.nix {
269− inherit stdenv crossStageStatic libcCross;
280+ inherit stdenv crossStageStatic libcCross threadsCross;
270281 })
271282 EXTRA_TARGET_FLAGS
272283 EXTRA_TARGET_LDFLAGS
pkgs/development/compilers/gcc/6/default.nix+14−4
@@ -1,4 +1,4 @@
1−{ stdenv, targetPackages, fetchurl, noSysDirs
1+{ stdenv, targetPackages, fetchurl, fetchpatch, noSysDirs
22, langC ? true, langCC ? true, langFortran ? false
33, langObjC ? stdenv.targetPlatform.isDarwin
44, langObjCpp ? stdenv.targetPlatform.isDarwin
@@ -23,6 +23,7 @@
2323, enablePlugin ? stdenv.hostPlatform == stdenv.buildPlatform # Whether to support user-supplied plug-ins
2424, name ? "gcc"
2525, libcCross ? null
26+, threadsCross ? null # for MinGW
2627, crossStageStatic ? false
2728, # Strip kills static libs of other archs (hence no cross)
2829 stripped ? stdenv.hostPlatform == stdenv.buildPlatform
@@ -45,10 +46,14 @@ assert stdenv.hostPlatform.isDarwin -> gnused != null;
4546# The go frontend is written in c++
4647assert langGo -> langCC;
4748
49+# threadsCross is just for MinGW
50+assert threadsCross != null -> stdenv.targetPlatform.isWindows;
51+
4852with stdenv.lib;
4953with builtins;
5054
51−let version = "6.5.0";
55+let majorVersion = "6";
56+ version = "${majorVersion}.5.0";
5257
5358 inherit (stdenv) buildPlatform hostPlatform targetPlatform;
5459
@@ -58,7 +63,10 @@ let version = "6.5.0";
5863 ++ optional noSysDirs ../no-sys-dirs.patch
5964 ++ optional langFortran ../gfortran-driving.patch
6065 ++ optional (targetPlatform.libc == "musl") ../libgomp-dont-force-initial-exec.patch
61− ;
66+ ++ optional (!crossStageStatic && targetPlatform.isMinGW) (fetchpatch {
67+ url = "https://raw.githubusercontent.com/lhmouse/MINGW-packages/${import ../common/mfcgthreads-patches-repo.nix}/mingw-w64-gcc-git/9000-gcc-${majorVersion}-branch-Added-mcf-thread-model-support-from-mcfgthread.patch";
68+ sha256 = "1c449jgm1vx9g4kv82bxmvlgrwb8f6kwkl0gqmjlmhf7f4hjy2nr";
69+ });
6270
6371 javaEcj = fetchurl {
6472 # The `$(top_srcdir)/ecj.jar' file is automatically picked up at
@@ -185,6 +193,8 @@ stdenv.mkDerivation ({
185193 ++ (optional hostPlatform.isDarwin gnused)
186194 ;
187195
196+ depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross;
197+
188198 NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl";
189199
190200 preConfigure = import ../common/pre-configure.nix {
@@ -268,7 +278,7 @@ stdenv.mkDerivation ({
268278
269279 inherit
270280 (import ../common/extra-target-flags.nix {
271− inherit stdenv crossStageStatic libcCross;
281+ inherit stdenv crossStageStatic libcCross threadsCross;
272282 })
273283 EXTRA_TARGET_FLAGS
274284 EXTRA_TARGET_LDFLAGS
pkgs/development/compilers/gcc/7/default.nix+14−3
@@ -16,6 +16,7 @@
1616, enablePlugin ? stdenv.hostPlatform == stdenv.buildPlatform # Whether to support user-supplied plug-ins
1717, name ? "gcc"
1818, libcCross ? null
19+, threadsCross ? null # for MinGW
1920, crossStageStatic ? false
2021, # Strip kills static libs of other archs (hence no cross)
2122 stripped ? stdenv.hostPlatform == stdenv.buildPlatform
@@ -34,10 +35,14 @@ assert stdenv.hostPlatform.isDarwin -> gnused != null;
3435# The go frontend is written in c++
3536assert langGo -> langCC;
3637
38+# threadsCross is just for MinGW
39+assert threadsCross != null -> stdenv.targetPlatform.isWindows;
40+
3741with stdenv.lib;
3842with builtins;
3943
40−let version = "7.4.0";
44+let majorVersion = "7";
45+ version = "${majorVersion}.4.0";
4146
4247 inherit (stdenv) buildPlatform hostPlatform targetPlatform;
4348
@@ -58,7 +63,11 @@ let version = "7.4.0";
5863 })
5964 ++ optional langFortran ../gfortran-driving.patch
6065 ++ optional (targetPlatform.libc == "musl" && targetPlatform.isPower) ../ppc-musl.patch
61− ++ optional (targetPlatform.libc == "musl") ../libgomp-dont-force-initial-exec.patch;
66+ ++ optional (targetPlatform.libc == "musl") ../libgomp-dont-force-initial-exec.patch
67+ ++ optional (!crossStageStatic && targetPlatform.isMinGW) (fetchpatch {
68+ url = "https://raw.githubusercontent.com/lhmouse/MINGW-packages/${import ../common/mfcgthreads-patches-repo.nix}/mingw-w64-gcc-git/9000-gcc-${majorVersion}-branch-Added-mcf-thread-model-support-from-mcfgthread.patch";
69+ sha256 = "1nyjnshpq5gbcbbpfv27hy4ajvycmgkpiabkjlxnnrnq1d99k1ay";
70+ });
6271
6372 /* Cross-gcc settings (build == host != target) */
6473 crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
@@ -160,6 +169,8 @@ stdenv.mkDerivation ({
160169 ++ (optional hostPlatform.isDarwin gnused)
161170 ;
162171
172+ depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross;
173+
163174 NIX_CFLAGS_COMPILE = stdenv.lib.optionalString (stdenv.cc.isClang && langFortran) "-Wno-unused-command-line-argument";
164175 NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl";
165176
@@ -232,7 +243,7 @@ stdenv.mkDerivation ({
232243
233244 inherit
234245 (import ../common/extra-target-flags.nix {
235− inherit stdenv crossStageStatic libcCross;
246+ inherit stdenv crossStageStatic libcCross threadsCross;
236247 })
237248 EXTRA_TARGET_FLAGS
238249 EXTRA_TARGET_LDFLAGS
pkgs/development/compilers/gcc/8/default.nix+15−4
@@ -1,4 +1,4 @@
1−{ stdenv, targetPackages, fetchurl, noSysDirs
1+{ stdenv, targetPackages, fetchurl, fetchpatch, noSysDirs
22, langC ? true, langCC ? true, langFortran ? false
33, langObjC ? stdenv.targetPlatform.isDarwin
44, langObjCpp ? stdenv.targetPlatform.isDarwin
@@ -16,6 +16,7 @@
1616, enablePlugin ? stdenv.hostPlatform == stdenv.buildPlatform # Whether to support user-supplied plug-ins
1717, name ? "gcc"
1818, libcCross ? null
19+, threadsCross ? null # for MinGW
1920, crossStageStatic ? false
2021, # Strip kills static libs of other archs (hence no cross)
2122 stripped ? stdenv.hostPlatform == stdenv.buildPlatform
@@ -34,10 +35,14 @@ assert stdenv.hostPlatform.isDarwin -> gnused != null;
3435# The go frontend is written in c++
3536assert langGo -> langCC;
3637
38+# threadsCross is just for MinGW
39+assert threadsCross != null -> stdenv.targetPlatform.isWindows;
40+
3741with stdenv.lib;
3842with builtins;
3943
40−let version = "8.3.0";
44+let majorVersion = "8";
45+ version = "${majorVersion}.3.0";
4146
4247 inherit (stdenv) buildPlatform hostPlatform targetPlatform;
4348
@@ -50,7 +55,11 @@ let version = "8.3.0";
5055 }) */
5156 ++ optional langFortran ../gfortran-driving.patch
5257 ++ optional (targetPlatform.libc == "musl" && targetPlatform.isPower) ../ppc-musl.patch
53− ++ optional (targetPlatform.libc == "musl") ../libgomp-dont-force-initial-exec.patch;
58+ ++ optional (targetPlatform.libc == "musl") ../libgomp-dont-force-initial-exec.patch
59+ ++ optional (!crossStageStatic && targetPlatform.isMinGW) (fetchpatch {
60+ url = "https://raw.githubusercontent.com/lhmouse/MINGW-packages/${import ../common/mfcgthreads-patches-repo.nix}/mingw-w64-gcc-git/9000-gcc-${majorVersion}-branch-Added-mcf-thread-model-support-from-mcfgthread.patch";
61+ sha256 = "1in5kvcknlpi9z1vvjw6jfmwy8k12zvbqlqfnq84qpm99r0rh00a";
62+ });
5463
5564 /* Cross-gcc settings (build == host != target) */
5665 crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
@@ -147,6 +156,8 @@ stdenv.mkDerivation ({
147156 ++ (optional hostPlatform.isDarwin gnused)
148157 ;
149158
159+ depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross;
160+
150161 NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl";
151162
152163 preConfigure = import ../common/pre-configure.nix {
@@ -214,7 +225,7 @@ stdenv.mkDerivation ({
214225
215226 inherit
216227 (import ../common/extra-target-flags.nix {
217− inherit stdenv crossStageStatic libcCross;
228+ inherit stdenv crossStageStatic libcCross threadsCross;
218229 })
219230 EXTRA_TARGET_FLAGS
220231 EXTRA_TARGET_LDFLAGS
pkgs/development/compilers/gcc/9/default.nix+15−4
@@ -1,4 +1,4 @@
1−{ stdenv, targetPackages, fetchurl, noSysDirs
1+{ stdenv, targetPackages, fetchurl, fetchpatch, noSysDirs
22, langC ? true, langCC ? true, langFortran ? false
33, langObjC ? stdenv.targetPlatform.isDarwin
44, langObjCpp ? stdenv.targetPlatform.isDarwin
@@ -16,6 +16,7 @@
1616, enablePlugin ? stdenv.hostPlatform == stdenv.buildPlatform # Whether to support user-supplied plug-ins
1717, name ? "gcc"
1818, libcCross ? null
19+, threadsCross ? null # for MinGW
1920, crossStageStatic ? false
2021, # Strip kills static libs of other archs (hence no cross)
2122 stripped ? stdenv.hostPlatform == stdenv.buildPlatform
@@ -34,10 +35,14 @@ assert stdenv.hostPlatform.isDarwin -> gnused != null;
3435# The go frontend is written in c++
3536assert langGo -> langCC;
3637
38+# threadsCross is just for MinGW
39+assert threadsCross != null -> stdenv.targetPlatform.isWindows;
40+
3741with stdenv.lib;
3842with builtins;
3943
40−let version = "9.2.0";
44+let majorVersion = "9";
45+ version = "${majorVersion}.2.0";
4146
4247 inherit (stdenv) buildPlatform hostPlatform targetPlatform;
4348
@@ -49,7 +54,11 @@ let version = "9.2.0";
4954 sha256 = ""; # TODO: uncomment and check hash when available.
5055 }) */
5156 ++ optional langFortran ../gfortran-driving.patch
52− ++ optional (targetPlatform.libc == "musl" && targetPlatform.isPower) ../ppc-musl.patch;
57+ ++ optional (targetPlatform.libc == "musl" && targetPlatform.isPower) ../ppc-musl.patch
58+ ++ optional (!crossStageStatic && targetPlatform.isMinGW) (fetchpatch {
59+ url = "https://raw.githubusercontent.com/lhmouse/MINGW-packages/${import ../common/mfcgthreads-patches-repo.nix}/mingw-w64-gcc-git/9000-gcc-${majorVersion}-branch-Added-mcf-thread-model-support-from-mcfgthread.patch";
60+ sha256 = "1in5kvcknlpi9z1vvjw6jfmwy8k12zvbqlqfnq84qpm99r0rh00a";
61+ });
5362
5463 /* Cross-gcc settings (build == host != target) */
5564 crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
@@ -146,6 +155,8 @@ stdenv.mkDerivation ({
146155 ++ (optional hostPlatform.isDarwin gnused)
147156 ;
148157
158+ depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross;
159+
149160 NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl";
150161
151162 preConfigure = import ../common/pre-configure.nix {
@@ -213,7 +224,7 @@ stdenv.mkDerivation ({
213224
214225 inherit
215226 (import ../common/extra-target-flags.nix {
216− inherit stdenv crossStageStatic libcCross;
227+ inherit stdenv crossStageStatic libcCross threadsCross;
217228 })
218229 EXTRA_TARGET_FLAGS
219230 EXTRA_TARGET_LDFLAGS
pkgs/development/compilers/gcc/common/configure-flags.nix+1−1
@@ -62,7 +62,7 @@ let
6262 "--enable-__cxa_atexit"
6363 "--enable-long-long"
6464 "--enable-threads=${if targetPlatform.isUnix then "posix"
65− else if targetPlatform.isWindows then "win32"
65+ else if targetPlatform.isWindows then "mcf"
6666 else "single"}"
6767 "--enable-nls"
6868 "--disable-decimal-float" # No final libdecnumber (it may work only in 386)
pkgs/development/compilers/gcc/common/extra-target-flags.nix+3−1
@@ -1,4 +1,4 @@
1−{ stdenv, crossStageStatic, libcCross }:
1+{ stdenv, crossStageStatic, libcCross, threadsCross }:
22
33let
44 inherit (stdenv) lib hostPlatform targetPlatform;
@@ -12,6 +12,7 @@ in
1212 "-B${lib.getLib dep}${dep.libdir or "/lib"}"
1313 ]);
1414 in mkFlags libcCross
15+ ++ lib.optionals (!crossStageStatic) (mkFlags threadsCross)
1516 ;
1617
1718 EXTRA_TARGET_LDFLAGS = let
@@ -24,5 +25,6 @@ in
2425 "-Wl,-rpath-link,${lib.getLib dep}${dep.libdir or "/lib"}"
2526 ]));
2627 in mkFlags libcCross
28+ ++ lib.optionals (!crossStageStatic) (mkFlags threadsCross)
2729 ;
2830}
pkgs/development/compilers/gcc/common/mfcgthreads-patches-repo.nixnew file+1
@@ -0,0 +1 @@
1+"740f233da00c4fb5bcc225b2e29768824bcecc58"
pkgs/development/compilers/gcc/snapshot/default.nix+15−4
@@ -1,4 +1,4 @@
1−{ stdenv, targetPackages, fetchurl, noSysDirs
1+{ stdenv, targetPackages, fetchurl, fetchpatch, noSysDirs
22, langC ? true, langCC ? true, langFortran ? false
33, langObjC ? stdenv.targetPlatform.isDarwin
44, langObjCpp ? stdenv.targetPlatform.isDarwin
@@ -16,6 +16,7 @@
1616, enablePlugin ? stdenv.hostPlatform == stdenv.buildPlatform # Whether to support user-supplied plug-ins
1717, name ? "gcc"
1818, libcCross ? null
19+, threadsCross ? null # for MinGW
1920, crossStageStatic ? false
2021, # Strip kills static libs of other archs (hence no cross)
2122 stripped ? stdenv.hostPlatform == stdenv.buildPlatform
@@ -35,10 +36,14 @@ assert stdenv.hostPlatform.isDarwin -> gnused != null;
3536# The go frontend is written in c++
3637assert langGo -> langCC;
3738
39+# threadsCross is just for MinGW
40+assert threadsCross != null -> stdenv.targetPlatform.isWindows;
41+
3842with stdenv.lib;
3943with builtins;
4044
41−let version = "7-20170409";
45+let majorVersion = "7";
46+ version = "${majorVersion}-20170409";
4247
4348 inherit (stdenv) buildPlatform hostPlatform targetPlatform;
4449
@@ -46,7 +51,11 @@ let version = "7-20170409";
4651 [ ]
4752 ++ optional (targetPlatform != hostPlatform) ../libstdc++-target.patch
4853 ++ optional noSysDirs ../no-sys-dirs.patch
49− ++ optional langFortran ../gfortran-driving.patch;
54+ ++ optional langFortran ../gfortran-driving.patch
55+ ++ optional (!crossStageStatic && targetPlatform.isMinGW) (fetchpatch {
56+ url = "https://raw.githubusercontent.com/lhmouse/MINGW-packages/${import ../common/mfcgthreads-patches-repo.nix}/mingw-w64-gcc-git/9000-gcc-${majorVersion}-branch-Added-mcf-thread-model-support-from-mcfgthread.patch";
57+ sha256 = "1nyjnshpq5gbcbbpfv27hy4ajvycmgkpiabkjlxnnrnq1d99k1ay";
58+ });
5059
5160 /* Cross-gcc settings (build == host != target) */
5261 crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
@@ -118,6 +127,8 @@ stdenv.mkDerivation ({
118127 ++ (optional hostPlatform.isDarwin gnused)
119128 ;
120129
130+ depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross;
131+
121132 NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl";
122133
123134 preConfigure = import ../common/pre-configure.nix {
@@ -186,7 +197,7 @@ stdenv.mkDerivation ({
186197
187198 inherit
188199 (import ../common/extra-target-flags.nix {
189− inherit stdenv crossStageStatic libcCross;
200+ inherit stdenv crossStageStatic libcCross threadsCross;
190201 })
191202 EXTRA_TARGET_FLAGS
192203 EXTRA_TARGET_LDFLAGS
pkgs/os-specific/windows/mcfgthreads/default.nix+5
@@ -3,16 +3,21 @@
33stdenv.mkDerivation {
44 pname = "mcfgthreads";
55 version = "git";
6+
67 src = fetchFromGitHub {
78 owner = "lhmouse";
89 repo = "mcfgthread";
910 rev = "9570e5ca7b98002d707c502c919d951bf256b9c6";
1011 sha256 = "10y2x3x601a7c1hkd6zlr3xpfsnlr05xl28v23clf619756a5755";
1112 };
13+
14+ outputs = [ "out" "dev" ];
15+
1216 # Don't want prebuilt binaries sneaking in.
1317 postUnpack = ''
1418 rm -r "$sourceRoot/debug" "$sourceRoot/release"
1519 '';
20+
1621 nativeBuildInputs = [
1722 autoreconfHook
1823 ];
pkgs/top-level/all-packages.nix+16−1
@@ -7610,6 +7610,7 @@ in
76107610 };
76117611 bintools = binutils1;
76127612 libc = libcCross1;
7613+ extraPackages = [];
76137614 };
76147615
76157616 gcc48 = lowPrio (wrapCC (callPackage ../development/compilers/gcc/4.8 {
@@ -7619,6 +7620,7 @@ in
76197620 profiledCompiler = with stdenv; (!isSunOS && !isDarwin && (isi686 || isx86_64));
76207621
76217622 libcCross = if stdenv.targetPlatform != stdenv.buildPlatform then libcCross else null;
7623+ threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross else null;
76227624
76237625 isl = if !stdenv.isDarwin then isl_0_14 else null;
76247626 cloog = if !stdenv.isDarwin then cloog else null;
@@ -7632,6 +7634,7 @@ in
76327634 profiledCompiler = with stdenv; (!isDarwin && (isi686 || isx86_64));
76337635
76347636 libcCross = if stdenv.targetPlatform != stdenv.buildPlatform then libcCross else null;
7637+ threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross else null;
76357638
76367639 isl = if !stdenv.isDarwin then isl_0_11 else null;
76377640
@@ -7645,6 +7648,7 @@ in
76457648 profiledCompiler = with stdenv; (!isDarwin && (isi686 || isx86_64));
76467649
76477650 libcCross = if stdenv.targetPlatform != stdenv.buildPlatform then libcCross else null;
7651+ threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross else null;
76487652
76497653 isl = if !stdenv.isDarwin then isl_0_14 else null;
76507654 }));
@@ -7656,6 +7660,7 @@ in
76567660 profiledCompiler = with stdenv; (!isDarwin && (isi686 || isx86_64));
76577661
76587662 libcCross = if stdenv.targetPlatform != stdenv.buildPlatform then libcCross else null;
7663+ threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross else null;
76597664
76607665 isl = if !stdenv.isDarwin then isl_0_14 else null;
76617666 }));
@@ -7667,6 +7672,7 @@ in
76677672 profiledCompiler = with stdenv; (!isDarwin && (isi686 || isx86_64));
76687673
76697674 libcCross = if stdenv.targetPlatform != stdenv.buildPlatform then libcCross else null;
7675+ threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross else null;
76707676
76717677 isl = if !stdenv.isDarwin then isl_0_17 else null;
76727678 }));
@@ -7678,6 +7684,7 @@ in
76787684 profiledCompiler = with stdenv; (!isDarwin && (isi686 || isx86_64));
76797685
76807686 libcCross = if stdenv.targetPlatform != stdenv.buildPlatform then libcCross else null;
7687+ threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross else null;
76817688
76827689 isl = if !stdenv.isDarwin then isl_0_17 else null;
76837690 }));
@@ -7689,6 +7696,7 @@ in
76897696 profiledCompiler = with stdenv; (!isDarwin && (isi686 || isx86_64));
76907697
76917698 libcCross = if stdenv.targetPlatform != stdenv.buildPlatform then libcCross else null;
7699+ threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross else null;
76927700
76937701 isl = if !stdenv.isDarwin then isl_0_17 else null;
76947702 }));
@@ -7700,6 +7708,7 @@ in
77007708 profiledCompiler = with stdenv; (!isDarwin && (isi686 || isx86_64));
77017709
77027710 libcCross = if stdenv.targetPlatform != stdenv.buildPlatform then libcCross else null;
7711+ threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross else null;
77037712
77047713 isl = isl_0_17;
77057714 }));
@@ -8497,6 +8506,7 @@ in
84978506 # provide the default choice, avoiding infinite recursion.
84988507 bintools ? if stdenv.targetPlatform.isDarwin then darwin.binutils else binutils
84998508 , libc ? bintools.libc
8509+ , extraPackages ? stdenv.lib.optional (cc.isGNU or false && stdenv.targetPlatform.isMinGW) threadsCross
85008510 , ...
85018511 } @ extraArgs:
85028512 callPackage ../build-support/cc-wrapper (let self = {
@@ -8508,7 +8518,7 @@ in
85088518 isGNU = cc.isGNU or false;
85098519 isClang = cc.isClang or false;
85108520
8511− inherit cc bintools libc;
8521+ inherit cc bintools libc extraPackages;
85128522 } // extraArgs; in self);
85138523
85148524 wrapCC = cc: wrapCCWith {
@@ -10973,6 +10983,11 @@ in
1097310983
1097410984 libcCross = assert stdenv.targetPlatform != stdenv.buildPlatform; libcCrossChooser stdenv.targetPlatform.libc;
1097510985
10986+ threadsCross =
10987+ if stdenv.targetPlatform.isMinGW && !(stdenv.targetPlatform.useLLVM or false)
10988+ then targetPackages.windows.mcfgthreads or windows.mcfgthreads
10989+ else null;
10990+
1097610991 wasilibc = callPackage ../development/libraries/wasilibc {
1097710992 stdenv = crossLibcStdenv;
1097810993 };