Skip to content

Commit

Permalink
rust: For NetBSD, apply fix to cpuid_t definition.
Browse files Browse the repository at this point in the history
This applies the change from
  rust-lang/libc#3386

Also, include mipsel in the NetBSD targets again -- it builds again!
  • Loading branch information
he32 committed Oct 14, 2023
1 parent 25c8ca0 commit 99c0f73
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 8 deletions.
8 changes: 4 additions & 4 deletions rust/distinfo
Expand Up @@ -142,20 +142,20 @@ SHA1 (patch-vendor_crossbeam-epoch_no__atomic.rs) = a493d0b57a22b9a83c843a1076c9
SHA1 (patch-vendor_crossbeam-utils-0.8.14-no__atomic.rs) = 2053e2cffcb2981435c94df04d0e3f333fa77c07
SHA1 (patch-vendor_crossbeam-utils_no__atomic.rs) = 26f797159530bc2c5e1be83a225a13e5458879b2
SHA1 (patch-vendor_libc-0.2.138_src_unix_bsd_netbsdlike_netbsd_mips.rs) = eda31064a08cba20fc0652b669e419871875ae29
SHA1 (patch-vendor_libc-0.2.138_src_unix_bsd_netbsdlike_netbsd_mod.rs) = e9c180ddbbd06ba2e0701bec11f1e6c954c0a0d4
SHA1 (patch-vendor_libc-0.2.138_src_unix_bsd_netbsdlike_netbsd_mod.rs) = 33d06b92a65908185226f8aed055782e5b5a613a
SHA1 (patch-vendor_libc-0.2.138_src_unix_bsd_netbsdlike_netbsd_riscv64.rs) = 24ebcb044aeefec3415323b77ac25805a98b296e
SHA1 (patch-vendor_libc-0.2.140_src_unix_bsd_netbsdlike_netbsd_mips.rs) = 998160de7640c4567bf042dfa7a74a4555b0568b
SHA1 (patch-vendor_libc-0.2.140_src_unix_bsd_netbsdlike_netbsd_mod.rs) = 7a92e3c04a7e18586e89ee8907758dc2fb81a192
SHA1 (patch-vendor_libc-0.2.140_src_unix_bsd_netbsdlike_netbsd_mod.rs) = 2b0b4320aaed24514c1fdc8bbbeeb59191b36058
SHA1 (patch-vendor_libc-0.2.140_src_unix_bsd_netbsdlike_netbsd_riscv64.rs) = 74b6353687cdc029bcdc9110b7b1e96e9ffb8e43
SHA1 (patch-vendor_libc-0.2.140_src_unix_solarish_mod.rs) = c3db9af7ebcc4356015159c170603b620c21dde0
SHA1 (patch-vendor_libc-0.2.141_src_unix_bsd_netbsdlike_netbsd_mips.rs) = b99ebc7233690df5dd3fa7674d86ec08831eec59
SHA1 (patch-vendor_libc-0.2.141_src_unix_bsd_netbsdlike_netbsd_riscv64.rs) = 511e5d97083638352d77a463582aca8812602b45
SHA1 (patch-vendor_libc-0.2.146_src_unix_bsd_netbsdlike_netbsd_mips.rs) = 4b9ff57adb8d67f467eb36c023548afef8b1ed74
SHA1 (patch-vendor_libc-0.2.146_src_unix_bsd_netbsdlike_netbsd_mod.rs) = f008995009548ec2afb733f5fcbfc6a076316c3d
SHA1 (patch-vendor_libc-0.2.146_src_unix_bsd_netbsdlike_netbsd_mod.rs) = 3434376111d3f4759eab5eb278eb64ac5e170ffb
SHA1 (patch-vendor_libc-0.2.146_src_unix_bsd_netbsdlike_netbsd_riscv64.rs) = 66b4cd0853154e6a8fcd009a06ebbae5a1c98f82
SHA1 (patch-vendor_libc-0.2.146_src_unix_solarish_mod.rs) = 17884a63798eee6d68771faa8d9592525aa2a3bb
SHA1 (patch-vendor_libc_src_unix_bsd_netbsdlike_netbsd_mips.rs) = 09326b70d7821b1742285c464c70b347400191d7
SHA1 (patch-vendor_libc_src_unix_bsd_netbsdlike_netbsd_mod.rs) = 50df059ffa3426a73e6978fe22c6e053eed8dce4
SHA1 (patch-vendor_libc_src_unix_bsd_netbsdlike_netbsd_mod.rs) = 4ad61200f935032f411a719c2e1d4724a7def652
SHA1 (patch-vendor_libc_src_unix_bsd_netbsdlike_netbsd_riscv64.rs) = a0434dfc965e4286dc4a21c6433edbd30eb16779
SHA1 (patch-vendor_libc_src_unix_solarish_mod.rs) = 8364e19ea09203d32494c37ff3db19fe3d6b9d8a
SHA1 (patch-vendor_lzma-sys_config.h) = b654c7e129fa02697734bc87173f89b3056a5437
Expand Down
2 changes: 0 additions & 2 deletions rust/do-cross.mk
Expand Up @@ -13,8 +13,6 @@ SHORT_TARGETS+= arm64
SHORT_TARGETS+= arm64_be
SHORT_TARGETS+= i386
SHORT_TARGETS+= riscv64

# can't find -latomic(!) late in the build:
SHORT_TARGETS+= mipsel # produces mips32 (not mips1) executables

