From e288febee0809db7c594ceb42e655dd5d43a6369 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Sun, 18 Feb 2018 00:09:25 -0500 Subject: [PATCH] Add riscv{32,64} crossSystems. --- lib/systems/examples.nix | 8 ++++++++ lib/systems/platforms.nix | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/lib/systems/examples.nix b/lib/systems/examples.nix index f5562e28a09d..bd68ee9460e7 100644 --- a/lib/systems/examples.nix +++ b/lib/systems/examples.nix @@ -68,6 +68,14 @@ rec { musl64 = { config = "x86_64-unknown-linux-musl"; }; musl32 = { config = "i686-unknown-linux-musl"; }; + riscv = bits: { + config = "riscv${bits}-unknown-linux-gnu"; + platform = platforms.riscv-multiplatform bits; + }; + riscv64 = riscv "64"; + riscv32 = riscv "32"; + + # # Darwin # diff --git a/lib/systems/platforms.nix b/lib/systems/platforms.nix index 58a7afa7679d..3106c05dd5d2 100644 --- a/lib/systems/platforms.nix +++ b/lib/systems/platforms.nix @@ -541,6 +541,12 @@ rec { }; }; + riscv-multiplatform = bits: { + name = "riscv-multiplatform"; + kernelArch = "riscv"; + bfdEmulation = "elf${bits}lriscv"; + }; + selectBySystem = system: { "i686-linux" = pc32; "x86_64-linux" = pc64;