summaryrefslogtreecommitdiff
path: root/user/rust/0035-rand-5b9e5c39d857.patch
diff options
context:
space:
mode:
Diffstat (limited to 'user/rust/0035-rand-5b9e5c39d857.patch')
-rw-r--r--user/rust/0035-rand-5b9e5c39d857.patch25
1 files changed, 25 insertions, 0 deletions
diff --git a/user/rust/0035-rand-5b9e5c39d857.patch b/user/rust/0035-rand-5b9e5c39d857.patch
new file mode 100644
index 000000000..6f9d072f8
--- /dev/null
+++ b/user/rust/0035-rand-5b9e5c39d857.patch
@@ -0,0 +1,25 @@
+From 5b9e5c39d857312fb308493ac8d0b89f73607941 Mon Sep 17 00:00:00 2001
+From: Lion Yang <lion@aosc.io>
+Date: Wed, 15 Aug 2018 16:10:37 +0800
+Subject: [PATCH] os.rs: fix wrong syscall number for PowerPC
+
+__NR_getrandom is 359 on PowerPC, added from torvalds/linux@7d59deb50aa v3.17-rc5.
+The bug was introduced from 05f23d275 3 years ago, affecting from 0.1.1 to before 0.5.0-pre.0.
+It has already been fixed on the 0.5 branch at 00713a61c so this is a backport.
+---
+ src/os.rs | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/vendor/rand-0.4.2/src/os.rs b/src/vendor/rand-0.4.2/src/os.rs
+index 633594ec7d..10022fbcd6 100644
+--- a/src/vendor/rand-0.4.2/src/os.rs
++++ b/src/vendor/rand-0.4.2/src/os.rs
+@@ -102,7 +102,7 @@ mod imp {
+ #[cfg(target_arch = "aarch64")]
+ const NR_GETRANDOM: libc::c_long = 278;
+ #[cfg(target_arch = "powerpc")]
+- const NR_GETRANDOM: libc::c_long = 384;
++ const NR_GETRANDOM: libc::c_long = 359;
+
+ unsafe {
+ syscall(NR_GETRANDOM, buf.as_mut_ptr(), buf.len(), 0)