diff options
Diffstat (limited to 'pkgs/stdenv/booter.nix')
-rw-r--r-- | pkgs/stdenv/booter.nix | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/pkgs/stdenv/booter.nix b/pkgs/stdenv/booter.nix index a8f8be75545c9..7364a586fc2a8 100644 --- a/pkgs/stdenv/booter.nix +++ b/pkgs/stdenv/booter.nix @@ -47,13 +47,13 @@ stageFuns: let same as let - f_-1 = lnul; + f_-1 = lnul f_0; f_0 = op f_-1 x_0 f_1; f_1 = op f_0 x_1 f_2; f_2 = op f_1 x_2 f_3; ... f_n = op f_n-1 x_n f_n+1; - f_n+1 = rnul; + f_n+1 = rnul f_n; in f_0 */ @@ -62,13 +62,15 @@ stageFuns: let len = builtins.length list; go = pred: n: if n == len - then rnul + then rnul pred else let # Note the cycle -- call-by-need ensures finite fold. cur = op pred (builtins.elemAt list n) succ; succ = go cur (n + 1); in cur; - in go lnul 0; + lapp = lnul cur; + cur = go lapp 0; + in cur; # Take the list and disallow custom overrides in all but the final stage, # and allow it in the final flag. Only defaults this boolean field if it @@ -101,4 +103,15 @@ stageFuns: let targetPackages = if args.selfBuild or true then null else nextStage; }); -in dfold folder {} {} withAllowCustomOverrides + # This is a hack for resolving cross-compiled compilers' run-time + # deps. (That is, compilers that are themselves cross-compiled, as + # opposed to used to cross-compile packages.) + postStage = buildPackages: { + __raw = true; + stdenv.cc = + if buildPackages.stdenv.cc.isClang or false + then buildPackages.clang + else buildPackages.gcc; + }; + +in dfold folder postStage (_: {}) withAllowCustomOverrides |