mingw-w64 libc: Multiple outputs and parallel builds
Also deduplicate more of the GCC derivations.
This commit is contained in:
parent
06c5e811e6
commit
999ef20129
@ -251,24 +251,13 @@ stdenv.mkDerivation ({
|
||||
++ optionals javaAwtGtk [ gmp mpfr ]
|
||||
));
|
||||
|
||||
EXTRA_TARGET_FLAGS = optionals
|
||||
(targetPlatform != hostPlatform && libcCross != null)
|
||||
([
|
||||
"-idirafter ${getDev libcCross}${libcCross.incdir or "/include"}"
|
||||
] ++ optionals (! crossStageStatic) [
|
||||
"-B${libcCross.out}${libcCross.libdir or "/lib"}"
|
||||
]);
|
||||
|
||||
EXTRA_TARGET_LDFLAGS = optionals
|
||||
(targetPlatform != hostPlatform && libcCross != null)
|
||||
([
|
||||
"-Wl,-L${libcCross.out}${libcCross.libdir or "/lib"}"
|
||||
] ++ (if crossStageStatic then [
|
||||
"-B${libcCross.out}${libcCross.libdir or "/lib"}"
|
||||
] else [
|
||||
"-Wl,-rpath,${libcCross.out}${libcCross.libdir or "/lib"}"
|
||||
"-Wl,-rpath-link,${libcCross.out}${libcCross.libdir or "/lib"}"
|
||||
]));
|
||||
inherit
|
||||
(import ../common/extra-target-flags.nix {
|
||||
inherit stdenv crossStageStatic libcCross;
|
||||
})
|
||||
EXTRA_TARGET_FLAGS
|
||||
EXTRA_TARGET_LDFLAGS
|
||||
;
|
||||
|
||||
passthru = {
|
||||
inherit langC langCC langObjC langObjCpp langFortran langGo version;
|
||||
|
@ -257,24 +257,13 @@ stdenv.mkDerivation ({
|
||||
++ optionals javaAwtGtk [ gmp mpfr ]
|
||||
));
|
||||
|
||||
EXTRA_TARGET_FLAGS = optionals
|
||||
(targetPlatform != hostPlatform && libcCross != null)
|
||||
([
|
||||
"-idirafter ${getDev libcCross}${libcCross.incdir or "/include"}"
|
||||
] ++ optionals (! crossStageStatic) [
|
||||
"-B${libcCross.out}${libcCross.libdir or "/lib"}"
|
||||
]);
|
||||
|
||||
EXTRA_TARGET_LDFLAGS = optionals
|
||||
(targetPlatform != hostPlatform && libcCross != null)
|
||||
([
|
||||
"-Wl,-L${libcCross.out}${libcCross.libdir or "/lib"}"
|
||||
] ++ (if crossStageStatic then [
|
||||
"-B${libcCross.out}${libcCross.libdir or "/lib"}"
|
||||
] else [
|
||||
"-Wl,-rpath,${libcCross.out}${libcCross.libdir or "/lib"}"
|
||||
"-Wl,-rpath-link,${libcCross.out}${libcCross.libdir or "/lib"}"
|
||||
]));
|
||||
inherit
|
||||
(import ../common/extra-target-flags.nix {
|
||||
inherit stdenv crossStageStatic libcCross;
|
||||
})
|
||||
EXTRA_TARGET_FLAGS
|
||||
EXTRA_TARGET_LDFLAGS
|
||||
;
|
||||
|
||||
passthru = {
|
||||
inherit langC langCC langObjC langObjCpp langFortran langGo version;
|
||||
|
@ -264,24 +264,13 @@ stdenv.mkDerivation ({
|
||||
++ optionals javaAwtGtk [ gmp mpfr ]
|
||||
));
|
||||
|
||||
EXTRA_TARGET_FLAGS = optionals
|
||||
(targetPlatform != hostPlatform && libcCross != null)
|
||||
([
|
||||
"-idirafter ${getDev libcCross}${libcCross.incdir or "/include"}"
|
||||
] ++ optionals (! crossStageStatic) [
|
||||
"-B${libcCross.out}${libcCross.libdir or "/lib"}"
|
||||
]);
|
||||
|
||||
EXTRA_TARGET_LDFLAGS = optionals
|
||||
(targetPlatform != hostPlatform && libcCross != null)
|
||||
([
|
||||
"-Wl,-L${libcCross.out}${libcCross.libdir or "/lib"}"
|
||||
] ++ (if crossStageStatic then [
|
||||
"-B${libcCross.out}${libcCross.libdir or "/lib"}"
|
||||
] else [
|
||||
"-Wl,-rpath,${libcCross.out}${libcCross.libdir or "/lib"}"
|
||||
"-Wl,-rpath-link,${libcCross.out}${libcCross.libdir or "/lib"}"
|
||||
]));
|
||||
inherit
|
||||
(import ../common/extra-target-flags.nix {
|
||||
inherit stdenv crossStageStatic libcCross;
|
||||
})
|
||||
EXTRA_TARGET_FLAGS
|
||||
EXTRA_TARGET_LDFLAGS
|
||||
;
|
||||
|
||||
passthru = {
|
||||
inherit langC langCC langObjC langObjCpp langFortran langGo version;
|
||||
|
@ -266,24 +266,13 @@ stdenv.mkDerivation ({
|
||||
++ optionals javaAwtGtk [ gmp mpfr ]
|
||||
));
|
||||
|
||||
EXTRA_TARGET_FLAGS = optionals
|
||||
(targetPlatform != hostPlatform && libcCross != null)
|
||||
([
|
||||
"-idirafter ${getDev libcCross}${libcCross.incdir or "/include"}"
|
||||
] ++ optionals (! crossStageStatic) [
|
||||
"-B${libcCross.out}${libcCross.libdir or "/lib"}"
|
||||
]);
|
||||
|
||||
EXTRA_TARGET_LDFLAGS = optionals
|
||||
(targetPlatform != hostPlatform && libcCross != null)
|
||||
([
|
||||
"-Wl,-L${libcCross.out}${libcCross.libdir or "/lib"}"
|
||||
] ++ (if crossStageStatic then [
|
||||
"-B${libcCross.out}${libcCross.libdir or "/lib"}"
|
||||
] else [
|
||||
"-Wl,-rpath,${libcCross.out}${libcCross.libdir or "/lib"}"
|
||||
"-Wl,-rpath-link,${libcCross.out}${libcCross.libdir or "/lib"}"
|
||||
]));
|
||||
inherit
|
||||
(import ../common/extra-target-flags.nix {
|
||||
inherit stdenv crossStageStatic libcCross;
|
||||
})
|
||||
EXTRA_TARGET_FLAGS
|
||||
EXTRA_TARGET_LDFLAGS
|
||||
;
|
||||
|
||||
passthru = {
|
||||
inherit langC langCC langObjC langObjCpp langFortran langGo version;
|
||||
|
@ -230,24 +230,13 @@ stdenv.mkDerivation ({
|
||||
|
||||
LIBRARY_PATH = optionals (targetPlatform == hostPlatform) (makeLibraryPath (optional (zlib != null) zlib));
|
||||
|
||||
EXTRA_TARGET_FLAGS = optionals
|
||||
(targetPlatform != hostPlatform && libcCross != null)
|
||||
([
|
||||
"-idirafter ${getDev libcCross}${libcCross.incdir or "/include"}"
|
||||
] ++ optionals (! crossStageStatic) [
|
||||
"-B${libcCross.out}${libcCross.libdir or "/lib"}"
|
||||
]);
|
||||
|
||||
EXTRA_TARGET_LDFLAGS = optionals
|
||||
(targetPlatform != hostPlatform && libcCross != null)
|
||||
([
|
||||
"-Wl,-L${libcCross.out}${libcCross.libdir or "/lib"}"
|
||||
] ++ (if crossStageStatic then [
|
||||
"-B${libcCross.out}${libcCross.libdir or "/lib"}"
|
||||
] else [
|
||||
"-Wl,-rpath,${libcCross.out}${libcCross.libdir or "/lib"}"
|
||||
"-Wl,-rpath-link,${libcCross.out}${libcCross.libdir or "/lib"}"
|
||||
]));
|
||||
inherit
|
||||
(import ../common/extra-target-flags.nix {
|
||||
inherit stdenv crossStageStatic libcCross;
|
||||
})
|
||||
EXTRA_TARGET_FLAGS
|
||||
EXTRA_TARGET_LDFLAGS
|
||||
;
|
||||
|
||||
passthru = {
|
||||
inherit langC langCC langObjC langObjCpp langFortran langGo version;
|
||||
|
@ -212,24 +212,13 @@ stdenv.mkDerivation ({
|
||||
|
||||
LIBRARY_PATH = optionals (targetPlatform == hostPlatform) (makeLibraryPath (optional (zlib != null) zlib));
|
||||
|
||||
EXTRA_TARGET_FLAGS = optionals
|
||||
(targetPlatform != hostPlatform && libcCross != null)
|
||||
([
|
||||
"-idirafter ${getDev libcCross}${libcCross.incdir or "/include"}"
|
||||
] ++ optionals (! crossStageStatic) [
|
||||
"-B${libcCross.out}${libcCross.libdir or "/lib"}"
|
||||
]);
|
||||
|
||||
EXTRA_TARGET_LDFLAGS = optionals
|
||||
(targetPlatform != hostPlatform && libcCross != null)
|
||||
([
|
||||
"-Wl,-L${libcCross.out}${libcCross.libdir or "/lib"}"
|
||||
] ++ (if crossStageStatic then [
|
||||
"-B${libcCross.out}${libcCross.libdir or "/lib"}"
|
||||
] else [
|
||||
"-Wl,-rpath,${libcCross.out}${libcCross.libdir or "/lib"}"
|
||||
"-Wl,-rpath-link,${libcCross.out}${libcCross.libdir or "/lib"}"
|
||||
]));
|
||||
inherit
|
||||
(import ../common/extra-target-flags.nix {
|
||||
inherit stdenv crossStageStatic libcCross;
|
||||
})
|
||||
EXTRA_TARGET_FLAGS
|
||||
EXTRA_TARGET_LDFLAGS
|
||||
;
|
||||
|
||||
passthru = {
|
||||
inherit langC langCC langObjC langObjCpp langFortran langGo version;
|
||||
|
@ -211,24 +211,13 @@ stdenv.mkDerivation ({
|
||||
|
||||
LIBRARY_PATH = optionals (targetPlatform == hostPlatform) (makeLibraryPath (optional (zlib != null) zlib));
|
||||
|
||||
EXTRA_TARGET_FLAGS = optionals
|
||||
(targetPlatform != hostPlatform && libcCross != null)
|
||||
([
|
||||
"-idirafter ${getDev libcCross}${libcCross.incdir or "/include"}"
|
||||
] ++ optionals (! crossStageStatic) [
|
||||
"-B${libcCross.out}${libcCross.libdir or "/lib"}"
|
||||
]);
|
||||
|
||||
EXTRA_TARGET_LDFLAGS = optionals
|
||||
(targetPlatform != hostPlatform && libcCross != null)
|
||||
([
|
||||
"-Wl,-L${libcCross.out}${libcCross.libdir or "/lib"}"
|
||||
] ++ (if crossStageStatic then [
|
||||
"-B${libcCross.out}${libcCross.libdir or "/lib"}"
|
||||
] else [
|
||||
"-Wl,-rpath,${libcCross.out}${libcCross.libdir or "/lib"}"
|
||||
"-Wl,-rpath-link,${libcCross.out}${libcCross.libdir or "/lib"}"
|
||||
]));
|
||||
inherit
|
||||
(import ../common/extra-target-flags.nix {
|
||||
inherit stdenv crossStageStatic libcCross;
|
||||
})
|
||||
EXTRA_TARGET_FLAGS
|
||||
EXTRA_TARGET_LDFLAGS
|
||||
;
|
||||
|
||||
passthru = {
|
||||
inherit langC langCC langObjC langObjCpp langFortran langGo version;
|
||||
|
@ -49,7 +49,7 @@ let
|
||||
"--disable-decimal-float" # requires libc
|
||||
"--disable-libmpx" # requires libc
|
||||
] ++ lib.optionals crossMingw [
|
||||
"--with-headers=${libcCross}/include"
|
||||
"--with-headers=${lib.getDev libcCross}/include"
|
||||
"--with-gcc"
|
||||
"--with-gnu-as"
|
||||
"--with-gnu-ld"
|
||||
|
28
pkgs/development/compilers/gcc/common/extra-target-flags.nix
Normal file
28
pkgs/development/compilers/gcc/common/extra-target-flags.nix
Normal file
@ -0,0 +1,28 @@
|
||||
{ stdenv, crossStageStatic, libcCross }:
|
||||
|
||||
let
|
||||
inherit (stdenv) lib hostPlatform targetPlatform;
|
||||
in
|
||||
|
||||
{
|
||||
EXTRA_TARGET_FLAGS = let
|
||||
mkFlags = dep: lib.optionals (targetPlatform != hostPlatform && dep != null) ([
|
||||
"-idirafter ${lib.getDev dep}${dep.incdir or "/include"}"
|
||||
] ++ stdenv.lib.optionals (! crossStageStatic) [
|
||||
"-B${lib.getLib dep}${dep.libdir or "/lib"}"
|
||||
]);
|
||||
in mkFlags libcCross
|
||||
;
|
||||
|
||||
EXTRA_TARGET_LDFLAGS = let
|
||||
mkFlags = dep: lib.optionals (targetPlatform != hostPlatform && dep != null) ([
|
||||
"-Wl,-L${lib.getLib dep}${dep.libdir or "/lib"}"
|
||||
] ++ (if crossStageStatic then [
|
||||
"-B${lib.getLib dep}${dep.libdir or "/lib"}"
|
||||
] else [
|
||||
"-Wl,-rpath,${lib.getLib dep}${dep.libdir or "/lib"}"
|
||||
"-Wl,-rpath-link,${lib.getLib dep}${dep.libdir or "/lib"}"
|
||||
]));
|
||||
in mkFlags libcCross
|
||||
;
|
||||
}
|
@ -184,24 +184,13 @@ stdenv.mkDerivation ({
|
||||
|
||||
LIBRARY_PATH = optionals (targetPlatform == hostPlatform) (makeLibraryPath (optional (zlib != null) zlib));
|
||||
|
||||
EXTRA_TARGET_FLAGS = optionals
|
||||
(targetPlatform != hostPlatform && libcCross != null)
|
||||
([
|
||||
"-idirafter ${getDev libcCross}${libcCross.incdir or "/include"}"
|
||||
] ++ optionals (! crossStageStatic) [
|
||||
"-B${libcCross.out}${libcCross.libdir or "/lib"}"
|
||||
]);
|
||||
|
||||
EXTRA_TARGET_LDFLAGS = optionals
|
||||
(targetPlatform != hostPlatform && libcCross != null)
|
||||
([
|
||||
"-Wl,-L${libcCross.out}${libcCross.libdir or "/lib"}"
|
||||
] ++ (if crossStageStatic then [
|
||||
"-B${libcCross.out}${libcCross.libdir or "/lib"}"
|
||||
] else [
|
||||
"-Wl,-rpath,${libcCross.out}${libcCross.libdir or "/lib"}"
|
||||
"-Wl,-rpath-link,${libcCross.out}${libcCross.libdir or "/lib"}"
|
||||
]));
|
||||
inherit
|
||||
(import ../common/extra-target-flags.nix {
|
||||
inherit stdenv crossStageStatic libcCross;
|
||||
})
|
||||
EXTRA_TARGET_FLAGS
|
||||
EXTRA_TARGET_LDFLAGS
|
||||
;
|
||||
|
||||
passthru = {
|
||||
inherit langC langCC langObjC langObjCpp langFortran langGo version;
|
||||
|
@ -11,11 +11,15 @@ in stdenv.mkDerivation {
|
||||
sha256 = "00zq3z1hbzd5yzmskskjg79xrzwsqx7ihyprfaxy4hb897vf29sm";
|
||||
};
|
||||
|
||||
outputs = [ "out" "dev" ];
|
||||
|
||||
configureFlags = [
|
||||
"--enable-idl"
|
||||
"--enable-secure-api"
|
||||
];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
buildInputs = [ windows.mingw_w64_headers ];
|
||||
dontStrip = true;
|
||||
hardeningDisable = [ "stackprotector" "fortify" ];
|
||||
|
Loading…
Reference in New Issue
Block a user