diff --git a/pkgs/build-support/bintools-wrapper/default.nix b/pkgs/build-support/bintools-wrapper/default.nix index 6e97d0cf00fab..b64e97345ab5c 100644 --- a/pkgs/build-support/bintools-wrapper/default.nix +++ b/pkgs/build-support/bintools-wrapper/default.nix @@ -10,15 +10,15 @@ , stdenvNoCC , runtimeShell , bintools ? null, libc ? null, coreutils ? null, gnugrep ? null -, netbsd ? null, netbsdCross ? null +, netbsd ? null , sharedLibraryLoader ? if libc == null then null else if stdenvNoCC.targetPlatform.isNetBSD then - if !(targetPackages ? netbsdCross) then + if !(targetPackages ? netbsd) then netbsd.ld_elf_so - else if libc != targetPackages.netbsdCross.headers then - targetPackages.netbsdCross.ld_elf_so + else if libc != targetPackages.netbsd.headers then + targetPackages.netbsd.ld_elf_so else null else diff --git a/pkgs/by-name/uc/uclibc-ng/package.nix b/pkgs/by-name/uc/uclibc-ng/package.nix index 10d8c5bccac43..011c6bfd8737a 100644 --- a/pkgs/by-name/uc/uclibc-ng/package.nix +++ b/pkgs/by-name/uc/uclibc-ng/package.nix @@ -1,5 +1,5 @@ { lib -, stdenv +, stdenvNoLibc , buildPackages , fetchurl , gitUpdater @@ -9,6 +9,7 @@ }: let + stdenv = stdenvNoLibc; isCross = (stdenv.buildPlatform != stdenv.hostPlatform); configParser = '' function parseconfig { diff --git a/pkgs/development/misc/or1k/newlib.nix b/pkgs/development/misc/or1k/newlib.nix index 39ddf063eacb5..7c0f0af4a21a6 100644 --- a/pkgs/development/misc/or1k/newlib.nix +++ b/pkgs/development/misc/or1k/newlib.nix @@ -1,6 +1,6 @@ -{ stdenv, fetchFromGitHub, crossLibcStdenv, buildPackages }: +{ stdenv, fetchFromGitHub, stdenvNoLibc, buildPackages }: -crossLibcStdenv.mkDerivation { +stdenvNoLibc.mkDerivation { name = "newlib"; src = fetchFromGitHub { owner = "openrisc"; diff --git a/pkgs/development/misc/vc4/newlib.nix b/pkgs/development/misc/vc4/newlib.nix index e1a8b2eeaa6a7..48efd317d4c26 100644 --- a/pkgs/development/misc/vc4/newlib.nix +++ b/pkgs/development/misc/vc4/newlib.nix @@ -1,6 +1,6 @@ -{ stdenv, texinfo, flex, bison, fetchFromGitHub, crossLibcStdenv, buildPackages }: +{ stdenv, texinfo, flex, bison, fetchFromGitHub, stdenvNoLibc, buildPackages }: -crossLibcStdenv.mkDerivation { +stdenvNoLibc.mkDerivation { name = "newlib"; src = fetchFromGitHub { owner = "itszor"; diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/mkDerivation.nix b/pkgs/os-specific/bsd/freebsd/pkgs/mkDerivation.nix index 4c2fe571999f1..302270f4ed8a5 100644 --- a/pkgs/os-specific/bsd/freebsd/pkgs/mkDerivation.nix +++ b/pkgs/os-specific/bsd/freebsd/pkgs/mkDerivation.nix @@ -2,7 +2,7 @@ lib, stdenv, stdenvNoCC, - stdenvNoLibs, + stdenvNoLibc, overrideCC, buildPackages, stdenvNoLibcxx ? overrideCC stdenv buildPackages.llvmPackages.clangNoLibcxx, @@ -28,7 +28,7 @@ lib.makeOverridable ( if attrs.noCC or false then stdenvNoCC else if attrs.noLibc or false then - stdenvNoLibs + stdenvNoLibc else if attrs.noLibcxx or false then stdenvNoLibcxx else diff --git a/pkgs/os-specific/bsd/netbsd/default.nix b/pkgs/os-specific/bsd/netbsd/default.nix index 7dff70cc4f17c..dc38be2f1d972 100644 --- a/pkgs/os-specific/bsd/netbsd/default.nix +++ b/pkgs/os-specific/bsd/netbsd/default.nix @@ -1,6 +1,6 @@ { lib, - crossLibcStdenv, + stdenvNoLibc, stdenvNoCC, makeScopeWithSplicing', generateSplicesForMkScope, @@ -37,7 +37,7 @@ makeScopeWithSplicing' { compatIfNeeded = lib.optional (!stdenvNoCC.hostPlatform.isNetBSD) self.compat; - stdenvLibcMinimal = crossLibcStdenv.override (old: { + stdenvLibcMinimal = stdenvNoLibc.override (old: { cc = old.cc.override { libc = self.libcMinimal; noLibc = false; diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/mkDerivation.nix b/pkgs/os-specific/bsd/netbsd/pkgs/mkDerivation.nix index 8605bfbfcebe2..eb010749ada14 100644 --- a/pkgs/os-specific/bsd/netbsd/pkgs/mkDerivation.nix +++ b/pkgs/os-specific/bsd/netbsd/pkgs/mkDerivation.nix @@ -2,7 +2,7 @@ lib, stdenv, stdenvNoCC, - crossLibcStdenv, + stdenvNoLibc, stdenvLibcMinimal, runCommand, rsync, @@ -28,7 +28,7 @@ lib.makeOverridable ( if attrs.noCC or false then stdenvNoCC else if attrs.noLibc or false then - crossLibcStdenv + stdenvNoLibc else if attrs.libcMinimal or false then stdenvLibcMinimal else diff --git a/pkgs/os-specific/bsd/openbsd/default.nix b/pkgs/os-specific/bsd/openbsd/default.nix index cfe594d518ed4..aa12d73079b6a 100644 --- a/pkgs/os-specific/bsd/openbsd/default.nix +++ b/pkgs/os-specific/bsd/openbsd/default.nix @@ -1,6 +1,6 @@ { lib, - crossLibcStdenv, + stdenvNoLibc, makeScopeWithSplicing', generateSplicesForMkScope, buildPackages, @@ -22,7 +22,7 @@ makeScopeWithSplicing' { // { version = "7.5"; - stdenvLibcMinimal = crossLibcStdenv.override (old: { + stdenvLibcMinimal = stdenvNoLibc.override (old: { cc = old.cc.override { libc = self.libcMinimal; noLibc = false; diff --git a/pkgs/os-specific/bsd/openbsd/pkgs/libcMinimal/package.nix b/pkgs/os-specific/bsd/openbsd/pkgs/libcMinimal/package.nix index 94fda2d905715..dfe82eff271e7 100644 --- a/pkgs/os-specific/bsd/openbsd/pkgs/libcMinimal/package.nix +++ b/pkgs/os-specific/bsd/openbsd/pkgs/libcMinimal/package.nix @@ -1,6 +1,6 @@ { lib, - crossLibcStdenv, + stdenvNoLibc, mkDerivation, fetchpatch, bsdSetupHook, @@ -65,7 +65,7 @@ mkDerivation { # Suppress lld >= 16 undefined version errors # https://github.com/freebsd/freebsd-src/commit/2ba84b4bcdd6012e8cfbf8a0d060a4438623a638 env.NIX_LDFLAGS = lib.optionalString ( - crossLibcStdenv.hostPlatform.linker == "lld" + stdenvNoLibc.hostPlatform.linker == "lld" ) "--undefined-version"; makeFlags = [ diff --git a/pkgs/os-specific/bsd/openbsd/pkgs/mkDerivation.nix b/pkgs/os-specific/bsd/openbsd/pkgs/mkDerivation.nix index 6ec9ba3429161..44709f680884d 100644 --- a/pkgs/os-specific/bsd/openbsd/pkgs/mkDerivation.nix +++ b/pkgs/os-specific/bsd/openbsd/pkgs/mkDerivation.nix @@ -2,7 +2,7 @@ lib, stdenv, stdenvNoCC, - crossLibcStdenv, + stdenvNoLibc, stdenvLibcMinimal, runCommand, rsync, @@ -22,7 +22,7 @@ lib.makeOverridable ( if attrs.noCC or false then stdenvNoCC else if attrs.noLibc or false then - crossLibcStdenv + stdenvNoLibc else if attrs.libcMinimal or false then stdenvLibcMinimal else diff --git a/pkgs/os-specific/windows/default.nix b/pkgs/os-specific/windows/default.nix index 234abcde16117..7b9bbcc52f791 100644 --- a/pkgs/os-specific/windows/default.nix +++ b/pkgs/os-specific/windows/default.nix @@ -1,5 +1,5 @@ { lib, stdenv, buildPackages -, newScope, overrideCC, crossLibcStdenv, libcCross +, newScope, overrideCC, stdenvNoLibc, libcCross }: lib.makeScope newScope (self: with self; { @@ -14,11 +14,11 @@ lib.makeScope newScope (self: with self; { mingw_runtime = mingwrt; mingw_w64 = callPackage ./mingw-w64 { - stdenv = crossLibcStdenv; + stdenv = stdenvNoLibc; }; # FIXME untested with llvmPackages_16 was using llvmPackages_8 - crossThreadsStdenv = overrideCC crossLibcStdenv + crossThreadsStdenv = overrideCC stdenvNoLibc (if stdenv.hostPlatform.useLLVM or false then buildPackages.llvmPackages.clangNoLibcxx else buildPackages.gccWithoutTargetLibc.override (old: { diff --git a/pkgs/stdenv/cross/default.nix b/pkgs/stdenv/cross/default.nix index 6babb40203954..13fb71c214ffc 100644 --- a/pkgs/stdenv/cross/default.nix +++ b/pkgs/stdenv/cross/default.nix @@ -41,25 +41,44 @@ in lib.init bootStages ++ [ if crossSystem.isStatic then buildPackages.stdenvAdapters.makeStatic else lib.id; + stdenvNoCC = adaptStdenv (buildPackages.stdenv.override (old: rec { + buildPlatform = localSystem; + hostPlatform = crossSystem; + targetPlatform = crossSystem; + + # Prior overrides are surely not valid as packages built with this run on + # a different platform, and so are disabled. + overrides = _: _: {}; + extraBuildInputs = [ ]; # Old ones run on wrong platform + allowedRequisites = null; + + cc = null; + hasCC = false; + + extraNativeBuildInputs = old.extraNativeBuildInputs + ++ lib.optionals + (hostPlatform.isLinux && !buildPlatform.isLinux) + [ buildPackages.patchelf ] + ++ lib.optional + (let f = p: !p.isx86 || builtins.elem p.libc [ "musl" "wasilibc" "relibc" ] || p.isiOS || p.isGenode; + in f hostPlatform && !(f buildPlatform) ) + buildPackages.updateAutotoolsGnuConfigScriptsHook + ; + })); in { inherit config; overlays = overlays ++ crossOverlays; selfBuild = false; + inherit stdenvNoCC; stdenv = let - baseStdenv = adaptStdenv (buildPackages.stdenv.override (old: rec { - buildPlatform = localSystem; - hostPlatform = crossSystem; - targetPlatform = crossSystem; - - # Prior overrides are surely not valid as packages built with this run on - # a different platform, and so are disabled. - overrides = _: _: {}; - extraBuildInputs = [ ] # Old ones run on wrong platform - ++ lib.optionals hostPlatform.isDarwin [ buildPackages.targetPackages.darwin.apple_sdk.frameworks.CoreFoundation ] - ; - allowedRequisites = null; + inherit (stdenvNoCC) hostPlatform targetPlatform; + baseStdenv = stdenvNoCC.override { + # Old ones run on wrong platform + extraBuildInputs = lib.optionals hostPlatform.isDarwin [ + buildPackages.targetPackages.darwin.apple_sdk.frameworks.CoreFoundation + ]; - hasCC = !targetPlatform.isGhcjs; + hasCC = !stdenvNoCC.targetPlatform.isGhcjs; cc = if crossSystem.useiOSPrebuilt or false then buildPackages.darwin.iosSdkPkgs.clang @@ -81,16 +100,7 @@ in lib.init bootStages ++ [ then buildPackages.arocc else buildPackages.gcc; - extraNativeBuildInputs = old.extraNativeBuildInputs - ++ lib.optionals - (hostPlatform.isLinux && !buildPlatform.isLinux) - [ buildPackages.patchelf ] - ++ lib.optional - (let f = p: !p.isx86 || builtins.elem p.libc [ "musl" "wasilibc" "relibc" ] || p.isiOS || p.isGenode; - in f hostPlatform && !(f buildPlatform) ) - buildPackages.updateAutotoolsGnuConfigScriptsHook - ; - })); + }; in if config ? replaceCrossStdenv then config.replaceCrossStdenv { inherit buildPackages baseStdenv; } else baseStdenv; }) diff --git a/pkgs/stdenv/darwin/default.nix b/pkgs/stdenv/darwin/default.nix index dce0de939d5ae..713a60c0a2954 100644 --- a/pkgs/stdenv/darwin/default.nix +++ b/pkgs/stdenv/darwin/default.nix @@ -1226,6 +1226,7 @@ assert bootstrapTools.passthru.isFromBootstrapFiles or false; # sanity check # libc++, and libc++abi do not need CoreFoundation. Avoid propagating the CF from prior # stages to the final stdenv via rpath by dropping it from `extraBuildInputs`. + stdenvNoCC = super.stdenvNoCC.override { extraBuildInputs = [ ]; }; stdenvNoCF = self.stdenv.override { extraBuildInputs = [ ]; }; libcxxBootstrapStdenv = self.overrideCC stdenvNoCF ( @@ -1544,6 +1545,7 @@ assert bootstrapTools.passthru.isFromBootstrapFiles or false; # sanity check # Don’t link anything in this stage against CF to prevent propagating CF from prior stages to # the final stdenv, which happens because of the rpath hook. + stdenvNoCC = super.stdenvNoCC.override { extraBuildInputs = [ ]; }; stdenv = let stdenvNoCF = super.stdenv.override { extraBuildInputs = [ ]; }; diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 8bc72301739fd..fd656feba7ae5 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -139,6 +139,7 @@ mapAliases ({ auditBlasHook = throw "'auditBlasHook' has been removed since it never worked"; # Added 2024-04-02 authy = throw "'authy' has been removed since it reached end of life"; # Added 2024-04-19 avldrums-lv2 = x42-avldrums; # Added 2020-03-29 + avrlibcCross = avrlibc; # Added 2024-09-06 awesome-4-0 = awesome; # Added 2022-05-05 aws-env = throw "aws-env has been removed as the upstream project was unmaintained"; # Added 2024-06-11 aws-google-auth = throw "aws-google-auth has been removed as the upstream project was unmaintained"; # Added 2024-07-31 @@ -254,6 +255,7 @@ mapAliases ({ cosmic-tasks = tasks; # Added 2024-07-04 cpp-ipfs-api = cpp-ipfs-http-client; # Project has been renamed. Added 2022-05-15 crispyDoom = crispy-doom; # Added 2023-05-01 + crossLibcStdenv = stdenvNoLibc; # Added 2024-09-06 cryptowatch-desktop = throw "Cryptowatch Desktop was sunset on September 30th 2023 and has been removed from nixpkgs"; # Added 2023-12-22 clash = throw "'clash' has been removed, upstream gone. Consider using 'mihomo' instead."; # added 2023-11-10 clasp = clingo; # added 2022-12-22 @@ -1007,6 +1009,7 @@ mapAliases ({ mpd_clientlib = libmpdclient; # Added 2021-02-11 mpdevil = plattenalbum; # Added 2024-05-22 mpg321 = throw "'mpg321' has been removed due to it being unmaintained by upstream. Consider using mpg123 instead."; # Added 2024-05-10 + msp430NewlibCross = msp430Newlib; # Added 2024-09-06 mumble_git = throw "'mumble_git' has been renamed to/replaced by 'pkgs.mumble'"; # Converted to throw 2023-09-10 mupdf_1_17 = throw "'mupdf_1_17' has been removed due to being outdated and insecure. Consider using 'mupdf' instead."; # Added 2024-08-22 murmur_git = throw "'murmur_git' has been renamed to/replaced by 'pkgs.murmur'"; # Converted to throw 2023-09-10 @@ -1039,6 +1042,8 @@ mapAliases ({ nagiosPluginsOfficial = monitoring-plugins; neochat = libsForQt5.kdeGear.neochat; # added 2022-05-10 neoload = throw "'neoload' has been removed as it is broken and unmaintained"; # Added 2024-03-02 + newlibCross = newlib; # Added 2024-09-06 + newlib-nanoCross = newlib-nano; # Added 2024-09-06 nitrokey-udev-rules = libnitrokey; # Added 2023-03-25 nix-direnv-flakes = nix-direnv; nix-ld-rs = nix-ld; # Added 2024-08-17 @@ -1539,6 +1544,8 @@ mapAliases ({ uberwriter = apostrophe; # Added 2020-04-23 ubootBeagleboneBlack = ubootAmx335xEVM; # Added 2020-01-21 ubuntu_font_family = ubuntu-classic; # Added 2024-02-19 + uclibc = uclibc-ng; # Added 2022-06-16 + uclibcCross = uclibc-ng; # Added 2022-06-16 ue4 = throw "ue4 has been removed, because the package was broken for years"; # Added 2023-11-22 uefi-firmware-parser = throw "The uefi-firmware-parser package was dropped since it was unmaintained."; # Added 2024-06-21 uhd3_5 = throw "uhd3_5 has been removed, because it was no longer needed"; # Added 2023-10-07 @@ -1689,9 +1696,9 @@ mapAliases ({ inherit (stdenv.hostPlatform) system; # Added 2021-10-22 inherit (stdenv) buildPlatform hostPlatform targetPlatform; # Added 2023-01-09 - freebsdCross = freebsd; # Added 2024-06-18 - netbsdCross = netbsd; # Added 2024-06-18 - openbsdCross = openbsd; # Added 2024-06-18 + freebsdCross = freebsd; # Added 2024-09-06 + netbsdCross = netbsd; # Added 2024-09-06 + openbsdCross = openbsd; # Added 2024-09-06 # LLVM packages for (integration) testing that should not be used inside Nixpkgs: llvmPackages_latest = llvmPackages_18; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 283595a809445..cc9a79c6c7800 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -31,19 +31,6 @@ with pkgs; # it's just the plain stdenv. stdenv_32bit = lowPrio (if stdenv.hostPlatform.is32bit then stdenv else multiStdenv); - stdenvNoCC = stdenv.override ( - { cc = null; hasCC = false; } - - // lib.optionalAttrs (stdenv.hostPlatform.isDarwin && (stdenv.hostPlatform != stdenv.buildPlatform)) { - # TODO: This is a hack to use stdenvNoCC to produce a CF when cross - # compiling. It's not very sound. The cross stdenv has: - # extraBuildInputs = [ targetPackages.darwin.apple_sdks.frameworks.CoreFoundation ] - # and uses stdenvNoCC. In order to make this not infinitely recursive, we - # need to exclude this extraBuildInput. - extraBuildInputs = []; - } - ); - mkStdenvNoLibs = stdenv: let bintools = stdenv.cc.bintools.override { libc = null; @@ -61,7 +48,7 @@ with pkgs; }; stdenvNoLibs = - if stdenvNoCC.hostPlatform != stdenvNoCC.buildPlatform && (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.useLLVM or false) + if stdenvNoCC.hostPlatform != stdenvNoCC.buildPlatform then # We cannot touch binutils or cc themselves, because that will cause # infinite recursion. So instead, we just choose a libc based on the @@ -74,7 +61,17 @@ with pkgs; # thing to to create an earlier thing (leading to infinite recursion) and # we also would still respect the stage arguments choices for these # things. - overrideCC stdenv buildPackages.llvmPackages.clangNoCompilerRt + (if stdenvNoCC.hostPlatform.isDarwin || stdenvNoCC.hostPlatform.useLLVM or false + then overrideCC stdenvNoCC buildPackages.llvmPackages.clangNoCompilerRt + else gccCrossLibcStdenv) + else mkStdenvNoLibs stdenv; + + stdenvNoLibc = + if stdenvNoCC.hostPlatform != stdenvNoCC.buildPlatform + then + (if stdenvNoCC.hostPlatform.isDarwin || stdenvNoCC.hostPlatform.useLLVM or false + then overrideCC stdenvNoCC buildPackages.llvmPackages.clangNoLibc + else gccCrossLibcStdenv) else mkStdenvNoLibs stdenv; gccStdenvNoLibs = mkStdenvNoLibs gccStdenv; @@ -14998,11 +14995,6 @@ with pkgs; gccCrossLibcStdenv = overrideCC stdenvNoCC buildPackages.gccWithoutTargetLibc; - crossLibcStdenv = - if stdenv.hostPlatform.useLLVM or false || stdenv.hostPlatform.isDarwin - then overrideCC stdenv buildPackages.llvmPackages.clangNoLibc - else gccCrossLibcStdenv; - # The GCC used to build libc for the target platform. Normal gccs will be # built with, and use, that cross-compiled libc. gccWithoutTargetLibc = assert stdenv.targetPlatform != stdenv.hostPlatform; let @@ -17045,9 +17037,8 @@ with pkgs; h3 = h3_3; - avrlibc = callPackage ../development/misc/avr/libc { }; - avrlibcCross = callPackage ../development/misc/avr/libc { - stdenv = crossLibcStdenv; + avrlibc = callPackage ../development/misc/avr/libc { + stdenv = stdenvNoLibc; }; avr8burnomat = callPackage ../development/misc/avr8-burn-omat { }; @@ -17119,10 +17110,7 @@ with pkgs; msp430GccSupport = callPackage ../development/misc/msp430/gcc-support.nix { }; - msp430Newlib = callPackage ../development/misc/msp430/newlib.nix { }; - msp430NewlibCross = callPackage ../development/misc/msp430/newlib.nix { - newlib = newlibCross; - }; + msp430Newlib = callPackage ../development/misc/msp430/newlib.nix { }; mspds = callPackage ../development/misc/msp430/mspds { }; mspds-bin = callPackage ../development/misc/msp430/mspds/binary.nix { }; @@ -20262,14 +20250,14 @@ with pkgs; }; muslCross = musl.override { - stdenv = crossLibcStdenv; + stdenv = stdenvNoLibc; }; # These are used when buiding compiler-rt / libgcc, prior to building libc. preLibcCrossHeaders = let inherit (stdenv.targetPlatform) libc; in if stdenv.targetPlatform.isMinGW then targetPackages.windows.mingw_w64_headers or windows.mingw_w64_headers - else if libc == "nblibc" then targetPackages.netbsdCross.headers or netbsdCross.headers + else if libc == "nblibc" then targetPackages.netbsd.headers or netbsd.headers else if libc == "libSystem" && stdenv.targetPlatform.isAarch64 then targetPackages.darwin.LibsystemCross or darwin.LibsystemCross else null; @@ -20280,13 +20268,13 @@ with pkgs; /**/ if name == null then null else if name == "glibc" then targetPackages.glibcCross or glibcCross else if name == "bionic" then targetPackages.bionic or bionic - else if name == "uclibc" then targetPackages.uclibcCross or uclibcCross - else if name == "avrlibc" then targetPackages.avrlibcCross or avrlibcCross - else if name == "newlib" && stdenv.targetPlatform.isMsp430 then targetPackages.msp430NewlibCross or msp430NewlibCross + else if name == "uclibc" then targetPackages.uclibc or uclibc + else if name == "avrlibc" then targetPackages.avrlibc or avrlibc + else if name == "newlib" && stdenv.targetPlatform.isMsp430 then targetPackages.msp430Newlib or msp430Newlib else if name == "newlib" && stdenv.targetPlatform.isVc4 then targetPackages.vc4-newlib or vc4-newlib else if name == "newlib" && stdenv.targetPlatform.isOr1k then targetPackages.or1k-newlib or or1k-newlib - else if name == "newlib" then targetPackages.newlibCross or newlibCross - else if name == "newlib-nano" then targetPackages.newlib-nanoCross or newlib-nanoCross + else if name == "newlib" then targetPackages.newlib or newlib + else if name == "newlib-nano" then targetPackages.newlib-nano or newlib-nano else if name == "musl" then targetPackages.muslCross or muslCross else if name == "msvcrt" then targetPackages.windows.mingw_w64 or windows.mingw_w64 else if name == "ucrt" then targetPackages.windows.mingw_w64 or windows.mingw_w64 @@ -20312,7 +20300,7 @@ with pkgs; }; wasilibc = callPackage ../development/libraries/wasilibc { - stdenv = crossLibcStdenv; + stdenv = stdenvNoLibc; }; # Only supported on Linux and only on glibc @@ -27225,14 +27213,6 @@ with pkgs; buildBarebox bareboxTools; - uclibc-ng-cross = uclibc-ng.override { - stdenv = crossLibcStdenv; - }; - - # Aliases - uclibc = uclibc-ng; - uclibcCross = uclibc-ng-cross; - eudev = callPackage ../by-name/eu/eudev/package.nix { util-linux = util-linuxMinimal; }; @@ -39489,18 +39469,14 @@ with pkgs; new-session-manager = callPackage ../applications/audio/new-session-manager { }; - newlib = callPackage ../development/misc/newlib { }; - newlibCross = callPackage ../development/misc/newlib { - stdenv = crossLibcStdenv; + newlib = callPackage ../development/misc/newlib { + stdenv = stdenvNoLibc; }; newlib-nano = callPackage ../development/misc/newlib { + stdenv = stdenvNoLibc; nanoizeNewlib = true; }; - newlib-nanoCross = callPackage ../development/misc/newlib { - nanoizeNewlib = true; - stdenv = crossLibcStdenv; - }; omnisharp-roslyn = callPackage ../development/tools/omnisharp-roslyn { }; diff --git a/pkgs/top-level/stage.nix b/pkgs/top-level/stage.nix index 956f194ffd56c..6ad193c8926d7 100644 --- a/pkgs/top-level/stage.nix +++ b/pkgs/top-level/stage.nix @@ -49,6 +49,10 @@ in , # The standard environment to use for building packages. stdenv +, # `stdenv` without a C compiler. Passing in this helps avoid infinite + # recursions, and may eventually replace passing in the full stdenv. + stdenvNoCC ? stdenv.override { cc = null; hasCC = false; } + , # This is used because stdenv replacement and the stdenvCross do benefit from # the overridden configuration provided by the user, as opposed to the normal # bootstrapping stdenvs. @@ -141,7 +145,7 @@ let pkgs = self.pkgsHostTarget; targetPackages = self.pkgsTargetTarget; - inherit stdenv; + inherit stdenv stdenvNoCC; }; splice = self: super: import ./splice.nix lib self (adjacentPackages != null);