pkgs/top-level/stage.nix: add pkgsLLVMLibc

This commit is contained in:
Tristan Ross 2024-12-25 11:22:29 -08:00
parent f72b341556
commit 41b14024d2
No known key found for this signature in database
GPG key ID: B09C422035669AF8
6 changed files with 24 additions and 0 deletions

View file

@ -102,6 +102,7 @@ let
else if final.isMusl then "musl"
else if final.isUClibc then "uclibc"
else if final.isAndroid then "bionic"
else if final.isLLVMLibc then "llvm"
else if final.isLinux /* default */ then "glibc"
else if final.isFreeBSD then "fblibc"
else if final.isOpenBSD then "oblibc"

View file

@ -113,6 +113,7 @@ rec {
isGnu = with abis; map (a: { abi = a; }) [ gnuabi64 gnuabin32 gnu gnueabi gnueabihf gnuabielfv1 gnuabielfv2 ];
isMusl = with abis; map (a: { abi = a; }) [ musl musleabi musleabihf muslabin32 muslabi64 ];
isUClibc = with abis; map (a: { abi = a; }) [ uclibc uclibceabi uclibceabihf ];
isLLVMLibc = [ { abi = abis.llvm; } ];
isEfi = [
{ cpu = { family = "arm"; version = "6"; }; }

View file

@ -416,6 +416,9 @@ rec {
uclibceabihf = { float = "hard"; };
uclibc = {};
# LLVM libc
llvm = {};
unknown = {};
};

View file

@ -50,6 +50,7 @@ let
# cross packagesets
pkgsLLVM = true;
pkgsLLVMLibc = true;
pkgsMusl = true;
pkgsStatic = true;
pkgsCross = true;

View file

@ -341,6 +341,7 @@ let
agdaPackages = packagePlatforms pkgs.agdaPackages;
pkgsLLVM.stdenv = [ "x86_64-linux" "aarch64-linux" ];
pkgsLLVMLibc.stdenv = [ "x86_64-linux" "aarch64-linux" ];
pkgsArocc.stdenv = [ "x86_64-linux" "aarch64-linux" ];
pkgsZig.stdenv = [ "x86_64-linux" "aarch64-linux" ];
pkgsMusl.stdenv = [ "x86_64-linux" "aarch64-linux" ];

View file

@ -98,6 +98,10 @@ let
or lib.systems.parse.abis.musl;
});
makeLLVMParsedPlatform = parsed:
(parsed // {
abi = lib.systems.parse.abis.llvm;
});
stdenvAdapters = self: super:
let
@ -207,6 +211,19 @@ let
};
};
pkgsLLVMLibc = nixpkgsFun {
overlays = [ (self': super': {
pkgsLLVMLibc = super';
})] ++ overlays;
# Bootstrap a cross stdenv using LLVM libc.
# This is currently not possible when compiling natively,
# so we don't need to check hostPlatform != buildPlatform.
crossSystem = stdenv.hostPlatform // {
config = lib.systems.parse.tripleFromSystem (makeLLVMParsedPlatform stdenv.hostPlatform.parsed);
libc = "llvm";
};
};
pkgsArocc = nixpkgsFun {
overlays = [
(self': super': {