From 9b7255c188e9ad32a6019fa3b4528259b9134168 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charlotte=20=F0=9F=A6=9D=20Delenk?= Date: Sun, 18 Jun 2023 16:25:18 +0100 Subject: [PATCH] add riscv --- default.nix | 6 ++++++ nixpkgs/eval.nix | 3 ++- nixpkgs/nixpkgs.patch | 20 +++++++++++--------- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/default.nix b/default.nix index 4c3b284..09209c4 100644 --- a/default.nix +++ b/default.nix @@ -10,6 +10,7 @@ localSystems = rec { x86_64-linux.system = "x86_64-linux"; aarch64-linux.system = "aarch64-linux"; + riscv64-linux.system = "riscv64-linux"; default.system = system; skylake = x86_64-linux @@ -36,6 +37,11 @@ gcc.arch = "znver2"; gcc.tune = "znver2"; }; + rv64_zba_zbb = + riscv64-linux + // { + gcc.arch = "rv64_zba_zbb"; + }; }; pkgs-unpatched = import nixpkgs-unpatched' { inherit system; diff --git a/nixpkgs/eval.nix b/nixpkgs/eval.nix index b97046b..6f22246 100644 --- a/nixpkgs/eval.nix +++ b/nixpkgs/eval.nix @@ -1,4 +1,4 @@ -{nixpkgs}: let +let buildFor = system: import ../. { inherit nixpkgs system; @@ -7,4 +7,5 @@ in { x86_64-linux = (buildFor "x86_64-linux").nixpkgs; aarch64-linux = (buildFor "aarch64-linux").nixpkgs; + riscv64-linux = (buildFor "riscv64-linux").nixpkgs; } diff --git a/nixpkgs/nixpkgs.patch b/nixpkgs/nixpkgs.patch index e678037..1af3873 100644 --- a/nixpkgs/nixpkgs.patch +++ b/nixpkgs/nixpkgs.patch @@ -1,8 +1,8 @@ diff --git a/lib/systems/architectures.nix b/lib/systems/architectures.nix -index 94127fa9..5253e4bb 100644 +index 57b9184ca60..37d12ac687f 100644 --- a/lib/systems/architectures.nix +++ b/lib/systems/architectures.nix -@@ -32,9 +32,24 @@ rec { +@@ -32,9 +32,25 @@ rec { armv5te = [ ]; armv6 = [ ]; armv7-a = [ ]; @@ -22,13 +22,14 @@ index 94127fa9..5253e4bb 100644 + "armv9.3-a" = [ "mops" ] ++ features."armv9.2-a"; mips32 = [ ]; loongson2f = [ ]; -+ riscv64-g = [ "multiply" "atomic" "float" "double" "csr" "ifencei" ]; -+ riscv64-gc = [ "compressed" ] ++ features.riscv64-g; -+ riscv64-gcv = [ "vector" ] ++ features.riscv64-gc; ++ rv64gc = []; ++ rv64gc_zba = []; ++ rv64gc_zbb = []; ++ rv64gc_zba_zbb = []; }; # a superior CPU has all the features of an inferior and is able to build and test code for it -@@ -85,8 +100,23 @@ rec { +@@ -92,8 +108,24 @@ rec { armv6 = [ ]; armv7-a = [ ]; armv8-a = [ ]; @@ -46,9 +47,10 @@ index 94127fa9..5253e4bb 100644 + "armv9.3-a" = [ "armv9.2-a" "armv8.8-a" ] ++ inferiors."armv9.2-a" ++ inferiors."armv8.8-a"; mips32 = [ ]; loongson2f = [ ]; -+ riscv64-g = [ ]; -+ riscv64-gc = [ "riscv64-g" ] ++ inferiors.riscv64-g; -+ riscv64-gcv = [ "riscv64-gc" ] ++ inferiors.riscv64-gc; ++ rv64gc = [ ]; ++ rv64gc_zba = [ "rv64gc" ] ++ inferiors.rv64gc; ++ rv64gc_zbb = [ "rv64gc" ] ++ inferiors.rv64gc; ++ rv64gc_zba_zbb = [ "rv64gc" "rv64gc_zba" "rv64gc_zbb" ]; }; predicates = let