diff options
author | Emery Hemingway <ehmry@posteo.net> | 2020-03-24 13:32:18 +0530 |
---|---|---|
committer | Emery Hemingway <ehmry@posteo.net> | 2020-03-24 20:41:21 +0530 |
commit | 9f91fa02a6a3e6800dff5f80f061410e83aaeb28 (patch) | |
tree | 177b918c4f47906fa66cb7436b724ac386e1b9a3 /lib/systems | |
parent | 5ee77aa47c320b725086b001cad8afb1997ad62b (diff) |
lib/systems: Add Genode platform definitions
Add platform definitions for 64-bit ARM and x86. This is sufficient for
for building Genode where a toolchain is provided as an overlay.
Toolchain: git+https://git.sr.ht/~ehmry/genodepkgs?rev=14fc773ac9ecd2cbb30cb4612b284eee83d83546
Diffstat (limited to 'lib/systems')
-rw-r--r-- | lib/systems/default.nix | 1 | ||||
-rw-r--r-- | lib/systems/doubles.nix | 3 | ||||
-rw-r--r-- | lib/systems/inspect.nix | 1 | ||||
-rw-r--r-- | lib/systems/parse.nix | 3 |
4 files changed, 8 insertions, 0 deletions
diff --git a/lib/systems/default.nix b/lib/systems/default.nix index 4ca932d17921..210674cc6399 100644 --- a/lib/systems/default.nix +++ b/lib/systems/default.nix @@ -65,6 +65,7 @@ rec { freebsd = "FreeBSD"; openbsd = "OpenBSD"; wasi = "Wasi"; + genode = "Genode"; }.${final.parsed.kernel.name} or null; # uname -p diff --git a/lib/systems/doubles.nix b/lib/systems/doubles.nix index 619b0427918d..a839b3d3d573 100644 --- a/lib/systems/doubles.nix +++ b/lib/systems/doubles.nix @@ -35,6 +35,8 @@ let "vc4-none" "js-ghcjs" + + "aarch64-genode" "x86_64-genode" ]; allParsed = map parse.mkSystemFromString all; @@ -68,6 +70,7 @@ in { unix = filterDoubles predicates.isUnix; wasi = filterDoubles predicates.isWasi; windows = filterDoubles predicates.isWindows; + genode = filterDoubles predicates.isGenode; embedded = filterDoubles predicates.isNone; diff --git a/lib/systems/inspect.nix b/lib/systems/inspect.nix index 01dcf0787dfa..90a1fb6d80c2 100644 --- a/lib/systems/inspect.nix +++ b/lib/systems/inspect.nix @@ -47,6 +47,7 @@ rec { isMinGW = { kernel = kernels.windows; abi = abis.gnu; }; isWasi = { kernel = kernels.wasi; }; isGhcjs = { kernel = kernels.ghcjs; }; + isGenode = { kernel = kernels.genode; }; isNone = { kernel = kernels.none; }; isAndroid = [ { abi = abis.android; } { abi = abis.androideabi; } ]; diff --git a/lib/systems/parse.nix b/lib/systems/parse.nix index 6a02dbb51528..648e7c270240 100644 --- a/lib/systems/parse.nix +++ b/lib/systems/parse.nix @@ -279,6 +279,7 @@ rec { wasi = { execFormat = wasm; families = { }; }; windows = { execFormat = pe; families = { }; }; ghcjs = { execFormat = unknown; families = { }; }; + genode = { execFormat = elf; families = { }; }; } // { # aliases # 'darwin' is the kernel for all of them. We choose macOS by default. darwin = kernels.macos; @@ -395,6 +396,8 @@ rec { then { cpu = elemAt l 0; vendor = "unknown"; kernel = elemAt l 1; abi = elemAt l 2; } else if (elemAt l 2 == "ghcjs") 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 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)} |