pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/lang/rust Add patch from jakllsch (not merged upstream...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/45b8780e7c12
branches:  trunk
changeset: 324862:45b8780e7c12
user:      martin <martin%pkgsrc.org@localhost>
date:      Wed Oct 31 16:30:44 2018 +0000

description:
Add patch from jakllsch (not merged upstream yet) to fix some pthread/
mutex types for some NetBSD architectures.

diffstat:

 lang/rust/distinfo                                                        |    3 +-
 lang/rust/patches/patch-src_liblibc_src_unix_bsd_netbsdlike_netbsd_mod.rs |  137 ++++++++++
 2 files changed, 139 insertions(+), 1 deletions(-)

diffs (158 lines):

diff -r 5390d64f52e0 -r 45b8780e7c12 lang/rust/distinfo
--- a/lang/rust/distinfo        Wed Oct 31 15:53:17 2018 +0000
+++ b/lang/rust/distinfo        Wed Oct 31 16:30:44 2018 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.44 2018/10/31 15:53:17 jperkin Exp $
+$NetBSD: distinfo,v 1.45 2018/10/31 16:30:44 martin Exp $
 
 SHA1 (rust-1.29.1-i686-unknown-netbsd.tar.gz) = f4f8cbd0a2581546680328765bf5d7d351cf0643
 RMD160 (rust-1.29.1-i686-unknown-netbsd.tar.gz) = a590d8dfed10220e8013796cd66c5c9eed51bf37
@@ -100,6 +100,7 @@
 SHA1 (patch-src_bootstrap_bootstrap.py) = 96ef9368eaa5e10e607ff031d50ed05f3a915775
 SHA1 (patch-src_bootstrap_lib.rs) = d86e173b931099730a4f18d044d7977c89f87b91
 SHA1 (patch-src_libbacktrace_configure) = b2c1e9b93a99408aad42ab9f1af27704cc81bdd8
+SHA1 (patch-src_liblibc_src_unix_bsd_netbsdlike_netbsd_mod.rs) = e5b564bb247094cc8e4e6935a02262b3385cb7e6
 SHA1 (patch-src_liblibc_src_unix_solaris_mod.rs) = aeb7c22995e33c700ce3ea4336368a1fd08120e1
 SHA1 (patch-src_libstd_build.rs) = 1edbf87339bd88e3178d4fa2fc408a6e802ed488
 SHA1 (patch-src_libstd_sys_unix_thread.rs) = 46ef46365658e2f895bd3dde9c74f352890e9ccc
diff -r 5390d64f52e0 -r 45b8780e7c12 lang/rust/patches/patch-src_liblibc_src_unix_bsd_netbsdlike_netbsd_mod.rs
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/rust/patches/patch-src_liblibc_src_unix_bsd_netbsdlike_netbsd_mod.rs Wed Oct 31 16:30:44 2018 +0000
@@ -0,0 +1,137 @@
+$NetBSD: patch-src_liblibc_src_unix_bsd_netbsdlike_netbsd_mod.rs,v 1.1 2018/10/31 16:30:44 martin Exp $
+
+Temporary patch untill 
+
+       https://github.com/rust-lang/libc/pull/1108
+
+gets merged upstream.
+Fixes mutex/pthread types for some NetBSD architectures.
+
+--- src/liblibc/src/unix/bsd/netbsdlike/netbsd/mod.rs.orig     2018-10-24 22:01:28.000000000 +0200
++++ src/liblibc/src/unix/bsd/netbsdlike/netbsd/mod.rs  2018-10-30 13:26:45.473542210 +0100
+@@ -9,6 +9,21 @@ pub type fsfilcnt_t = ::uint64_t;
+ pub type idtype_t = ::c_int;
+ pub type mqd_t = ::c_int;
+ 
++cfg_if! {
++    if #[cfg(any(target_arch = "aarch64",
++                 target_arch = "sparc", target_arch = "sparc64",
++                 target_arch = "x86", target_arch = "x86_64"))] {
++        type __cpu_simple_lock_t = ::c_uchar;
++    } else if #[cfg(any(target_arch = "arm", target_arch = "powerpc",
++                        target_arch = "powerpc64"))] {
++        type __cpu_simple_lock_t = ::c_int;
++    } else if #[cfg(any(target_arch = "mips", target_arch = "mips64"))] {
++        type __cpu_simple_lock_t = ::c_uint;
++    } else {
++        // Unknown target_arch
++    }
++}
++
+ s! {
+     pub struct aiocb {
+         pub aio_offset: ::off_t,
+@@ -160,9 +175,13 @@ s! {
+ 
+     pub struct pthread_mutex_t {
+         ptm_magic: ::c_uint,
+-        ptm_errorcheck: ::c_uchar,
++        ptm_errorcheck: __cpu_simple_lock_t,
++        #[cfg(any(target_arch = "sparc", target_arch = "sparc64",
++                 target_arch = "x86", target_arch = "x86_64"))]
+         ptm_pad1: [u8; 3],
+-        ptm_interlock: ::c_uchar,
++        ptm_interlock: __cpu_simple_lock_t,
++        #[cfg(any(target_arch = "sparc", target_arch = "sparc64",
++                 target_arch = "x86", target_arch = "x86_64"))]
+         ptm_pad2: [u8; 3],
+         ptm_owner: ::pthread_t,
+         ptm_waiters: *mut u8,
+@@ -182,7 +201,7 @@ s! {
+ 
+     pub struct pthread_cond_t {
+         ptc_magic: ::c_uint,
+-        ptc_lock: ::c_uchar,
++        ptc_lock: __cpu_simple_lock_t,
+         ptc_waiters_first: *mut u8,
+         ptc_waiters_last: *mut u8,
+         ptc_mutex: *mut ::pthread_mutex_t,
+@@ -196,7 +215,7 @@ s! {
+ 
+     pub struct pthread_rwlock_t {
+         ptr_magic: ::c_uint,
+-        ptr_interlock: ::c_uchar,
++        ptr_interlock: __cpu_simple_lock_t,
+         ptr_rblocked_first: *mut u8,
+         ptr_rblocked_last: *mut u8,
+         ptr_wblocked_first: *mut u8,
+@@ -692,17 +711,33 @@ pub const FD_SETSIZE: usize = 0x100;
+ 
+ pub const ST_NOSUID: ::c_ulong = 8;
+ 
+-pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
+-    ptm_magic: 0x33330003,
+-    ptm_errorcheck: 0,
+-    ptm_interlock: 0,
+-    ptm_waiters: 0 as *mut _,
+-    ptm_owner: 0,
+-    ptm_pad1: [0; 3],
+-    ptm_pad2: [0; 3],
+-    ptm_recursed: 0,
+-    ptm_spare2: 0 as *mut _,
+-};
++cfg_if! {
++    if #[cfg(any(target_arch = "sparc", target_arch = "sparc64",
++                 target_arch = "x86", target_arch = "x86_64"))] {
++        pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
++            ptm_magic: 0x33330003,
++            ptm_errorcheck: 0,
++            ptm_interlock: 0,
++            ptm_waiters: 0 as *mut _,
++            ptm_owner: 0,
++            ptm_pad1: [0; 3],
++            ptm_pad2: [0; 3],
++            ptm_recursed: 0,
++            ptm_spare2: 0 as *mut _,
++        };
++    } else {
++        pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
++            ptm_magic: 0x33330003,
++            ptm_errorcheck: 0,
++            ptm_interlock: 0,
++            ptm_waiters: 0 as *mut _,
++            ptm_owner: 0,
++            ptm_recursed: 0,
++            ptm_spare2: 0 as *mut _,
++        };
++    }
++}
++
+ pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
+     ptc_magic: 0x55550005,
+     ptc_lock: 0,
+@@ -969,6 +1004,15 @@ pub const SOCK_NONBLOCK: ::c_int = 0x200
+ 
+ pub const SIGSTKSZ : ::size_t = 40960;
+ 
++pub const PT_DUMPCORE: ::c_int = 12;
++pub const PT_LWPINFO: ::c_int = 13;
++pub const PT_SYSCALL: ::c_int = 14;
++pub const PT_SYSCALLEMU: ::c_int = 15;
++pub const PT_SET_EVENT_MASK: ::c_int = 16;
++pub const PT_GET_EVENT_MASK: ::c_int = 17;
++pub const PT_GET_PROCESS_STATE: ::c_int = 18;
++pub const PT_FIRSTMACH: ::c_int = 32;
++
+ // dirfd() is a macro on netbsd to access
+ // the first field of the struct where dirp points to:
+ // http://cvsweb.netbsd.org/bsdweb.cgi/src/include/dirent.h?rev=1.36
+@@ -1097,6 +1141,8 @@ extern {
+                      base: ::locale_t) -> ::locale_t;
+     #[link_name = "__settimeofday50"]
+     pub fn settimeofday(tv: *const ::timeval, tz: *const ::c_void) -> ::c_int;
++
++    pub fn dup3(src: ::c_int, dst: ::c_int, flags: ::c_int) -> ::c_int;
+ }
+ 
+ #[link(name = "util")]



Home | Main Index | Thread Index | Old Index