pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/lang/rust Add missing patch to fix build on NetBSD



details:   https://anonhg.NetBSD.org/pkgsrc/rev/005e05ba6c15
branches:  trunk
changeset: 382278:005e05ba6c15
user:      ryoon <ryoon%pkgsrc.org@localhost>
date:      Mon Jun 25 13:31:11 2018 +0000

description:
Add missing patch to fix build on NetBSD

diffstat:

 lang/rust/distinfo                                    |   3 +-
 lang/rust/patches/patch-src_libstd_sys_unix_thread.rs |  29 +++++++++++++++++++
 2 files changed, 31 insertions(+), 1 deletions(-)

diffs (50 lines):

diff -r 6ccd7a075abd -r 005e05ba6c15 lang/rust/distinfo
--- a/lang/rust/distinfo        Mon Jun 25 11:23:26 2018 +0000
+++ b/lang/rust/distinfo        Mon Jun 25 13:31:11 2018 +0000
@@ -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_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 -r 6ccd7a075abd -r 005e05ba6c15 lang/rust/patches/patch-src_libstd_sys_unix_thread.rs
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/rust/patches/patch-src_libstd_sys_unix_thread.rs     Mon Jun 25 13:31:11 2018 +0000
@@ -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



Home | Main Index | Thread Index | Old Index