pkgsrc-WIP-changes archive

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

rust185: unbreak the build for NetBSD/riscv64



Module Name:	pkgsrc-wip
Committed By:	Havard Eidnes <he%NetBSD.org@localhost>
Pushed By:	he
Date:		Mon Feb 24 12:51:03 2025 +0000
Changeset:	b0049fbb8a855798be75087f7367b7dda4e2529a

Modified Files:
	rust185/Makefile
	rust185/distinfo
Added Files:
	rust185/patches/patch-vendor_libc-0.2.169_src_unix_bsd_netbsdlike_netbsd_riscv64.rs

Log Message:
rust185: unbreak the build for NetBSD/riscv64

...by cargo-culting around with the riscv64.rs "libc" module
version 0.2.169 until it builds.  Obviously needs to be passed
over by someone fluent in rust, which I'm not.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=b0049fbb8a855798be75087f7367b7dda4e2529a

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 rust185/Makefile                                   |  2 +
 rust185/distinfo                                   |  1 +
 ...2.169_src_unix_bsd_netbsdlike_netbsd_riscv64.rs | 90 ++++++++++++++++++++++
 3 files changed, 93 insertions(+)

diffs:
diff --git a/rust185/Makefile b/rust185/Makefile
index 108201f9e5..eaad908b29 100644
--- a/rust185/Makefile
+++ b/rust185/Makefile
@@ -460,6 +460,8 @@ CKSUMS+=	dc216609dfc6b2835e26f8c3e70f4c7c65425933eef04538de603f51e9429ec5
 CKSUMS+=	04004bda0ea97d55c3588a7d82fa1faf0d150c5390250a298216ff3cc899b911
 CKSUMS+=	b5dae853ebfc3355b155f8c20f3a481517bce27e164e304f56dfff172e313098
 CKSUMS+=	55fb7f2c0877231286b2b6515e08eda1d5cac1311a402d0aa162c7eb867ee19b
+CKSUMS+=	0b1936bad97b3a272c2d323d3435f6860fc355abe7603ca7ed8c4166cac75cc5
+CKSUMS+=	1eb383a057cdf2826d884b19142bf0b68b6b30c5bc20baf7ee10401a92a8ef22
 
 CKSUM_CRATES+=	vendor/zerocopy-0.7.32
 CKSUMS+=	2f21f18a4ca1d4be2d997f037158cb21a7421b2ba2cc52f3e4c5f9410197ed27
diff --git a/rust185/distinfo b/rust185/distinfo
index a8a633c19f..ebf6863c8d 100644
--- a/rust185/distinfo
+++ b/rust185/distinfo
@@ -145,6 +145,7 @@ SHA1 (patch-vendor_libc-0.2.158_src_unix_solarish_mod.rs) = 194bd1dbbc568cc596ab
 SHA1 (patch-vendor_libc-0.2.167_src_unix_bsd_netbsdlike_netbsd_mod.rs) = 2cfc335e8ac0855fe04ffb1b870771b085316655
 SHA1 (patch-vendor_libc-0.2.167_src_unix_solarish_mod.rs) = e4304cbfdad03c7da68ab95260af3a07bdde7b64
 SHA1 (patch-vendor_libc-0.2.169_src_unix_bsd_netbsdlike_netbsd_mod.rs) = 02c4efefbf1e9e1bd98eb9524515677250ae7454
+SHA1 (patch-vendor_libc-0.2.169_src_unix_bsd_netbsdlike_netbsd_riscv64.rs) = c5e1c2d896d5e9d32aeb56bc3e4d9fb26be9edf0
 SHA1 (patch-vendor_libc-0.2.169_src_unix_solarish_mod.rs) = e02c56106a092b4f2e27427ea8b5d96bf437c356
 SHA1 (patch-vendor_line-index-0.1.2_src_lib.rs) = 30aa5c82630ea0e8969abb527c11640712efba1e
 SHA1 (patch-vendor_lzma-sys-0.1.20_config.h) = 4849052ddb2f04f539fd7060fc1b43cc3acf99c4
diff --git a/rust185/patches/patch-vendor_libc-0.2.169_src_unix_bsd_netbsdlike_netbsd_riscv64.rs b/rust185/patches/patch-vendor_libc-0.2.169_src_unix_bsd_netbsdlike_netbsd_riscv64.rs
new file mode 100644
index 0000000000..a44e84040e
--- /dev/null
+++ b/rust185/patches/patch-vendor_libc-0.2.169_src_unix_bsd_netbsdlike_netbsd_riscv64.rs
@@ -0,0 +1,90 @@
+$NetBSD$
+
+Unbreak this module.
+
+I admit to this entirely being based on "cargo cult", but at least
+the rust compiler (cross-)builds for NetBSD/risc64 with this,
+whereas it did not earlier.
+
+--- vendor/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/riscv64.rs.orig	2025-02-24 07:49:42.565876506 +0000
++++ vendor/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/riscv64.rs
+@@ -1,4 +1,4 @@
+-use PT_FIRSTMACH;
++use crate::PT_FIRSTMACH;
+ 
+ use crate::prelude::*;
+ 
+@@ -8,20 +8,66 @@ pub type c_char = u8;
+ pub type __greg_t = u64;
+ pub type __cpu_simple_lock_nv_t = c_int;
+ pub type __gregset = [__greg_t; _NGREG];
+-pub type __fregset = [__freg; _NFREG];
++pub type __fregset = [__fpreg; _NFREG];
+ 
+-s! {
++s_no_extra_traits! {
++    pub union __fpreg {
++        #[cfg(libc_union)]
++        pub u_u64: u64,
++        pub u_d: c_double,
++    }
+     pub struct mcontext_t {
+         pub __gregs: __gregset,
+-        pub __fregs: __fpregset,
++        pub __fregs: __fregset,
+         __spare: [crate::__greg_t; 7],
+     }
+ }
+ 
+-s_no_extra_traits! {
+-    pub union __fpreg {
+-        pub u_u64: u64,
+-        pub u_d: c_double,
++cfg_if! {
++    if #[cfg(feature = "extra_traits")] {
++//      use ::self::fmt;
++//      use ::self::hash;
++	use core::marker::Copy;
++	use core::clone::Clone;
++        #[cfg(libc_union)]
++        impl PartialEq for __fpreg {
++            fn eq(&self, other: &__fpreg) -> bool {
++                unsafe {
++                    self.u_64 == other.u_64
++                        || self.u_d == other.u_d
++                }
++            }
++        }
++        #[cfg(libc_union)]
++        impl Eq for __fpreg {}
++        #[cfg(libc_union)]
++        impl ::fmt::Debug for __fpreg {
++            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
++                unsafe {
++                    f.debug_struct("__fpreg")
++                        .field("u_u64", &self.u_64)
++                        .field("u_d", &self.u_d)
++                        .finish()
++                }
++            }
++        }
++        #[cfg(libc_union)]
++        impl ::hash::Hash for __fpreg {
++            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
++                unsafe {
++                    self.u_64.hash(state);
++                    self.u_d.hash(state);
++                }
++            }
++        }
++        #[cfg(libc_union)]
++        impl ::Copy for __fpreg {}
++        #[cfg(libc_union)]
++        impl ::Clone for __fpreg {
++            fn clone(&self) -> __fpreg {
++                *self
++            }
++        }
+     }
+ }
+ 


Home | Main Index | Thread Index | Old Index