libcCross: Remove! (#414321)

Changed files
+115 -111
pkgs
by-name
qm
sh
shadow
development
compilers
os-specific
windows
top-level
+1 -1
pkgs/by-name/qm/qmk/package.nix
···
pkgsCross.avr.buildPackages.binutils
pkgsCross.avr.buildPackages.binutils.bintools
pkgsCross.avr.buildPackages.gcc
-
pkgsCross.avr.libcCross
];
# no tests implemented
···
pkgsCross.avr.buildPackages.binutils
pkgsCross.avr.buildPackages.binutils.bintools
pkgsCross.avr.buildPackages.gcc
+
pkgsCross.avr.libc
];
# no tests implemented
+2 -2
pkgs/by-name/sh/shadow/package.nix
···
libxslt,
libxcrypt,
pkg-config,
-
glibcCross ? null,
pam ? null,
withLibbsd ? lib.meta.availableOn stdenv.hostPlatform libbsd,
libbsd,
···
let
glibc =
if stdenv.hostPlatform != stdenv.buildPlatform then
-
glibcCross
else
assert stdenv.hostPlatform.libc == "glibc";
stdenv.cc.libc;
···
libxslt,
libxcrypt,
pkg-config,
+
glibc ? null,
pam ? null,
withLibbsd ? lib.meta.availableOn stdenv.hostPlatform libbsd,
libbsd,
···
let
glibc =
if stdenv.hostPlatform != stdenv.buildPlatform then
+
glibc
else
assert stdenv.hostPlatform.libc == "glibc";
stdenv.cc.libc;
+9 -4
pkgs/development/compilers/gcc/all.nix
···
lib,
stdenv,
pkgs,
callPackage,
isl_0_20,
-
libcCross,
-
threadsCross,
noSysDirs,
lowPrio,
wrapCC,
···
reproducibleBuild = true;
profiledCompiler = false;
libcCross =
-
if !lib.systems.equals stdenv.targetPlatform stdenv.buildPlatform then args.libcCross else null;
threadsCross =
-
if !lib.systems.equals stdenv.targetPlatform stdenv.buildPlatform then threadsCross else { };
isl = if stdenv.hostPlatform.isDarwin then null else isl_0_20;
# do not allow version skew when cross-building gcc
#
···
lib,
stdenv,
pkgs,
+
targetPackages,
callPackage,
isl_0_20,
noSysDirs,
lowPrio,
wrapCC,
···
reproducibleBuild = true;
profiledCompiler = false;
libcCross =
+
if !lib.systems.equals stdenv.targetPlatform stdenv.buildPlatform then
+
targetPackages.libc or pkgs.libc
+
else
+
null;
threadsCross =
+
if !lib.systems.equals stdenv.targetPlatform stdenv.buildPlatform then
+
targetPackages.threads or pkgs.threads
+
else
+
{ };
isl = if stdenv.hostPlatform.isDarwin then null else isl_0_20;
# do not allow version skew when cross-building gcc
#
+1 -1
pkgs/development/compilers/gcc/default.nix
···
enablePlugin ? (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform), # Whether to support user-supplied plug-ins
name ? "gcc",
libcCross ? null,
-
threadsCross ? null, # for MinGW
withoutTargetLibc ? false,
flex,
gnused ? null,
···
enablePlugin ? (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform), # Whether to support user-supplied plug-ins
name ? "gcc",
libcCross ? null,
+
threadsCross ? { }, # for MinGW
withoutTargetLibc ? false,
flex,
gnused ? null,
+2 -2
pkgs/development/compilers/go/1.23.nix
···
mailcap,
buildPackages,
pkgsBuildTarget,
-
threadsCross,
testers,
skopeo,
buildGo123Module,
···
depsBuildTarget = lib.optional isCross targetCC;
-
depsTargetTarget = lib.optional stdenv.targetPlatform.isWindows threadsCross.package;
postPatch = ''
patchShebangs .
···
mailcap,
buildPackages,
pkgsBuildTarget,
+
targetPackages,
testers,
skopeo,
buildGo123Module,
···
depsBuildTarget = lib.optional isCross targetCC;
+
depsTargetTarget = lib.optional stdenv.targetPlatform.isWindows targetPackages.threads.package;
postPatch = ''
patchShebangs .
+2 -2
pkgs/development/compilers/go/1.24.nix
···
mailcap,
buildPackages,
pkgsBuildTarget,
-
threadsCross,
testers,
skopeo,
buildGo124Module,
···
depsBuildTarget = lib.optional isCross targetCC;
-
depsTargetTarget = lib.optional stdenv.targetPlatform.isWindows threadsCross.package;
postPatch = ''
patchShebangs .
···
mailcap,
buildPackages,
pkgsBuildTarget,
+
targetPackages,
testers,
skopeo,
buildGo124Module,
···
depsBuildTarget = lib.optional isCross targetCC;
+
depsTargetTarget = lib.optional stdenv.targetPlatform.isWindows targetPackages.threads.package;
postPatch = ''
patchShebangs .
+2 -2
pkgs/development/compilers/llvm/common/default.nix
···
lowPrio,
newScope,
pkgs,
lib,
stdenv,
-
preLibcCrossHeaders,
libxcrypt,
substitute,
replaceVars,
···
bintoolsNoLibc = wrapBintoolsWith {
bintools = tools.bintools-unwrapped;
-
libc = preLibcCrossHeaders;
};
bintools = wrapBintoolsWith { bintools = tools.bintools-unwrapped; };
···
lowPrio,
newScope,
pkgs,
+
targetPackages,
lib,
stdenv,
libxcrypt,
substitute,
replaceVars,
···
bintoolsNoLibc = wrapBintoolsWith {
bintools = tools.bintools-unwrapped;
+
libc = targetPackages.preLibcHeaders;
};
bintools = wrapBintoolsWith { bintools = tools.bintools-unwrapped; };
+3 -3
pkgs/os-specific/windows/default.nix
···
lib,
stdenv,
buildPackages,
newScope,
overrideCC,
stdenvNoLibc,
-
libcCross,
}:
lib.makeScope newScope (
···
else
buildPackages.gccWithoutTargetLibc.override (old: {
bintools = old.bintools.override {
-
libc = libcCross;
};
-
libc = libcCross;
})
);
···
lib,
stdenv,
buildPackages,
+
pkgs,
newScope,
overrideCC,
stdenvNoLibc,
}:
lib.makeScope newScope (
···
else
buildPackages.gccWithoutTargetLibc.override (old: {
bintools = old.bintools.override {
+
libc = pkgs.libc;
};
+
libc = pkgs.libc;
})
);
-2
pkgs/top-level/aliases.nix
···
autoadb = throw "'autoadb' has been removed due to lack of maintenance upstream"; # Added 2025-01-25
avldrums-lv2 = throw "'avldrums-lv2' has been renamed to/replaced by 'x42-avldrums'"; # Converted to throw 2024-10-17
avr-sim = throw "'avr-sim' has been removed as it was broken and unmaintained. Possible alternatives are 'simavr', SimulAVR and AVRStudio."; # Added 2025-05-31
-
avrlibcCross = avrlibc; # Added 2024-09-06
axmldec = throw "'axmldec' has been removed as it was broken and unmaintained for 8 years"; # Added 2025-05-17
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
···
ubootBeagleboneBlack = throw "'ubootBeagleboneBlack' has been renamed to/replaced by 'ubootAmx335xEVM'"; # Converted to throw 2024-10-17
ubuntu_font_family = ubuntu-classic; # Added 2024-02-19
uclibc = uclibc-ng; # Added 2022-06-16
-
uclibcCross = uclibc-ng; # Added 2022-06-16
unicap = "'unicap' has been removed because it is unmaintained"; # Added 2025-05-17
unicorn-emu = throw "'unicorn-emu' has been renamed to/replaced by 'unicorn'"; # Converted to throw 2024-10-17
uniffi-bindgen = throw "uniffi-bindgen has been removed since upstream no longer provides a standalone package for the CLI";
···
autoadb = throw "'autoadb' has been removed due to lack of maintenance upstream"; # Added 2025-01-25
avldrums-lv2 = throw "'avldrums-lv2' has been renamed to/replaced by 'x42-avldrums'"; # Converted to throw 2024-10-17
avr-sim = throw "'avr-sim' has been removed as it was broken and unmaintained. Possible alternatives are 'simavr', SimulAVR and AVRStudio."; # Added 2025-05-31
axmldec = throw "'axmldec' has been removed as it was broken and unmaintained for 8 years"; # Added 2025-05-17
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
···
ubootBeagleboneBlack = throw "'ubootBeagleboneBlack' has been renamed to/replaced by 'ubootAmx335xEVM'"; # Converted to throw 2024-10-17
ubuntu_font_family = ubuntu-classic; # Added 2024-02-19
uclibc = uclibc-ng; # Added 2022-06-16
unicap = "'unicap' has been removed because it is unmaintained"; # Added 2025-05-17
unicorn-emu = throw "'unicorn-emu' has been renamed to/replaced by 'unicorn'"; # Converted to throw 2024-10-17
uniffi-bindgen = throw "uniffi-bindgen has been removed since upstream no longer provides a standalone package for the CLI";
+88 -87
pkgs/top-level/all-packages.nix
···
gccWithoutTargetLibc =
assert stdenv.targetPlatform != stdenv.hostPlatform;
let
-
libcCross1 = binutilsNoLibc.libc;
in
wrapCCWith {
cc = gccFun {
···
withoutTargetLibc = true;
langCC = false;
-
libcCross = libcCross1;
targetPackages.stdenv.cc.bintools = binutilsNoLibc;
enableShared =
stdenv.targetPlatform.hasSharedLibraries
···
&& !(stdenv.targetPlatform.useLLVM or false);
};
bintools = binutilsNoLibc;
-
libc = libcCross1;
extraPackages = [ ];
};
···
libcxx ? null,
extraPackages ? lib.optional (
cc.isGNU or false && stdenv.targetPlatform.isMinGW
-
) threadsCross.package,
nixSupport ? { },
...
}@extraArgs:
···
wrapBintoolsWith =
{
bintools,
-
libc ? if stdenv.targetPlatform != stdenv.hostPlatform then libcCross else stdenv.cc.libc,
...
}@extraArgs:
callPackage ../build-support/bintools-wrapper (
···
});
binutilsNoLibc = wrapBintoolsWith {
bintools = binutils-unwrapped;
-
libc = preLibcCrossHeaders;
};
libbfd = callPackage ../development/tools/misc/binutils/libbfd.nix { };
···
null;
bintoolsNoLibc = wrapBintoolsWith {
bintools = bintools-unwrapped;
-
libc = preLibcCrossHeaders;
};
bintools = wrapBintoolsWith {
bintools = bintools-unwrapped;
···
withMinecraftPatch = true;
};
-
glibc = callPackage ../development/libraries/glibc {
-
stdenv = gccStdenv; # doesn't compile without gcc
-
};
mtrace = callPackage ../development/libraries/glibc/mtrace.nix { };
···
withGd = true;
};
-
# Being redundant to avoid cycles on boot. TODO: find a better way
-
glibcCross = callPackage ../development/libraries/glibc {
-
stdenv = gccCrossLibcStdenv; # doesn't compile without gcc
-
libgcc = callPackage ../development/libraries/gcc/libgcc {
-
gcc = gccCrossLibcStdenv.cc;
-
glibc = glibcCross.override { libgcc = null; };
-
stdenvNoLibs = gccCrossLibcStdenv;
-
};
-
};
-
-
muslCross = musl.override {
-
stdenv = stdenvNoLibc;
-
};
# These are used when building 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.netbsd.headers or netbsd.headers
else
null;
# We can choose:
-
libcCrossChooser =
-
name:
-
# libc is hackily often used from the previous stage. This `or`
-
# hack fixes the hack, *sigh*.
-
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.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.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
-
else if name == "libSystem" then
-
if stdenv.targetPlatform.useiOSPrebuilt then
-
targetPackages.darwin.iosSdkPkgs.libraries or darwin.iosSdkPkgs.libraries
else
-
targetPackages.darwin.libSystem or darwin.libSystem
-
else if name == "fblibc" then
-
targetPackages.freebsd.libc or freebsd.libc
-
else if name == "oblibc" then
-
targetPackages.openbsd.libc or openbsd.libc
-
else if name == "nblibc" then
-
targetPackages.netbsd.libc or netbsd.libc
-
else if name == "wasilibc" then
-
targetPackages.wasilibc or wasilibc
-
else if name == "relibc" then
-
targetPackages.relibc or relibc
-
else if name == "llvm" then
-
targetPackages.llvmPackages_20.libc or llvmPackages_20.libc
-
else
-
throw "Unknown libc ${name}";
-
libcCross =
-
if stdenv.targetPlatform == stdenv.buildPlatform then
-
null
-
else
-
libcCrossChooser stdenv.targetPlatform.libc;
-
-
threadsCross =
-
lib.optionalAttrs (stdenv.targetPlatform.isMinGW && !(stdenv.targetPlatform.useLLVM or false))
{
# other possible values: win32 or posix
model = "mcf";
# For win32 or posix set this to null
-
package = targetPackages.windows.mcfgthreads or windows.mcfgthreads;
};
wasilibc = callPackage ../development/libraries/wasilibc {
···
"fblibc"
]
then
-
libcIconv (if stdenv.hostPlatform != stdenv.buildPlatform then libcCross else stdenv.cc.libc)
else if stdenv.hostPlatform.isDarwin then
darwin.libiconv
else
···
simavr = callPackage ../development/tools/simavr {
avrgcc = pkgsCross.avr.buildPackages.gcc;
-
avrlibc = pkgsCross.avr.libcCross;
};
simpleitk = callPackage ../development/libraries/simpleitk { lua = lua5_4; };
···
gccWithoutTargetLibc =
assert stdenv.targetPlatform != stdenv.hostPlatform;
let
+
libc1 = binutilsNoLibc.libc;
in
wrapCCWith {
cc = gccFun {
···
withoutTargetLibc = true;
langCC = false;
+
libcCross = libc1;
targetPackages.stdenv.cc.bintools = binutilsNoLibc;
enableShared =
stdenv.targetPlatform.hasSharedLibraries
···
&& !(stdenv.targetPlatform.useLLVM or false);
};
bintools = binutilsNoLibc;
+
libc = libc1;
extraPackages = [ ];
};
···
libcxx ? null,
extraPackages ? lib.optional (
cc.isGNU or false && stdenv.targetPlatform.isMinGW
+
) targetPackages.threads.package,
nixSupport ? { },
...
}@extraArgs:
···
wrapBintoolsWith =
{
bintools,
+
libc ? if stdenv.targetPlatform != stdenv.hostPlatform then targetPackages.libc else stdenv.cc.libc,
...
}@extraArgs:
callPackage ../build-support/bintools-wrapper (
···
});
binutilsNoLibc = wrapBintoolsWith {
bintools = binutils-unwrapped;
+
libc = targetPackages.preLibcHeaders;
};
libbfd = callPackage ../development/tools/misc/binutils/libbfd.nix { };
···
null;
bintoolsNoLibc = wrapBintoolsWith {
bintools = bintools-unwrapped;
+
libc = targetPackages.preLibcHeaders;
};
bintools = wrapBintoolsWith {
bintools = bintools-unwrapped;
···
withMinecraftPatch = true;
};
+
glibc = callPackage ../development/libraries/glibc (
+
if stdenv.hostPlatform != stdenv.buildPlatform then
+
{
+
stdenv = gccCrossLibcStdenv; # doesn't compile without gcc
+
libgcc = callPackage ../development/libraries/gcc/libgcc {
+
gcc = gccCrossLibcStdenv.cc;
+
glibc = glibc.override { libgcc = null; };
+
stdenvNoLibs = gccCrossLibcStdenv;
+
};
+
}
+
else
+
{
+
stdenv = gccStdenv; # doesn't compile without gcc
+
}
+
);
mtrace = callPackage ../development/libraries/glibc/mtrace.nix { };
···
withGd = true;
};
+
musl = callPackage ../by-name/mu/musl/package.nix (
+
lib.optionalAttrs (stdenv.hostPlatform != stdenv.buildPlatform) {
+
stdenv = stdenvNoLibc;
+
}
+
);
# These are used when building compiler-rt / libgcc, prior to building libc.
+
preLibcHeaders =
let
+
inherit (stdenv.hostPlatform) libc;
in
+
if stdenv.hostPlatform.isMinGW then
+
windows.mingw_w64_headers or fallback
else if libc == "nblibc" then
+
netbsd.headers
else
null;
# We can choose:
+
libc =
+
if stdenv.hostPlatform == stdenv.buildPlatform then
+
# TODO get rid of this branch after the native boostrap is reworked
+
stdenv.cc.libc
+
else
+
let
+
inherit (stdenv.hostPlatform) libc;
+
# libc is hackily often used from the previous stage. This `or`
+
# hack fixes the hack, *sigh*.
+
in
+
if libc == null then
+
null
+
else if libc == "glibc" then
+
glibc
+
else if libc == "bionic" then
+
bionic
+
else if libc == "uclibc" then
+
uclibc
+
else if libc == "avrlibc" then
+
avrlibc
+
else if libc == "newlib" && stdenv.hostPlatform.isMsp430 then
+
msp430Newlib
+
else if libc == "newlib" && stdenv.hostPlatform.isVc4 then
+
vc4-newlib
+
else if libc == "newlib" && stdenv.hostPlatform.isOr1k then
+
or1k-newlib
+
else if libc == "newlib" then
+
newlib
+
else if libc == "newlib-nano" then
+
newlib-nano
+
else if libc == "musl" then
+
musl
+
else if libc == "msvcrt" then
+
windows.mingw_w64
+
else if libc == "ucrt" then
+
windows.mingw_w64
+
else if libc == "libSystem" then
+
if stdenv.hostPlatform.useiOSPrebuilt then darwin.iosSdkPkgs.libraries else darwin.libSystem
+
else if libc == "fblibc" then
+
freebsd.libc
+
else if libc == "oblibc" then
+
openbsd.libc
+
else if libc == "nblibc" then
+
netbsd.libc
+
else if libc == "wasilibc" then
+
wasilibc
+
else if libc == "relibc" then
+
relibc
+
else if name == "llvm" then
+
llvmPackages_20.libc
else
+
throw "Unknown libc ${libc}";
+
threads =
+
lib.optionalAttrs (stdenv.hostPlatform.isMinGW && !(stdenv.hostPlatform.useLLVM or false))
{
# other possible values: win32 or posix
model = "mcf";
# For win32 or posix set this to null
+
package = windows.mcfgthreads;
};
wasilibc = callPackage ../development/libraries/wasilibc {
···
"fblibc"
]
then
+
libcIconv (if stdenv.hostPlatform != stdenv.buildPlatform then libc else stdenv.cc.libc)
else if stdenv.hostPlatform.isDarwin then
darwin.libiconv
else
···
simavr = callPackage ../development/tools/simavr {
avrgcc = pkgsCross.avr.buildPackages.gcc;
+
avrlibc = pkgsCross.avr.libc;
};
simpleitk = callPackage ../development/libraries/simpleitk { lua = lua5_4; };
+3 -3
pkgs/top-level/darwin-packages.nix
···
generateSplicesForMkScope,
makeScopeWithSplicing',
stdenv,
-
preLibcCrossHeaders,
config,
}:
···
};
binutils = pkgs.wrapBintoolsWith {
-
libc = if stdenv.targetPlatform != stdenv.hostPlatform then pkgs.libcCross else pkgs.stdenv.cc.libc;
bintools = self.binutils-unwrapped;
};
···
};
binutilsNoLibc = pkgs.wrapBintoolsWith {
-
libc = preLibcCrossHeaders;
bintools = self.binutils-unwrapped;
};
···
generateSplicesForMkScope,
makeScopeWithSplicing',
stdenv,
config,
}:
···
};
binutils = pkgs.wrapBintoolsWith {
+
libc =
+
if stdenv.targetPlatform != stdenv.hostPlatform then targetPackages.libc else pkgs.stdenv.cc.libc;
bintools = self.binutils-unwrapped;
};
···
};
binutilsNoLibc = pkgs.wrapBintoolsWith {
+
libc = targetPackages.preLibcHeaders;
bintools = self.binutils-unwrapped;
};
+2 -2
pkgs/top-level/release-cross.nix
···
embedded = {
buildPackages.binutils = nativePlatforms;
buildPackages.gcc = nativePlatforms;
-
libcCross = nativePlatforms;
};
common = {
buildPackages.binutils = nativePlatforms;
gmp = nativePlatforms;
-
libcCross = nativePlatforms;
nix = nativePlatforms;
nixVersions.git = nativePlatforms;
mesa = nativePlatforms;
···
embedded = {
buildPackages.binutils = nativePlatforms;
buildPackages.gcc = nativePlatforms;
+
libc = nativePlatforms;
};
common = {
buildPackages.binutils = nativePlatforms;
gmp = nativePlatforms;
+
libc = nativePlatforms;
nix = nativePlatforms;
nixVersions.git = nativePlatforms;
mesa = nativePlatforms;