cc-wrapper: Use stdenvNoCC to build

cc-wrapper may wrap a cc-compiler, but it doesn't need one to build
itself. (c.f. expand-response-params is a separate derivation.) This
helps avoid cycles on the cross stuff, in addition to removing a
useless dependency edge.

I could have been super careful with overrides in the stdenv to avoid
the mass rebuild, but I don't think it's worth it.

+18 -19
+4 -3
pkgs/build-support/cc-wrapper/default.nix
··· 5 5 # script that sets up the right environment variables so that the 6 6 # compiler and the linker just "work". 7 7 8 - { name ? "", stdenv, nativeTools, noLibc ? false, nativeLibc, nativePrefix ? "" 9 - , cc ? null, libc ? null, binutils ? null, coreutils ? null, shell ? stdenv.shell 8 + { name ? "", stdenvNoCC, nativeTools, noLibc ? false, nativeLibc, nativePrefix ? "" 9 + , cc ? null, libc ? null, binutils ? null, coreutils ? null, shell ? stdenvNoCC.shell 10 10 , zlib ? null, extraPackages ? [], extraBuildCommands ? "" 11 11 , isGNU ? false, isClang ? cc.isClang or false, gnugrep ? null 12 12 , buildPackages ? {} 13 13 , useMacosReexportHack ? false 14 14 }: 15 15 16 - with stdenv.lib; 16 + with stdenvNoCC.lib; 17 17 18 18 assert nativeTools -> nativePrefix != ""; 19 19 assert !nativeTools -> ··· 25 25 assert cc.langVhdl or false -> zlib != null; 26 26 27 27 let 28 + stdenv = stdenvNoCC; 28 29 inherit (stdenv) hostPlatform targetPlatform; 29 30 30 31 # Prefix for binaries. Customarily ends with a dash separator.
+2 -2
pkgs/stdenv/darwin/default.nix
··· 77 77 78 78 cc = if isNull last then "/dev/null" else import ../../build-support/cc-wrapper { 79 79 inherit shell; 80 - inherit (last) stdenv; 80 + inherit (last) stdenvNoCC; 81 81 82 82 nativeTools = false; 83 83 nativeLibc = false; ··· 324 324 shell = "${pkgs.bash}/bin/bash"; 325 325 326 326 cc = lib.callPackageWith {} ../../build-support/cc-wrapper { 327 - inherit (pkgs) stdenv; 327 + inherit (pkgs) stdenvNoCC; 328 328 inherit shell; 329 329 nativeTools = false; 330 330 nativeLibc = false;
+1 -1
pkgs/stdenv/freebsd/default.nix
··· 77 77 nativeTools = true; 78 78 nativePrefix = "/usr"; 79 79 nativeLibc = true; 80 - inherit (prevStage) stdenv; 80 + stdenvNoCC = prevStage.stdenv; 81 81 cc = { 82 82 name = "clang-9.9.9"; 83 83 cc = "/usr";
+2 -2
pkgs/stdenv/linux/default.nix
··· 84 84 libc = prevStage.glibc; 85 85 inherit (prevStage) binutils coreutils gnugrep; 86 86 name = name; 87 - stdenv = prevStage.ccWrapperStdenv; 87 + stdenvNoCC = prevStage.ccWrapperStdenv; 88 88 }; 89 89 90 90 extraAttrs = { ··· 244 244 }; 245 245 cc = prevStage.gcc-unwrapped; 246 246 libc = self.glibc; 247 - inherit (self) stdenv binutils coreutils gnugrep; 247 + inherit (self) stdenvNoCC binutils coreutils gnugrep; 248 248 name = ""; 249 249 shell = self.bash + "/bin/bash"; 250 250 };
+2 -1
pkgs/stdenv/native/default.nix
··· 117 117 cc = null; 118 118 fetchurl = null; 119 119 }; 120 + stdenvNoCC = stdenv; 120 121 121 122 cc = import ../../build-support/cc-wrapper { 122 123 name = "cc-native"; ··· 126 127 "i686-solaris" = "/usr/gnu"; 127 128 "x86_64-solaris" = "/opt/local/gcc47"; 128 129 }.${system} or "/usr"; 129 - inherit stdenv; 130 + inherit stdenvNoCC; 130 131 }; 131 132 132 133 fetchurl = import ../../build-support/fetchurl {
+5 -8
pkgs/stdenv/nix/default.nix
··· 1 1 { lib 2 - , crossSystem, config 2 + , crossSystem, config, overlays 3 3 , bootStages 4 4 , ... 5 5 }: ··· 7 7 assert crossSystem == null; 8 8 9 9 bootStages ++ [ 10 - (prevStage: let 11 - inherit (prevStage) stdenv; 12 - in { 10 + (prevStage: { 13 11 inherit config overlays; 14 12 15 13 stdenv = import ../generic rec { ··· 27 25 28 26 cc = import ../../build-support/cc-wrapper { 29 27 nativeTools = false; 30 - nativePrefix = stdenv.lib.optionalString hostPlatform.isSunOS "/usr"; 28 + nativePrefix = lib.optionalString hostPlatform.isSunOS "/usr"; 31 29 nativeLibc = true; 32 - inherit stdenv; 33 - inherit (prevStage) binutils coreutils gnugrep; 30 + inherit (prevStage) stdenvNoCC binutils coreutils gnugrep; 34 31 cc = prevStage.gcc.cc; 35 32 isGNU = true; 36 33 shell = prevStage.bash + "/bin/sh"; ··· 38 35 39 36 shell = prevStage.bash + "/bin/sh"; 40 37 41 - fetchurlBoot = stdenv.fetchurlBoot; 38 + fetchurlBoot = prevStage.stdenv.fetchurlBoot; 42 39 43 40 overrides = self: super: { 44 41 inherit cc;
+2 -2
pkgs/top-level/all-packages.nix
··· 6207 6207 6208 6208 wla-dx = callPackage ../development/compilers/wla-dx { }; 6209 6209 6210 - wrapCCWith = { name ? "", cc, libc, extraBuildCommands ? "" }: ccWrapperFun { 6210 + wrapCCWith = { name ? "", cc, libc, extraBuildCommands ? "" }: ccWrapperFun rec { 6211 6211 nativeTools = targetPlatform == hostPlatform && stdenv.cc.nativeTools or false; 6212 6212 nativeLibc = targetPlatform == hostPlatform && stdenv.cc.nativeLibc or false; 6213 6213 nativePrefix = stdenv.cc.nativePrefix or ""; 6214 - noLibc = (libc == null); 6214 + noLibc = !nativeLibc && (libc == null); 6215 6215 6216 6216 isGNU = cc.isGNU or false; 6217 6217 isClang = cc.isClang or false;