diff options
author | martin <martin@pkgsrc.org> | 2018-10-31 16:30:44 +0000 |
---|---|---|
committer | martin <martin@pkgsrc.org> | 2018-10-31 16:30:44 +0000 |
commit | 7ab93df937d293c395dca06bdca7757d1995f9b9 (patch) | |
tree | 381668365484a5b62d364d96117dcef9d74fa87c /lang/rust | |
parent | c63eff9d505b3a5703179886b5591cabbf4f01c2 (diff) | |
download | pkgsrc-7ab93df937d293c395dca06bdca7757d1995f9b9.tar.gz |
Add patch from jakllsch (not merged upstream yet) to fix some pthread/
mutex types for some NetBSD architectures.
Diffstat (limited to 'lang/rust')
-rw-r--r-- | lang/rust/distinfo | 3 | ||||
-rw-r--r-- | lang/rust/patches/patch-src_liblibc_src_unix_bsd_netbsdlike_netbsd_mod.rs | 137 |
2 files changed, 139 insertions, 1 deletions
diff --git a/lang/rust/distinfo b/lang/rust/distinfo index 67f48cea1ee..cb78b163e24 100644 --- a/lang/rust/distinfo +++ b/lang/rust/distinfo @@ -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_bin_rustc.rs) = 0abf893090a6053e01fd658096d9a2b5b8c144 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 --git a/lang/rust/patches/patch-src_liblibc_src_unix_bsd_netbsdlike_netbsd_mod.rs b/lang/rust/patches/patch-src_liblibc_src_unix_bsd_netbsdlike_netbsd_mod.rs new file mode 100644 index 00000000000..e1825fae18d --- /dev/null +++ b/lang/rust/patches/patch-src_liblibc_src_unix_bsd_netbsdlike_netbsd_mod.rs @@ -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")] |