gcc: Build MinGW stage two with threading library

Currently this is set up to be mcfgthreads, but it could be something
else instead.
This commit is contained in:
John Ericson
2019-11-11 11:02:38 -05:00
parent 999ef20129
commit 04cb05d20c
13 changed files with 130 additions and 28 deletions
@@ -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
@@ -47,10 +48,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 = "4.8.5";
let majorVersion = "4";
version = "${majorVersion}.8.5";
inherit (stdenv) buildPlatform hostPlatform targetPlatform;
@@ -171,6 +176,8 @@ stdenv.mkDerivation ({
++ (optional hostPlatform.isDarwin gnused)
;
depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross;
preConfigure = import ../common/pre-configure.nix {
inherit (stdenv) lib;
inherit version hostPlatform langJava langGo;
@@ -253,7 +260,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