Skip to content

Commit

Permalink
wip lib/systems: add solo5
Browse files Browse the repository at this point in the history
  • Loading branch information
sternenseemann committed Jan 1, 2022
1 parent 24b6926 commit c0aab7a
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/systems/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ rec {
else if final.isAndroid then "bionic"
else if final.isLinux /* default */ then "glibc"
else if final.isAvr then "avrlibc"
else if final.isSolo5 then "none" # XXX
else if final.isNone then "newlib"
else if final.isNetBSD then "nblibc"
# TODO(@Ericson2314) think more about other operating systems
Expand Down Expand Up @@ -89,7 +90,7 @@ rec {
# uname -r
release = null;
};
isStatic = final.isWasm || final.isRedox;
isStatic = final.isWasm || final.isRedox || final.isSolo5;

# Just a guess, based on `system`
inherit
Expand Down
16 changes: 16 additions & 0 deletions lib/systems/examples.nix
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,22 @@ rec {
libc = "relibc";
};

#
# Solo5
#

aarch64-solo5 = {
config = "aarch64-solo5-none";
linker = "lld";
useLLVM = true;
};

x86_64-linux-solo5 = {
config = "aarch64-solo5-none";
linker = "lld";
useLLVM = true;
};

#
# Darwin
#
Expand Down
1 change: 1 addition & 0 deletions lib/systems/inspect.nix
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ rec {
isRedox = { kernel = kernels.redox; };
isGhcjs = { kernel = kernels.ghcjs; };
isGenode = { kernel = kernels.genode; };
isSolo5 = { vendor = vendors.solo5; };
isNone = { kernel = kernels.none; };

isAndroid = [ { abi = abis.android; } { abi = abis.androideabi; } ];
Expand Down
3 changes: 3 additions & 0 deletions lib/systems/parse.nix
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ rec {
# Actually matters, unlocking some MinGW-w64-specific options in GCC. See
# bottom of https://sourceforge.net/p/mingw-w64/wiki2/Unicode%20apps/
w64 = {};
solo5 = {};

none = {};
unknown = {};
Expand Down Expand Up @@ -427,6 +428,8 @@ rec {
then { cpu = elemAt l 0; vendor = "unknown"; kernel = elemAt l 2; }
else if hasPrefix "genode" (elemAt l 2)
then { cpu = elemAt l 0; vendor = elemAt l 1; kernel = elemAt l 2; }
else if elemAt l 1 == "solo5"
then { cpu = elemAt l 0; vendor = elemAt l 1; kernel = elemAt l 2; }
else throw "Target specification with 3 components is ambiguous";
"4" = { cpu = elemAt l 0; vendor = elemAt l 1; kernel = elemAt l 2; abi = elemAt l 3; };
}.${toString (length l)}
Expand Down
1 change: 1 addition & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16702,6 +16702,7 @@ with pkgs;
else if name == "wasilibc" then targetPackages.wasilibc or wasilibc
else if name == "relibc" then targetPackages.relibc or relibc
else if stdenv.targetPlatform.isGhcjs then null
else if stdenv.targetPlatform.isSolo5 then null
else throw "Unknown libc ${name}";

libcCross = assert stdenv.targetPlatform != stdenv.buildPlatform; libcCrossChooser stdenv.targetPlatform.libc;
Expand Down

0 comments on commit c0aab7a

Please sign in to comment.