Clean up cross bootstrapping

For a long time, we've had `crossLibcStdenv`, `*Cross` libc attributes,
and `*bsdCross` pre-libc package sets. This was always bad because
having "cross" things is "not declarative": the naming doesn't reflect
what packages *need* but rather how we *provide* something. This is
ugly, and creates needless friction between cross and native building.

Now, almost all of these `*Cross` attributes are gone: just these are
kept:

- Glibc's and Musl's are kept, because those packages are widely used
and I didn't want to risk changing the native builds of those at this
time.

- generic `libcCross`, `theadsCross`, and friends, because these relate
to the convolulted GCC bootstrap which still needs to be redone.

The BSD and obscure Linux or freestnanding libcs have conversely all
been made to use a new `stdenvNoLibc`, which is like the old
`crossLibcStdenv` except:

1. It usable for native and cross alike

2. It named according to what it *is* ("a standard environment without
libc but with a C compiler"), rather than some non-compositional
jargon ("the stdenv used for building libc when cross compiling",
yuck).

I should have done this change long ago, but I was stymied because of
"infinite recursions". The problem was that in too many cases we are
overriding `stdenv` to *remove* things we don't need, and this risks
cyles since those more minimal stdenvs are used to build things in the
more maximal stdenvs.

The solution is to pass `stage.nix` `stdenvNoCC`, so we can override to
*build up* rather than *tear down*. For now, the full `stdenv` is also
passed, so I don't need to change the native bootstraps, but I can see
this changing as we make things more uniform and clean those up.

(adapted from commit 51f1ecaa59a3b7c182b24e71a3176c83d6cd601e)
(adapted from commit 1743662e55669081056743f22f6e616588061cba)

+101 -101
+4 -4
pkgs/build-support/bintools-wrapper/default.nix
··· 10 10 , stdenvNoCC 11 11 , runtimeShell 12 12 , bintools ? null, libc ? null, coreutils ? null, gnugrep ? null 13 - , netbsd ? null, netbsdCross ? null 13 + , netbsd ? null 14 14 , sharedLibraryLoader ? 15 15 if libc == null then 16 16 null 17 17 else if stdenvNoCC.targetPlatform.isNetBSD then 18 - if !(targetPackages ? netbsdCross) then 18 + if !(targetPackages ? netbsd) then 19 19 netbsd.ld_elf_so 20 - else if libc != targetPackages.netbsdCross.headers then 21 - targetPackages.netbsdCross.ld_elf_so 20 + else if libc != targetPackages.netbsd.headers then 21 + targetPackages.netbsd.ld_elf_so 22 22 else 23 23 null 24 24 else
+2 -1
pkgs/by-name/uc/uclibc-ng/package.nix
··· 1 1 { lib 2 - , stdenv 2 + , stdenvNoLibc 3 3 , buildPackages 4 4 , fetchurl 5 5 , gitUpdater ··· 9 9 }: 10 10 11 11 let 12 + stdenv = stdenvNoLibc; 12 13 isCross = (stdenv.buildPlatform != stdenv.hostPlatform); 13 14 configParser = '' 14 15 function parseconfig {
+2 -2
pkgs/development/misc/or1k/newlib.nix
··· 1 - { stdenv, fetchFromGitHub, crossLibcStdenv, buildPackages }: 1 + { stdenv, fetchFromGitHub, stdenvNoLibc, buildPackages }: 2 2 3 - crossLibcStdenv.mkDerivation { 3 + stdenvNoLibc.mkDerivation { 4 4 name = "newlib"; 5 5 src = fetchFromGitHub { 6 6 owner = "openrisc";
+2 -2
pkgs/development/misc/vc4/newlib.nix
··· 1 - { stdenv, texinfo, flex, bison, fetchFromGitHub, crossLibcStdenv, buildPackages }: 1 + { stdenv, texinfo, flex, bison, fetchFromGitHub, stdenvNoLibc, buildPackages }: 2 2 3 - crossLibcStdenv.mkDerivation { 3 + stdenvNoLibc.mkDerivation { 4 4 name = "newlib"; 5 5 src = fetchFromGitHub { 6 6 owner = "itszor";
+2 -2
pkgs/os-specific/bsd/freebsd/pkgs/mkDerivation.nix
··· 2 2 lib, 3 3 stdenv, 4 4 stdenvNoCC, 5 - stdenvNoLibs, 5 + stdenvNoLibc, 6 6 overrideCC, 7 7 buildPackages, 8 8 stdenvNoLibcxx ? overrideCC stdenv buildPackages.llvmPackages.clangNoLibcxx, ··· 28 28 if attrs.noCC or false then 29 29 stdenvNoCC 30 30 else if attrs.noLibc or false then 31 - stdenvNoLibs 31 + stdenvNoLibc 32 32 else if attrs.noLibcxx or false then 33 33 stdenvNoLibcxx 34 34 else
+2 -2
pkgs/os-specific/bsd/netbsd/default.nix
··· 1 1 { 2 2 lib, 3 - crossLibcStdenv, 3 + stdenvNoLibc, 4 4 stdenvNoCC, 5 5 makeScopeWithSplicing', 6 6 generateSplicesForMkScope, ··· 37 37 38 38 compatIfNeeded = lib.optional (!stdenvNoCC.hostPlatform.isNetBSD) self.compat; 39 39 40 - stdenvLibcMinimal = crossLibcStdenv.override (old: { 40 + stdenvLibcMinimal = stdenvNoLibc.override (old: { 41 41 cc = old.cc.override { 42 42 libc = self.libcMinimal; 43 43 noLibc = false;
+2 -2
pkgs/os-specific/bsd/netbsd/pkgs/mkDerivation.nix
··· 2 2 lib, 3 3 stdenv, 4 4 stdenvNoCC, 5 - crossLibcStdenv, 5 + stdenvNoLibc, 6 6 stdenvLibcMinimal, 7 7 runCommand, 8 8 rsync, ··· 28 28 if attrs.noCC or false then 29 29 stdenvNoCC 30 30 else if attrs.noLibc or false then 31 - crossLibcStdenv 31 + stdenvNoLibc 32 32 else if attrs.libcMinimal or false then 33 33 stdenvLibcMinimal 34 34 else
+2 -2
pkgs/os-specific/bsd/openbsd/default.nix
··· 1 1 { 2 2 lib, 3 - crossLibcStdenv, 3 + stdenvNoLibc, 4 4 makeScopeWithSplicing', 5 5 generateSplicesForMkScope, 6 6 buildPackages, ··· 22 22 // { 23 23 version = "7.5"; 24 24 25 - stdenvLibcMinimal = crossLibcStdenv.override (old: { 25 + stdenvLibcMinimal = stdenvNoLibc.override (old: { 26 26 cc = old.cc.override { 27 27 libc = self.libcMinimal; 28 28 noLibc = false;
+2 -2
pkgs/os-specific/bsd/openbsd/pkgs/libcMinimal/package.nix
··· 1 1 { 2 2 lib, 3 - crossLibcStdenv, 3 + stdenvNoLibc, 4 4 mkDerivation, 5 5 fetchpatch, 6 6 bsdSetupHook, ··· 65 65 # Suppress lld >= 16 undefined version errors 66 66 # https://github.com/freebsd/freebsd-src/commit/2ba84b4bcdd6012e8cfbf8a0d060a4438623a638 67 67 env.NIX_LDFLAGS = lib.optionalString ( 68 - crossLibcStdenv.hostPlatform.linker == "lld" 68 + stdenvNoLibc.hostPlatform.linker == "lld" 69 69 ) "--undefined-version"; 70 70 71 71 makeFlags = [
+2 -2
pkgs/os-specific/bsd/openbsd/pkgs/mkDerivation.nix
··· 2 2 lib, 3 3 stdenv, 4 4 stdenvNoCC, 5 - crossLibcStdenv, 5 + stdenvNoLibc, 6 6 stdenvLibcMinimal, 7 7 runCommand, 8 8 rsync, ··· 22 22 if attrs.noCC or false then 23 23 stdenvNoCC 24 24 else if attrs.noLibc or false then 25 - crossLibcStdenv 25 + stdenvNoLibc 26 26 else if attrs.libcMinimal or false then 27 27 stdenvLibcMinimal 28 28 else
+3 -3
pkgs/os-specific/windows/default.nix
··· 1 1 { lib, stdenv, buildPackages 2 - , newScope, overrideCC, crossLibcStdenv, libcCross 2 + , newScope, overrideCC, stdenvNoLibc, libcCross 3 3 }: 4 4 5 5 lib.makeScope newScope (self: with self; { ··· 14 14 mingw_runtime = mingwrt; 15 15 16 16 mingw_w64 = callPackage ./mingw-w64 { 17 - stdenv = crossLibcStdenv; 17 + stdenv = stdenvNoLibc; 18 18 }; 19 19 20 20 # FIXME untested with llvmPackages_16 was using llvmPackages_8 21 - crossThreadsStdenv = overrideCC crossLibcStdenv 21 + crossThreadsStdenv = overrideCC stdenvNoLibc 22 22 (if stdenv.hostPlatform.useLLVM or false 23 23 then buildPackages.llvmPackages.clangNoLibcxx 24 24 else buildPackages.gccWithoutTargetLibc.override (old: {
+33 -23
pkgs/stdenv/cross/default.nix
··· 41 41 if crossSystem.isStatic 42 42 then buildPackages.stdenvAdapters.makeStatic 43 43 else lib.id; 44 + stdenvNoCC = adaptStdenv (buildPackages.stdenv.override (old: rec { 45 + buildPlatform = localSystem; 46 + hostPlatform = crossSystem; 47 + targetPlatform = crossSystem; 48 + 49 + # Prior overrides are surely not valid as packages built with this run on 50 + # a different platform, and so are disabled. 51 + overrides = _: _: {}; 52 + extraBuildInputs = [ ]; # Old ones run on wrong platform 53 + allowedRequisites = null; 54 + 55 + cc = null; 56 + hasCC = false; 57 + 58 + extraNativeBuildInputs = old.extraNativeBuildInputs 59 + ++ lib.optionals 60 + (hostPlatform.isLinux && !buildPlatform.isLinux) 61 + [ buildPackages.patchelf ] 62 + ++ lib.optional 63 + (let f = p: !p.isx86 || builtins.elem p.libc [ "musl" "wasilibc" "relibc" ] || p.isiOS || p.isGenode; 64 + in f hostPlatform && !(f buildPlatform) ) 65 + buildPackages.updateAutotoolsGnuConfigScriptsHook 66 + ; 67 + })); 44 68 in { 45 69 inherit config; 46 70 overlays = overlays ++ crossOverlays; 47 71 selfBuild = false; 72 + inherit stdenvNoCC; 48 73 stdenv = let 49 - baseStdenv = adaptStdenv (buildPackages.stdenv.override (old: rec { 50 - buildPlatform = localSystem; 51 - hostPlatform = crossSystem; 52 - targetPlatform = crossSystem; 74 + inherit (stdenvNoCC) hostPlatform targetPlatform; 75 + baseStdenv = stdenvNoCC.override { 76 + # Old ones run on wrong platform 77 + extraBuildInputs = lib.optionals hostPlatform.isDarwin [ 78 + buildPackages.targetPackages.darwin.apple_sdk.frameworks.CoreFoundation 79 + ]; 53 80 54 - # Prior overrides are surely not valid as packages built with this run on 55 - # a different platform, and so are disabled. 56 - overrides = _: _: {}; 57 - extraBuildInputs = [ ] # Old ones run on wrong platform 58 - ++ lib.optionals hostPlatform.isDarwin [ buildPackages.targetPackages.darwin.apple_sdk.frameworks.CoreFoundation ] 59 - ; 60 - allowedRequisites = null; 61 - 62 - hasCC = !targetPlatform.isGhcjs; 81 + hasCC = !stdenvNoCC.targetPlatform.isGhcjs; 63 82 64 83 cc = if crossSystem.useiOSPrebuilt or false 65 84 then buildPackages.darwin.iosSdkPkgs.clang ··· 81 100 then buildPackages.arocc 82 101 else buildPackages.gcc; 83 102 84 - extraNativeBuildInputs = old.extraNativeBuildInputs 85 - ++ lib.optionals 86 - (hostPlatform.isLinux && !buildPlatform.isLinux) 87 - [ buildPackages.patchelf ] 88 - ++ lib.optional 89 - (let f = p: !p.isx86 || builtins.elem p.libc [ "musl" "wasilibc" "relibc" ] || p.isiOS || p.isGenode; 90 - in f hostPlatform && !(f buildPlatform) ) 91 - buildPackages.updateAutotoolsGnuConfigScriptsHook 92 - ; 93 - })); 103 + }; 94 104 in if config ? replaceCrossStdenv then config.replaceCrossStdenv { inherit buildPackages baseStdenv; } else baseStdenv; 95 105 }) 96 106
+2
pkgs/stdenv/darwin/default.nix
··· 1225 1225 1226 1226 # libc++, and libc++abi do not need CoreFoundation. Avoid propagating the CF from prior 1227 1227 # stages to the final stdenv via rpath by dropping it from `extraBuildInputs`. 1228 + stdenvNoCC = super.stdenvNoCC.override { extraBuildInputs = [ ]; }; 1228 1229 stdenvNoCF = self.stdenv.override { extraBuildInputs = [ ]; }; 1229 1230 1230 1231 libcxxBootstrapStdenv = self.overrideCC stdenvNoCF ( ··· 1543 1544 1544 1545 # Don’t link anything in this stage against CF to prevent propagating CF from prior stages to 1545 1546 # the final stdenv, which happens because of the rpath hook. 1547 + stdenvNoCC = super.stdenvNoCC.override { extraBuildInputs = [ ]; }; 1546 1548 stdenv = 1547 1549 let 1548 1550 stdenvNoCF = super.stdenv.override { extraBuildInputs = [ ]; };
+10 -3
pkgs/top-level/aliases.nix
··· 138 138 auditBlasHook = throw "'auditBlasHook' has been removed since it never worked"; # Added 2024-04-02 139 139 authy = throw "'authy' has been removed since it reached end of life"; # Added 2024-04-19 140 140 avldrums-lv2 = x42-avldrums; # Added 2020-03-29 141 + avrlibcCross = avrlibc; # Added 2024-09-06 141 142 awesome-4-0 = awesome; # Added 2022-05-05 142 143 aws-env = throw "aws-env has been removed as the upstream project was unmaintained"; # Added 2024-06-11 143 144 aws-google-auth = throw "aws-google-auth has been removed as the upstream project was unmaintained"; # Added 2024-07-31 ··· 251 252 cosmic-tasks = tasks; # Added 2024-07-04 252 253 cpp-ipfs-api = cpp-ipfs-http-client; # Project has been renamed. Added 2022-05-15 253 254 crispyDoom = crispy-doom; # Added 2023-05-01 255 + crossLibcStdenv = stdenvNoLibc; # Added 2024-09-06 254 256 cryptowatch-desktop = throw "Cryptowatch Desktop was sunset on September 30th 2023 and has been removed from nixpkgs"; # Added 2023-12-22 255 257 clash = throw "'clash' has been removed, upstream gone. Consider using 'mihomo' instead."; # added 2023-11-10 256 258 clasp = clingo; # added 2022-12-22 ··· 979 981 mpd_clientlib = libmpdclient; # Added 2021-02-11 980 982 mpdevil = plattenalbum; # Added 2024-05-22 981 983 mpg321 = throw "'mpg321' has been removed due to it being unmaintained by upstream. Consider using mpg123 instead."; # Added 2024-05-10 984 + msp430NewlibCross = msp430Newlib; # Added 2024-09-06 982 985 mumble_git = throw "'mumble_git' has been renamed to/replaced by 'pkgs.mumble'"; # Converted to throw 2023-09-10 983 986 murmur_git = throw "'murmur_git' has been renamed to/replaced by 'pkgs.murmur'"; # Converted to throw 2023-09-10 984 987 mutt-with-sidebar = mutt; # Added 2022-09-17 ··· 1010 1013 nagiosPluginsOfficial = monitoring-plugins; 1011 1014 neochat = libsForQt5.kdeGear.neochat; # added 2022-05-10 1012 1015 neoload = throw "'neoload' has been removed as it is broken and unmaintained"; # Added 2024-03-02 1016 + newlibCross = newlib; # Added 2024-09-06 1017 + newlib-nanoCross = newlib-nano; # Added 2024-09-06 1013 1018 nitrokey-udev-rules = libnitrokey; # Added 2023-03-25 1014 1019 nix-direnv-flakes = nix-direnv; 1015 1020 nix-repl = throw ( ··· 1487 1492 uberwriter = apostrophe; # Added 2020-04-23 1488 1493 ubootBeagleboneBlack = ubootAmx335xEVM; # Added 2020-01-21 1489 1494 ubuntu_font_family = ubuntu-classic; # Added 2024-02-19 1495 + uclibc = uclibc-ng; # Added 2022-06-16 1496 + uclibcCross = uclibc-ng; # Added 2022-06-16 1490 1497 ue4 = throw "ue4 has been removed, because the package was broken for years"; # Added 2023-11-22 1491 1498 uefi-firmware-parser = throw "The uefi-firmware-parser package was dropped since it was unmaintained."; # Added 2024-06-21 1492 1499 uhd3_5 = throw "uhd3_5 has been removed, because it was no longer needed"; # Added 2023-10-07 ··· 1636 1643 inherit (stdenv.hostPlatform) system; # Added 2021-10-22 1637 1644 inherit (stdenv) buildPlatform hostPlatform targetPlatform; # Added 2023-01-09 1638 1645 1639 - freebsdCross = freebsd; # Added 2024-06-18 1640 - netbsdCross = netbsd; # Added 2024-06-18 1641 - openbsdCross = openbsd; # Added 2024-06-18 1646 + freebsdCross = freebsd; # Added 2024-09-06 1647 + netbsdCross = netbsd; # Added 2024-09-06 1648 + openbsdCross = openbsd; # Added 2024-09-06 1642 1649 1643 1650 # LLVM packages for (integration) testing that should not be used inside Nixpkgs: 1644 1651 llvmPackages_latest = llvmPackages_18;
+26 -50
pkgs/top-level/all-packages.nix
··· 31 31 # it's just the plain stdenv. 32 32 stdenv_32bit = lowPrio (if stdenv.hostPlatform.is32bit then stdenv else multiStdenv); 33 33 34 - stdenvNoCC = stdenv.override ( 35 - { cc = null; hasCC = false; } 36 - 37 - // lib.optionalAttrs (stdenv.hostPlatform.isDarwin && (stdenv.hostPlatform != stdenv.buildPlatform)) { 38 - # TODO: This is a hack to use stdenvNoCC to produce a CF when cross 39 - # compiling. It's not very sound. The cross stdenv has: 40 - # extraBuildInputs = [ targetPackages.darwin.apple_sdks.frameworks.CoreFoundation ] 41 - # and uses stdenvNoCC. In order to make this not infinitely recursive, we 42 - # need to exclude this extraBuildInput. 43 - extraBuildInputs = []; 44 - } 45 - ); 46 - 47 34 mkStdenvNoLibs = stdenv: let 48 35 bintools = stdenv.cc.bintools.override { 49 36 libc = null; ··· 61 48 }; 62 49 63 50 stdenvNoLibs = 64 - if stdenvNoCC.hostPlatform != stdenvNoCC.buildPlatform && (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.useLLVM or false) 51 + if stdenvNoCC.hostPlatform != stdenvNoCC.buildPlatform 65 52 then 66 53 # We cannot touch binutils or cc themselves, because that will cause 67 54 # infinite recursion. So instead, we just choose a libc based on the ··· 74 61 # thing to to create an earlier thing (leading to infinite recursion) and 75 62 # we also would still respect the stage arguments choices for these 76 63 # things. 77 - overrideCC stdenv buildPackages.llvmPackages.clangNoCompilerRt 64 + (if stdenvNoCC.hostPlatform.isDarwin || stdenvNoCC.hostPlatform.useLLVM or false 65 + then overrideCC stdenvNoCC buildPackages.llvmPackages.clangNoCompilerRt 66 + else gccCrossLibcStdenv) 67 + else mkStdenvNoLibs stdenv; 68 + 69 + stdenvNoLibc = 70 + if stdenvNoCC.hostPlatform != stdenvNoCC.buildPlatform 71 + then 72 + (if stdenvNoCC.hostPlatform.isDarwin || stdenvNoCC.hostPlatform.useLLVM or false 73 + then overrideCC stdenvNoCC buildPackages.llvmPackages.clangNoLibc 74 + else gccCrossLibcStdenv) 78 75 else mkStdenvNoLibs stdenv; 79 76 80 77 gccStdenvNoLibs = mkStdenvNoLibs gccStdenv; ··· 15109 15106 15110 15107 gccCrossLibcStdenv = overrideCC stdenvNoCC buildPackages.gccWithoutTargetLibc; 15111 15108 15112 - crossLibcStdenv = 15113 - if stdenv.hostPlatform.useLLVM or false || stdenv.hostPlatform.isDarwin 15114 - then overrideCC stdenv buildPackages.llvmPackages.clangNoLibc 15115 - else gccCrossLibcStdenv; 15116 - 15117 15109 # The GCC used to build libc for the target platform. Normal gccs will be 15118 15110 # built with, and use, that cross-compiled libc. 15119 15111 gccWithoutTargetLibc = assert stdenv.targetPlatform != stdenv.hostPlatform; let ··· 17157 17149 17158 17150 h3 = h3_3; 17159 17151 17160 - avrlibc = callPackage ../development/misc/avr/libc { }; 17161 - avrlibcCross = callPackage ../development/misc/avr/libc { 17162 - stdenv = crossLibcStdenv; 17152 + avrlibc = callPackage ../development/misc/avr/libc { 17153 + stdenv = stdenvNoLibc; 17163 17154 }; 17164 17155 17165 17156 avr8burnomat = callPackage ../development/misc/avr8-burn-omat { }; ··· 17233 17224 17234 17225 msp430GccSupport = callPackage ../development/misc/msp430/gcc-support.nix { }; 17235 17226 17236 - msp430Newlib = callPackage ../development/misc/msp430/newlib.nix { }; 17237 - msp430NewlibCross = callPackage ../development/misc/msp430/newlib.nix { 17238 - newlib = newlibCross; 17239 - }; 17227 + msp430Newlib = callPackage ../development/misc/msp430/newlib.nix { }; 17240 17228 17241 17229 mspds = callPackage ../development/misc/msp430/mspds { }; 17242 17230 mspds-bin = callPackage ../development/misc/msp430/mspds/binary.nix { }; ··· 20413 20401 }; 20414 20402 20415 20403 muslCross = musl.override { 20416 - stdenv = crossLibcStdenv; 20404 + stdenv = stdenvNoLibc; 20417 20405 }; 20418 20406 20419 20407 # These are used when buiding compiler-rt / libgcc, prior to building libc. 20420 20408 preLibcCrossHeaders = let 20421 20409 inherit (stdenv.targetPlatform) libc; 20422 20410 in if stdenv.targetPlatform.isMinGW then targetPackages.windows.mingw_w64_headers or windows.mingw_w64_headers 20423 - else if libc == "nblibc" then targetPackages.netbsdCross.headers or netbsdCross.headers 20411 + else if libc == "nblibc" then targetPackages.netbsd.headers or netbsd.headers 20424 20412 else if libc == "libSystem" && stdenv.targetPlatform.isAarch64 then targetPackages.darwin.LibsystemCross or darwin.LibsystemCross 20425 20413 else null; 20426 20414 ··· 20431 20419 /**/ if name == null then null 20432 20420 else if name == "glibc" then targetPackages.glibcCross or glibcCross 20433 20421 else if name == "bionic" then targetPackages.bionic or bionic 20434 - else if name == "uclibc" then targetPackages.uclibcCross or uclibcCross 20435 - else if name == "avrlibc" then targetPackages.avrlibcCross or avrlibcCross 20436 - else if name == "newlib" && stdenv.targetPlatform.isMsp430 then targetPackages.msp430NewlibCross or msp430NewlibCross 20422 + else if name == "uclibc" then targetPackages.uclibc or uclibc 20423 + else if name == "avrlibc" then targetPackages.avrlibc or avrlibc 20424 + else if name == "newlib" && stdenv.targetPlatform.isMsp430 then targetPackages.msp430Newlib or msp430Newlib 20437 20425 else if name == "newlib" && stdenv.targetPlatform.isVc4 then targetPackages.vc4-newlib or vc4-newlib 20438 20426 else if name == "newlib" && stdenv.targetPlatform.isOr1k then targetPackages.or1k-newlib or or1k-newlib 20439 - else if name == "newlib" then targetPackages.newlibCross or newlibCross 20440 - else if name == "newlib-nano" then targetPackages.newlib-nanoCross or newlib-nanoCross 20427 + else if name == "newlib" then targetPackages.newlib or newlib 20428 + else if name == "newlib-nano" then targetPackages.newlib-nano or newlib-nano 20441 20429 else if name == "musl" then targetPackages.muslCross or muslCross 20442 20430 else if name == "msvcrt" then targetPackages.windows.mingw_w64 or windows.mingw_w64 20443 20431 else if name == "ucrt" then targetPackages.windows.mingw_w64 or windows.mingw_w64 ··· 20463 20451 }; 20464 20452 20465 20453 wasilibc = callPackage ../development/libraries/wasilibc { 20466 - stdenv = crossLibcStdenv; 20454 + stdenv = stdenvNoLibc; 20467 20455 }; 20468 20456 20469 20457 relibc = callPackage ../development/libraries/relibc { }; ··· 27415 27403 inherit (callPackage ../misc/barebox {}) 27416 27404 buildBarebox 27417 27405 bareboxTools; 27418 - 27419 - uclibc-ng-cross = uclibc-ng.override { 27420 - stdenv = crossLibcStdenv; 27421 - }; 27422 - 27423 - # Aliases 27424 - uclibc = uclibc-ng; 27425 - uclibcCross = uclibc-ng-cross; 27426 27406 27427 27407 eudev = callPackage ../by-name/eu/eudev/package.nix { 27428 27408 util-linux = util-linuxMinimal; ··· 39778 39758 39779 39759 new-session-manager = callPackage ../applications/audio/new-session-manager { }; 39780 39760 39781 - newlib = callPackage ../development/misc/newlib { }; 39782 - newlibCross = callPackage ../development/misc/newlib { 39783 - stdenv = crossLibcStdenv; 39761 + newlib = callPackage ../development/misc/newlib { 39762 + stdenv = stdenvNoLibc; 39784 39763 }; 39785 39764 39786 39765 newlib-nano = callPackage ../development/misc/newlib { 39766 + stdenv = stdenvNoLibc; 39787 39767 nanoizeNewlib = true; 39788 - }; 39789 - newlib-nanoCross = callPackage ../development/misc/newlib { 39790 - nanoizeNewlib = true; 39791 - stdenv = crossLibcStdenv; 39792 39768 }; 39793 39769 39794 39770 omnisharp-roslyn = callPackage ../development/tools/omnisharp-roslyn { };
+5 -1
pkgs/top-level/stage.nix
··· 49 49 , # The standard environment to use for building packages. 50 50 stdenv 51 51 52 + , # `stdenv` without a C compiler. Passing in this helps avoid infinite 53 + # recursions, and may eventually replace passing in the full stdenv. 54 + stdenvNoCC ? stdenv.override { cc = null; hasCC = false; } 55 + 52 56 , # This is used because stdenv replacement and the stdenvCross do benefit from 53 57 # the overridden configuration provided by the user, as opposed to the normal 54 58 # bootstrapping stdenvs. ··· 141 145 pkgs = self.pkgsHostTarget; 142 146 targetPackages = self.pkgsTargetTarget; 143 147 144 - inherit stdenv; 148 + inherit stdenv stdenvNoCC; 145 149 }; 146 150 147 151 splice = self: super: import ./splice.nix lib self (adjacentPackages != null);