aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2022-07-10 20:18:05 +0300
committerEfraim Flashner <efraim@flashner.co.il>2022-07-10 20:38:59 +0300
commitca4bfb0f2de7a2c9997f92574be65fcba4e86d64 (patch)
treeb7e7ee1e76ae5cdfc49347fc32ddbbe8224737d6 /gnu/packages/patches
parent8af3a97b9e6e8961c2c2ecc5f3ba223932af00f1 (diff)
downloadguix-ca4bfb0f2de7a2c9997f92574be65fcba4e86d64.tar.gz
guix-ca4bfb0f2de7a2c9997f92574be65fcba4e86d64.zip
gnu: rust-bootstrap: Add support for riscv64-linux.
* gnu/packages/rust.scm (%mrustc-source): Add patch. (rust-bootstrap)[native-inputs]: On riscv64-linux add gcc@9:lib. [supported-systems]: Add riscv64-linux. Adjust comment. * gnu/packages/patches/mrustc-riscv64-support.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it.
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r--gnu/packages/patches/mrustc-riscv64-support.patch48
1 files changed, 48 insertions, 0 deletions
diff --git a/gnu/packages/patches/mrustc-riscv64-support.patch b/gnu/packages/patches/mrustc-riscv64-support.patch
new file mode 100644
index 0000000000..6312116585
--- /dev/null
+++ b/gnu/packages/patches/mrustc-riscv64-support.patch
@@ -0,0 +1,48 @@
+Patch sent upstream for review:
+https://github.com/thepowersgang/mrustc/pull/276
+
+diff --git a/src/trans/target.cpp b/src/trans/target.cpp
+index 420a2870..4d5eefb3 100644
+--- a/src/trans/target.cpp
++++ b/src/trans/target.cpp
+@@ -65,6 +65,13 @@ const TargetArch ARCH_POWERPC64LE = {
+ { /*atomic(u8)=*/true, true, true, true, true },
+ TargetArch::Alignments(2, 4, 8, 16, 4, 8, 8)
+ };
++// This is a guess
++const TargetArch ARCH_RISCV64 = {
++ "riscv64",
++ 64, false,
++ { /*atomic(u8)=*/true, true, true, true, true },
++ TargetArch::Alignments(2, 4, 8, 16, 4, 8, 8)
++};
+ TargetSpec g_target;
+
+
+@@ -455,6 +462,13 @@ namespace
+ ARCH_POWERPC64LE
+ };
+ }
++ else if(target_name == "riscv64-unknown-linux-gnu")
++ {
++ return TargetSpec {
++ "unix", "linux", "gnu", {CodegenMode::Gnu11, false, "riscv64-unknown-linux-gnu", BACKEND_C_OPTS_GNU},
++ ARCH_RISCV64
++ };
++ }
+ else if(target_name == "i586-pc-windows-gnu")
+ {
+ return TargetSpec {
+diff --git a/tools/common/target_detect.h b/tools/common/target_detect.h
+index a052da6b..42fea91a 100644
+--- a/tools/common/target_detect.h
++++ b/tools/common/target_detect.h
+@@ -34,6 +34,8 @@
+ # define DEFAULT_TARGET_NAME "powerpc64-unknown-linux-gnu"
+ # elif defined(__powerpc64__) && defined(__LITTLE_ENDIAN__)
+ # define DEFAULT_TARGET_NAME "powerpc64le-unknown-linux-gnu"
++# elif defined(__riscv) && __riscv_xlen == 64
++# define DEFAULT_TARGET_NAME "riscv64-unknown-linux-gnu"
+ # else
+ # warning "Unable to detect a suitable default target (linux-gnu)"
+ # endif