Skip to content

Commit

Permalink
pkgs/top-level/stage.nix: add pkgsLLVMLibc
Browse files Browse the repository at this point in the history
  • Loading branch information
RossComputerGuy committed Dec 25, 2024
1 parent f72b341 commit ec43413
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/systems/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions lib/systems/inspect.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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"; }; }
Expand Down
3 changes: 3 additions & 0 deletions lib/systems/parse.nix
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,9 @@ rec {
uclibceabihf = { float = "hard"; };
uclibc = {};

# LLVM libc
llvm = {};

unknown = {};
};

Expand Down
16 changes: 16 additions & 0 deletions pkgs/top-level/stage.nix
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ let
or lib.systems.parse.abis.musl;
});

makeLLVMParsedPlatform = parsed:
(parsed // {
abi = lib.systems.parse.abis.llvm;
});

stdenvAdapters = self: super:
let
Expand Down Expand Up @@ -207,6 +211,18 @@ let
};
};

pkgsLLVMLibc = nixpkgsFun {
overlays = [ (self': super': {
pkgsLLVMLibc = super';
})] ++ overlays;
${if stdenv.hostPlatform == stdenv.buildPlatform
then "localSystem" else "crossSystem"} = {
config = lib.systems.parse.tripleFromSystem (makeLLVMParsedPlatform stdenv.hostPlatform.parsed);
useLLVM = true;
linker = "lld";
};
};

pkgsArocc = nixpkgsFun {
overlays = [
(self': super': {
Expand Down

0 comments on commit ec43413

Please sign in to comment.