summaryrefslogtreecommitdiff
path: root/lang/rust
diff options
context:
space:
mode:
authorryoon <ryoon@pkgsrc.org>2018-06-25 13:31:11 +0000
committerryoon <ryoon@pkgsrc.org>2018-06-25 13:31:11 +0000
commit73940fa34e2b0aa485ce64ea8e8b8fcb127809ce (patch)
tree27de3ac4fac0430837e58e7c4e2b3f688c820567 /lang/rust
parent33922c28188f44527ff5828f0edfe963480a776e (diff)
downloadpkgsrc-73940fa34e2b0aa485ce64ea8e8b8fcb127809ce.tar.gz
Add missing patch to fix build on NetBSD
Diffstat (limited to 'lang/rust')
-rw-r--r--lang/rust/distinfo3
-rw-r--r--lang/rust/patches/patch-src_libstd_sys_unix_thread.rs29
2 files changed, 31 insertions, 1 deletions
diff --git a/lang/rust/distinfo b/lang/rust/distinfo
index 0ea29e84847..c90c4bf7e56 100644
--- a/lang/rust/distinfo
+++ b/lang/rust/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.27 2018/06/24 08:05:25 ryoon Exp $
+$NetBSD: distinfo,v 1.28 2018/06/25 13:31:11 ryoon Exp $
SHA1 (rust-1.26.2-i686-apple-darwin.tar.gz) = 7a353c1875f4656e95a14ec4822c3c2a408d1d26
RMD160 (rust-1.26.2-i686-apple-darwin.tar.gz) = 9377bd2f7373c5cf7b7e936e51d2749bea8f687f
@@ -76,6 +76,7 @@ SHA1 (patch-src_bootstrap_bin_rustc.rs) = d9787517f03162d3548e89a91ecf933fd67774
SHA1 (patch-src_bootstrap_lib.rs) = d86e173b931099730a4f18d044d7977c89f87b91
SHA1 (patch-src_libbacktrace_configure) = b2c1e9b93a99408aad42ab9f1af27704cc81bdd8
SHA1 (patch-src_libstd_build.rs) = 32dad8a474300f9f37bce8b92acca762cf8cc4ab
+SHA1 (patch-src_libstd_sys_unix_thread.rs) = 2a0b7ea8e7e09623826f306f9f1d0611799173d4
SHA1 (patch-src_llvm_CMakeLists.txt) = ffdf4337fdc84d8314c97c4e492e6b84244a99d1
SHA1 (patch-src_llvm_cmake_modules_AddLLVM.cmake) = 282d97cce8d01cfefe565185d4999c2db9ccc13f
SHA1 (patch-src_llvm_include_llvm_Support_DataTypes.h.cmake) = 61cba4480d97e740d361708eb8e5c9b13bb2d36e
diff --git a/lang/rust/patches/patch-src_libstd_sys_unix_thread.rs b/lang/rust/patches/patch-src_libstd_sys_unix_thread.rs
new file mode 100644
index 00000000000..29aeaf50ef1
--- /dev/null
+++ b/lang/rust/patches/patch-src_libstd_sys_unix_thread.rs
@@ -0,0 +1,29 @@
+$NetBSD: patch-src_libstd_sys_unix_thread.rs,v 1.3 2018/06/25 13:31:11 ryoon Exp $
+
+--- src/libstd/sys/unix/thread.rs.orig 2018-06-24 22:42:29.203295357 +0000
++++ src/libstd/sys/unix/thread.rs
+@@ -326,13 +326,22 @@ pub mod guard {
+ // Reallocate the last page of the stack.
+ // This ensures SIGBUS will be raised on
+ // stack overflow.
+- let result = mmap(stackaddr, PAGE_SIZE, PROT_NONE,
++ // Systems which enforce strict PAX MPROTECT do not allow
++ // to mprotect() a mapping with less restrictive permissions
++ // than the initial mmap() used, so we mmap() here with
++ // read/write permissions and only then mprotect() it to
++ // no permissions at all. See issue #50313.
++ let result = mmap(stackaddr, PAGE_SIZE, PROT_READ | PROT_WRITE,
+ MAP_PRIVATE | MAP_ANON | MAP_FIXED, -1, 0);
+-
+ if result != stackaddr || result == MAP_FAILED {
+ panic!("failed to allocate a guard page");
+ }
+
++ let result = mprotect(stackaddr, PAGE_SIZE, PROT_NONE);
++ if result != 0 {
++ panic!("failed to protect the guard page");
++ }
++
+ let guardaddr = stackaddr as usize;
+ let offset = if cfg!(target_os = "freebsd") {
+ 2