# Conditional local overrides of ROOT.* variables:
Expand Down
Expand Up @@ -3,8 +3,20 @@ $NetBSD$
Add execinfo / backtrace stuff for NetBSD, and handle NetBSD/mips
and NetBSD/riscv64.

Add fix to cpuid_t definition by applying
https://github.com/rust-lang/libc/pull/3386

--- vendor/libc-0.2.138/src/unix/bsd/netbsdlike/netbsd/mod.rs.orig 2023-04-16 23:32:41.000000000 +0000
+++ vendor/libc-0.2.138/src/unix/bsd/netbsdlike/netbsd/mod.rs
@@ -10,7 +10,7 @@ type __pthread_spin_t = __cpu_simple_loc
pub type vm_size_t = ::uintptr_t; // FIXME: deprecated since long time
pub type lwpid_t = ::c_uint;
pub type shmatt_t = ::c_uint;
-pub type cpuid_t = u64;
+pub type cpuid_t = ::c_ulong;
pub type cpuset_t = _cpuset;
pub type pthread_spin_t = ::c_uchar;
pub type timer_t = ::c_int;
@@ -3049,6 +3049,22 @@ extern "C" {
pub fn kinfo_getvmmap(pid: ::pid_t, cntp: *mut ::size_t) -> *mut kinfo_vmentry;
}
Expand Down
Expand Up @@ -3,8 +3,20 @@ $NetBSD$
Add support for NetBSD/mipsel and NetBSD/riscv64.
Also try to enable backtrace support.

Add fix to cpuid_t definition by applying
https://github.com/rust-lang/libc/pull/3386

--- vendor/libc-0.2.140/src/unix/bsd/netbsdlike/netbsd/mod.rs.orig 2023-07-12 05:06:31.000000000 +0000
+++ vendor/libc-0.2.140/src/unix/bsd/netbsdlike/netbsd/mod.rs
@@ -10,7 +10,7 @@ type __pthread_spin_t = __cpu_simple_loc
pub type vm_size_t = ::uintptr_t; // FIXME: deprecated since long time
pub type lwpid_t = ::c_uint;
pub type shmatt_t = ::c_uint;
-pub type cpuid_t = u64;
+pub type cpuid_t = ::c_ulong;
pub type cpuset_t = _cpuset;
pub type pthread_spin_t = ::c_uchar;
pub type timer_t = ::c_int;
@@ -3111,6 +3111,22 @@ extern "C" {
pub fn kinfo_getvmmap(pid: ::pid_t, cntp: *mut ::size_t) -> *mut kinfo_vmentry;
}
Expand Down
Expand Up @@ -3,8 +3,20 @@ $NetBSD$
Add support for NetBSD/mipsel and NetBSD/riscv64.
Also try to enable backtrace support.

Add fix to cpuid_t definition by applying
https://github.com/rust-lang/libc/pull/3386

--- vendor/libc-0.2.146/src/unix/bsd/netbsdlike/netbsd/mod.rs.orig 2023-07-12 05:06:31.000000000 +0000
+++ vendor/libc-0.2.146/src/unix/bsd/netbsdlike/netbsd/mod.rs
@@ -10,7 +10,7 @@ type __pthread_spin_t = __cpu_simple_loc
pub type vm_size_t = ::uintptr_t; // FIXME: deprecated since long time
pub type lwpid_t = ::c_uint;
pub type shmatt_t = ::c_uint;
-pub type cpuid_t = u64;
+pub type cpuid_t = ::c_ulong;
pub type cpuset_t = _cpuset;
pub type pthread_spin_t = ::c_uchar;
pub type timer_t = ::c_int;
@@ -3153,6 +3153,22 @@ extern "C" {
pub fn kinfo_getvmmap(pid: ::pid_t, cntp: *mut ::size_t) -> *mut kinfo_vmentry;
}
Expand Down
Expand Up @@ -3,9 +3,21 @@ $NetBSD$
Copy execinfo function definitions from openbsd's mod.rs.
Add entries for NetBSD/mipsel and NetBSD/riscv64.

Add fix to cpuid_t definition by applying
https://github.com/rust-lang/libc/pull/3386

--- vendor/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs.orig 2022-05-10 20:59:35.217463943 +0000
+++ vendor/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs
@@ -3111,6 +3111,22 @@ extern "C" {
@@ -10,7 +10,7 @@ type __pthread_spin_t = __cpu_simple_loc
pub type vm_size_t = ::uintptr_t; // FIXME: deprecated since long time
pub type lwpid_t = ::c_uint;
pub type shmatt_t = ::c_uint;
-pub type cpuid_t = u64;
+pub type cpuid_t = ::c_ulong;
pub type cpuset_t = _cpuset;
pub type pthread_spin_t = ::c_uchar;
pub type timer_t = ::c_int;
@@ -3153,6 +3153,22 @@ extern "C" {
pub fn kinfo_getvmmap(pid: ::pid_t, cntp: *mut ::size_t) -> *mut kinfo_vmentry;
}

Expand All @@ -28,7 +40,7 @@ Add entries for NetBSD/mipsel and NetBSD/riscv64.
cfg_if! {
if #[cfg(target_arch = "aarch64")] {
mod aarch64;
@@ -3130,7 +3146,15 @@ cfg_if! {
@@ -3172,7 +3188,15 @@ cfg_if! {
} else if #[cfg(target_arch = "x86")] {
mod x86;
pub use self::x86::*;
Expand Down

0 comments on commit 99c0f73

Please sign in to comment.