git.iko.soy/typeable/nixpkgs
on master help sign in
mingw-w64 libc: Multiple outputs and parallel builds

Also deduplicate more of the GCC derivations.

commit999ef20129cf0c4809a3d654f2378192f6b32ef1 authorJohn Ericson <git@JohnEricson.me> dateMon 11 Nov 2019, 00:08 (7 years ago) parent06c5e81
11 files changed+89−145
pkgs/development/compilers/gcc/4.8/default.nix+7−18 pkgs/development/compilers/gcc/4.9/default.nix+7−18 pkgs/development/compilers/gcc/5/default.nix+7−18 pkgs/development/compilers/gcc/6/default.nix+7−18 pkgs/development/compilers/gcc/7/default.nix+7−18 pkgs/development/compilers/gcc/8/default.nix+7−18 pkgs/development/compilers/gcc/9/default.nix+7−18 pkgs/development/compilers/gcc/common/configure-flags.nix+1−1 pkgs/development/compilers/gcc/common/extra-target-flags.nix+28 pkgs/development/compilers/gcc/snapshot/default.nix+7−18 pkgs/os-specific/windows/mingw-w64/default.nix+4
pkgs/development/compilers/gcc/4.8/default.nix+7−18
@@ -251,24 +251,13 @@ stdenv.mkDerivation ({
251251 ++ optionals javaAwtGtk [ gmp mpfr ]
252252 ));
253253
254− EXTRA_TARGET_FLAGS = optionals
255− (targetPlatform != hostPlatform && libcCross != null)
256− ([
257− "-idirafter ${getDev libcCross}${libcCross.incdir or "/include"}"
258− ] ++ optionals (! crossStageStatic) [
259− "-B${libcCross.out}${libcCross.libdir or "/lib"}"
260− ]);
261−
262− EXTRA_TARGET_LDFLAGS = optionals
263− (targetPlatform != hostPlatform && libcCross != null)
264− ([
265− "-Wl,-L${libcCross.out}${libcCross.libdir or "/lib"}"
266− ] ++ (if crossStageStatic then [
267− "-B${libcCross.out}${libcCross.libdir or "/lib"}"
268− ] else [
269− "-Wl,-rpath,${libcCross.out}${libcCross.libdir or "/lib"}"
270− "-Wl,-rpath-link,${libcCross.out}${libcCross.libdir or "/lib"}"
271− ]));
254+ inherit
255+ (import ../common/extra-target-flags.nix {
256+ inherit stdenv crossStageStatic libcCross;
257+ })
258+ EXTRA_TARGET_FLAGS
259+ EXTRA_TARGET_LDFLAGS
260+ ;
272261
273262 passthru = {
274263 inherit langC langCC langObjC langObjCpp langFortran langGo version;
pkgs/development/compilers/gcc/4.9/default.nix+7−18
@@ -257,24 +257,13 @@ stdenv.mkDerivation ({
257257 ++ optionals javaAwtGtk [ gmp mpfr ]
258258 ));
259259
260− EXTRA_TARGET_FLAGS = optionals
261− (targetPlatform != hostPlatform && libcCross != null)
262− ([
263− "-idirafter ${getDev libcCross}${libcCross.incdir or "/include"}"
264− ] ++ optionals (! crossStageStatic) [
265− "-B${libcCross.out}${libcCross.libdir or "/lib"}"
266− ]);
267−
268− EXTRA_TARGET_LDFLAGS = optionals
269− (targetPlatform != hostPlatform && libcCross != null)
270− ([
271− "-Wl,-L${libcCross.out}${libcCross.libdir or "/lib"}"
272− ] ++ (if crossStageStatic then [
273− "-B${libcCross.out}${libcCross.libdir or "/lib"}"
274− ] else [
275− "-Wl,-rpath,${libcCross.out}${libcCross.libdir or "/lib"}"
276− "-Wl,-rpath-link,${libcCross.out}${libcCross.libdir or "/lib"}"
277− ]));
260+ inherit
261+ (import ../common/extra-target-flags.nix {
262+ inherit stdenv crossStageStatic libcCross;
263+ })
264+ EXTRA_TARGET_FLAGS
265+ EXTRA_TARGET_LDFLAGS
266+ ;
278267
279268 passthru = {
280269 inherit langC langCC langObjC langObjCpp langFortran langGo version;
pkgs/development/compilers/gcc/5/default.nix+7−18
@@ -264,24 +264,13 @@ stdenv.mkDerivation ({
264264 ++ optionals javaAwtGtk [ gmp mpfr ]
265265 ));
266266
267− EXTRA_TARGET_FLAGS = optionals
268− (targetPlatform != hostPlatform && libcCross != null)
269− ([
270− "-idirafter ${getDev libcCross}${libcCross.incdir or "/include"}"
271− ] ++ optionals (! crossStageStatic) [
272− "-B${libcCross.out}${libcCross.libdir or "/lib"}"
273− ]);
274−
275− EXTRA_TARGET_LDFLAGS = optionals
276− (targetPlatform != hostPlatform && libcCross != null)
277− ([
278− "-Wl,-L${libcCross.out}${libcCross.libdir or "/lib"}"
279− ] ++ (if crossStageStatic then [
280− "-B${libcCross.out}${libcCross.libdir or "/lib"}"
281− ] else [
282− "-Wl,-rpath,${libcCross.out}${libcCross.libdir or "/lib"}"
283− "-Wl,-rpath-link,${libcCross.out}${libcCross.libdir or "/lib"}"
284− ]));
267+ inherit
268+ (import ../common/extra-target-flags.nix {
269+ inherit stdenv crossStageStatic libcCross;
270+ })
271+ EXTRA_TARGET_FLAGS
272+ EXTRA_TARGET_LDFLAGS
273+ ;
285274
286275 passthru = {
287276 inherit langC langCC langObjC langObjCpp langFortran langGo version;
pkgs/development/compilers/gcc/6/default.nix+7−18
@@ -266,24 +266,13 @@ stdenv.mkDerivation ({
266266 ++ optionals javaAwtGtk [ gmp mpfr ]
267267 ));
268268
269− EXTRA_TARGET_FLAGS = optionals
270− (targetPlatform != hostPlatform && libcCross != null)
271− ([
272− "-idirafter ${getDev libcCross}${libcCross.incdir or "/include"}"
273− ] ++ optionals (! crossStageStatic) [
274− "-B${libcCross.out}${libcCross.libdir or "/lib"}"
275− ]);
276−
277− EXTRA_TARGET_LDFLAGS = optionals
278− (targetPlatform != hostPlatform && libcCross != null)
279− ([
280− "-Wl,-L${libcCross.out}${libcCross.libdir or "/lib"}"
281− ] ++ (if crossStageStatic then [
282− "-B${libcCross.out}${libcCross.libdir or "/lib"}"
283− ] else [
284− "-Wl,-rpath,${libcCross.out}${libcCross.libdir or "/lib"}"
285− "-Wl,-rpath-link,${libcCross.out}${libcCross.libdir or "/lib"}"
286− ]));
269+ inherit
270+ (import ../common/extra-target-flags.nix {
271+ inherit stdenv crossStageStatic libcCross;
272+ })
273+ EXTRA_TARGET_FLAGS
274+ EXTRA_TARGET_LDFLAGS
275+ ;
287276
288277 passthru = {
289278 inherit langC langCC langObjC langObjCpp langFortran langGo version;
pkgs/development/compilers/gcc/7/default.nix+7−18
@@ -230,24 +230,13 @@ stdenv.mkDerivation ({
230230
231231 LIBRARY_PATH = optionals (targetPlatform == hostPlatform) (makeLibraryPath (optional (zlib != null) zlib));
232232
233− EXTRA_TARGET_FLAGS = optionals
234− (targetPlatform != hostPlatform && libcCross != null)
235− ([
236− "-idirafter ${getDev libcCross}${libcCross.incdir or "/include"}"
237− ] ++ optionals (! crossStageStatic) [
238− "-B${libcCross.out}${libcCross.libdir or "/lib"}"
239− ]);
240−
241− EXTRA_TARGET_LDFLAGS = optionals
242− (targetPlatform != hostPlatform && libcCross != null)
243− ([
244− "-Wl,-L${libcCross.out}${libcCross.libdir or "/lib"}"
245− ] ++ (if crossStageStatic then [
246− "-B${libcCross.out}${libcCross.libdir or "/lib"}"
247− ] else [
248− "-Wl,-rpath,${libcCross.out}${libcCross.libdir or "/lib"}"
249− "-Wl,-rpath-link,${libcCross.out}${libcCross.libdir or "/lib"}"
250− ]));
233+ inherit
234+ (import ../common/extra-target-flags.nix {
235+ inherit stdenv crossStageStatic libcCross;
236+ })
237+ EXTRA_TARGET_FLAGS
238+ EXTRA_TARGET_LDFLAGS
239+ ;
251240
252241 passthru = {
253242 inherit langC langCC langObjC langObjCpp langFortran langGo version;
pkgs/development/compilers/gcc/8/default.nix+7−18
@@ -212,24 +212,13 @@ stdenv.mkDerivation ({
212212
213213 LIBRARY_PATH = optionals (targetPlatform == hostPlatform) (makeLibraryPath (optional (zlib != null) zlib));
214214
215− EXTRA_TARGET_FLAGS = optionals
216− (targetPlatform != hostPlatform && libcCross != null)
217− ([
218− "-idirafter ${getDev libcCross}${libcCross.incdir or "/include"}"
219− ] ++ optionals (! crossStageStatic) [
220− "-B${libcCross.out}${libcCross.libdir or "/lib"}"
221− ]);
222−
223− EXTRA_TARGET_LDFLAGS = optionals
224− (targetPlatform != hostPlatform && libcCross != null)
225− ([
226− "-Wl,-L${libcCross.out}${libcCross.libdir or "/lib"}"
227− ] ++ (if crossStageStatic then [
228− "-B${libcCross.out}${libcCross.libdir or "/lib"}"
229− ] else [
230− "-Wl,-rpath,${libcCross.out}${libcCross.libdir or "/lib"}"
231− "-Wl,-rpath-link,${libcCross.out}${libcCross.libdir or "/lib"}"
232− ]));
215+ inherit
216+ (import ../common/extra-target-flags.nix {
217+ inherit stdenv crossStageStatic libcCross;
218+ })
219+ EXTRA_TARGET_FLAGS
220+ EXTRA_TARGET_LDFLAGS
221+ ;
233222
234223 passthru = {
235224 inherit langC langCC langObjC langObjCpp langFortran langGo version;
pkgs/development/compilers/gcc/9/default.nix+7−18
@@ -211,24 +211,13 @@ stdenv.mkDerivation ({
211211
212212 LIBRARY_PATH = optionals (targetPlatform == hostPlatform) (makeLibraryPath (optional (zlib != null) zlib));
213213
214− EXTRA_TARGET_FLAGS = optionals
215− (targetPlatform != hostPlatform && libcCross != null)
216− ([
217− "-idirafter ${getDev libcCross}${libcCross.incdir or "/include"}"
218− ] ++ optionals (! crossStageStatic) [
219− "-B${libcCross.out}${libcCross.libdir or "/lib"}"
220− ]);
221−
222− EXTRA_TARGET_LDFLAGS = optionals
223− (targetPlatform != hostPlatform && libcCross != null)
224− ([
225− "-Wl,-L${libcCross.out}${libcCross.libdir or "/lib"}"
226− ] ++ (if crossStageStatic then [
227− "-B${libcCross.out}${libcCross.libdir or "/lib"}"
228− ] else [
229− "-Wl,-rpath,${libcCross.out}${libcCross.libdir or "/lib"}"
230− "-Wl,-rpath-link,${libcCross.out}${libcCross.libdir or "/lib"}"
231− ]));
214+ inherit
215+ (import ../common/extra-target-flags.nix {
216+ inherit stdenv crossStageStatic libcCross;
217+ })
218+ EXTRA_TARGET_FLAGS
219+ EXTRA_TARGET_LDFLAGS
220+ ;
232221
233222 passthru = {
234223 inherit langC langCC langObjC langObjCpp langFortran langGo version;
pkgs/development/compilers/gcc/common/configure-flags.nix+1−1
@@ -49,7 +49,7 @@ let
4949 "--disable-decimal-float" # requires libc
5050 "--disable-libmpx" # requires libc
5151 ] ++ lib.optionals crossMingw [
52− "--with-headers=${libcCross}/include"
52+ "--with-headers=${lib.getDev libcCross}/include"
5353 "--with-gcc"
5454 "--with-gnu-as"
5555 "--with-gnu-ld"
pkgs/development/compilers/gcc/common/extra-target-flags.nixnew file+28
@@ -0,0 +1,28 @@
1+{ stdenv, crossStageStatic, libcCross }:
2+
3+let
4+ inherit (stdenv) lib hostPlatform targetPlatform;
5+in
6+
7+{
8+ EXTRA_TARGET_FLAGS = let
9+ mkFlags = dep: lib.optionals (targetPlatform != hostPlatform && dep != null) ([
10+ "-idirafter ${lib.getDev dep}${dep.incdir or "/include"}"
11+ ] ++ stdenv.lib.optionals (! crossStageStatic) [
12+ "-B${lib.getLib dep}${dep.libdir or "/lib"}"
13+ ]);
14+ in mkFlags libcCross
15+ ;
16+
17+ EXTRA_TARGET_LDFLAGS = let
18+ mkFlags = dep: lib.optionals (targetPlatform != hostPlatform && dep != null) ([
19+ "-Wl,-L${lib.getLib dep}${dep.libdir or "/lib"}"
20+ ] ++ (if crossStageStatic then [
21+ "-B${lib.getLib dep}${dep.libdir or "/lib"}"
22+ ] else [
23+ "-Wl,-rpath,${lib.getLib dep}${dep.libdir or "/lib"}"
24+ "-Wl,-rpath-link,${lib.getLib dep}${dep.libdir or "/lib"}"
25+ ]));
26+ in mkFlags libcCross
27+ ;
28+}
pkgs/development/compilers/gcc/snapshot/default.nix+7−18
@@ -184,24 +184,13 @@ stdenv.mkDerivation ({
184184
185185 LIBRARY_PATH = optionals (targetPlatform == hostPlatform) (makeLibraryPath (optional (zlib != null) zlib));
186186
187− EXTRA_TARGET_FLAGS = optionals
188− (targetPlatform != hostPlatform && libcCross != null)
189− ([
190− "-idirafter ${getDev libcCross}${libcCross.incdir or "/include"}"
191− ] ++ optionals (! crossStageStatic) [
192− "-B${libcCross.out}${libcCross.libdir or "/lib"}"
193− ]);
194−
195− EXTRA_TARGET_LDFLAGS = optionals
196− (targetPlatform != hostPlatform && libcCross != null)
197− ([
198− "-Wl,-L${libcCross.out}${libcCross.libdir or "/lib"}"
199− ] ++ (if crossStageStatic then [
200− "-B${libcCross.out}${libcCross.libdir or "/lib"}"
201− ] else [
202− "-Wl,-rpath,${libcCross.out}${libcCross.libdir or "/lib"}"
203− "-Wl,-rpath-link,${libcCross.out}${libcCross.libdir or "/lib"}"
204− ]));
187+ inherit
188+ (import ../common/extra-target-flags.nix {
189+ inherit stdenv crossStageStatic libcCross;
190+ })
191+ EXTRA_TARGET_FLAGS
192+ EXTRA_TARGET_LDFLAGS
193+ ;
205194
206195 passthru = {
207196 inherit langC langCC langObjC langObjCpp langFortran langGo version;
pkgs/os-specific/windows/mingw-w64/default.nix+4
@@ -11,11 +11,15 @@ in stdenv.mkDerivation {
1111 sha256 = "00zq3z1hbzd5yzmskskjg79xrzwsqx7ihyprfaxy4hb897vf29sm";
1212 };
1313
14+ outputs = [ "out" "dev" ];
15+
1416 configureFlags = [
1517 "--enable-idl"
1618 "--enable-secure-api"
1719 ];
1820
21+ enableParallelBuilding = true;
22+
1923 buildInputs = [ windows.mingw_w64_headers ];
2024 dontStrip = true;
2125 hardeningDisable = [ "stackprotector" "fortify" ];