summary refs log tree commit diff
path: root/pkgs/development/compilers/gcc/6
diff options
context:
space:
mode:
authorJohn Ericson <git@JohnEricson.me>2019-11-11 00:23:32 -0500
committerJohn Ericson <git@JohnEricson.me>2019-11-11 11:02:38 -0500
commit04cb05d20c780f0cbe76eca6dfc2f08e741a1660 (patch)
treebe0f84356254f6b24f970f793e41faf9c8440ad6 /pkgs/development/compilers/gcc/6
parent999ef20129cf0c4809a3d654f2378192f6b32ef1 (diff)
downloadnixpkgs-04cb05d20c780f0cbe76eca6dfc2f08e741a1660.tar
nixpkgs-04cb05d20c780f0cbe76eca6dfc2f08e741a1660.tar.gz
nixpkgs-04cb05d20c780f0cbe76eca6dfc2f08e741a1660.tar.bz2
nixpkgs-04cb05d20c780f0cbe76eca6dfc2f08e741a1660.tar.lz
nixpkgs-04cb05d20c780f0cbe76eca6dfc2f08e741a1660.tar.xz
nixpkgs-04cb05d20c780f0cbe76eca6dfc2f08e741a1660.tar.zst
nixpkgs-04cb05d20c780f0cbe76eca6dfc2f08e741a1660.zip
gcc: Build MinGW stage two with threading library
Currently this is set up to be mcfgthreads, but it could be something
else instead.
Diffstat (limited to 'pkgs/development/compilers/gcc/6')
-rw-r--r--pkgs/development/compilers/gcc/6/default.nix18
1 files changed, 14 insertions, 4 deletions
diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix
index 82cec33756d..2cecc5bbaa0 100644
--- a/pkgs/development/compilers/gcc/6/default.nix
+++ b/pkgs/development/compilers/gcc/6/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, targetPackages, fetchurl, noSysDirs
+{ stdenv, targetPackages, fetchurl, fetchpatch, noSysDirs
 , langC ? true, langCC ? true, langFortran ? false
 , langObjC ? stdenv.targetPlatform.isDarwin
 , langObjCpp ? stdenv.targetPlatform.isDarwin
@@ -23,6 +23,7 @@
 , enablePlugin ? stdenv.hostPlatform == stdenv.buildPlatform # Whether to support user-supplied plug-ins
 , name ? "gcc"
 , libcCross ? null
+, threadsCross ? null # for MinGW
 , crossStageStatic ? false
 , # Strip kills static libs of other archs (hence no cross)
   stripped ? stdenv.hostPlatform == stdenv.buildPlatform
@@ -45,10 +46,14 @@ assert stdenv.hostPlatform.isDarwin -> gnused != null;
 # The go frontend is written in c++
 assert langGo -> langCC;
 
+# threadsCross is just for MinGW
+assert threadsCross != null -> stdenv.targetPlatform.isWindows;
+
 with stdenv.lib;
 with builtins;
 
-let version = "6.5.0";
+let majorVersion = "6";
+    version = "${majorVersion}.5.0";
 
     inherit (stdenv) buildPlatform hostPlatform targetPlatform;
 
@@ -58,7 +63,10 @@ let version = "6.5.0";
       ++ optional noSysDirs ../no-sys-dirs.patch
       ++ optional langFortran ../gfortran-driving.patch
       ++ optional (targetPlatform.libc == "musl") ../libgomp-dont-force-initial-exec.patch
-      ;
+      ++ optional (!crossStageStatic && targetPlatform.isMinGW) (fetchpatch {
+        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";
+        sha256 = "1c449jgm1vx9g4kv82bxmvlgrwb8f6kwkl0gqmjlmhf7f4hjy2nr";
+      });
 
     javaEcj = fetchurl {
       # The `$(top_srcdir)/ecj.jar' file is automatically picked up at
@@ -185,6 +193,8 @@ stdenv.mkDerivation ({
     ++ (optional hostPlatform.isDarwin gnused)
     ;
 
+  depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross;
+
   NIX_LDFLAGS = stdenv.lib.optionalString  hostPlatform.isSunOS "-lm -ldl";
 
   preConfigure = import ../common/pre-configure.nix {
@@ -268,7 +278,7 @@ stdenv.mkDerivation ({
 
   inherit
     (import ../common/extra-target-flags.nix {
-      inherit stdenv crossStageStatic libcCross;
+      inherit stdenv crossStageStatic libcCross threadsCross;
     })
     EXTRA_TARGET_FLAGS
     EXTRA_TARGET_LDFLAGS