diff options
Diffstat (limited to 'lang/rust/files')
23 files changed, 23 insertions, 385 deletions
diff --git a/lang/rust/files/patch-library_stdarch_crates_std__detect_src_detect_os_aarch64.rs b/lang/rust/files/patch-library_stdarch_crates_std__detect_src_detect_os_aarch64.rs new file mode 100644 index 000000000000..920c78536499 --- /dev/null +++ b/lang/rust/files/patch-library_stdarch_crates_std__detect_src_detect_os_aarch64.rs @@ -0,0 +1,13 @@ +https://github.com/rust-lang/stdarch/pull/1290/commits/4557e223d895067d5c5a627c26929de060868c22 + +--- library/stdarch/crates/std_detect/src/detect/os/aarch64.rs.orig 2022-03-08 09:13:53 UTC ++++ library/stdarch/crates/std_detect/src/detect/os/aarch64.rs +@@ -16,6 +16,7 @@ + //! - [Zircon implementation](https://fuchsia.googlesource.com/zircon/+/master/kernel/arch/arm64/feature.cpp) + //! - [Linux documentation](https://www.kernel.org/doc/Documentation/arm64/cpu-feature-registers.txt) + ++use core::arch::asm; + use crate::detect::{cache, Feature}; + + /// Try to read the features from the system registers. + diff --git a/lang/rust/files/riscv64/patch-compiler_rustc__llvm_build.rs b/lang/rust/files/riscv64/patch-compiler_rustc__llvm_build.rs deleted file mode 100644 index 1786f3e285df..000000000000 --- a/lang/rust/files/riscv64/patch-compiler_rustc__llvm_build.rs +++ /dev/null @@ -1,16 +0,0 @@ ---- compiler/rustc_llvm/build.rs.orig 2021-11-29 19:27:11 UTC -+++ compiler/rustc_llvm/build.rs -@@ -276,8 +276,11 @@ fn main() { - "stdc++" - }; - -- // RISC-V requires libatomic for sub-word atomic operations -- if target.starts_with("riscv") { -+ // RISC-V GCC erroneously requires libatomic for sub-word -+ // atomic operations. FreeBSD uses Clang as its system -+ // compiler and provides no libatomic in its base system so -+ // does not want this. -+ if !target.contains("freebsd") && target.starts_with("riscv") { - println!("cargo:rustc-link-lib=atomic"); - } - diff --git a/lang/rust/files/riscv64/patch-compiler_rustc__target_src_spec_mod.rs b/lang/rust/files/riscv64/patch-compiler_rustc__target_src_spec_mod.rs deleted file mode 100644 index f08735462131..000000000000 --- a/lang/rust/files/riscv64/patch-compiler_rustc__target_src_spec_mod.rs +++ /dev/null @@ -1,10 +0,0 @@ ---- compiler/rustc_target/src/spec/mod.rs.orig 2021-11-04 11:23:50 UTC -+++ compiler/rustc_target/src/spec/mod.rs -@@ -805,6 +805,7 @@ supported_targets! { - ("powerpc-unknown-freebsd", powerpc_unknown_freebsd), - ("powerpc64-unknown-freebsd", powerpc64_unknown_freebsd), - ("powerpc64le-unknown-freebsd", powerpc64le_unknown_freebsd), -+ ("riscv64gc-unknown-freebsd", riscv64gc_unknown_freebsd), - ("x86_64-unknown-freebsd", x86_64_unknown_freebsd), - - ("x86_64-unknown-dragonfly", x86_64_unknown_dragonfly), diff --git a/lang/rust/files/riscv64/patch-compiler_rustc__target_src_spec_riscv64gc__unknown__freebsd.rs b/lang/rust/files/riscv64/patch-compiler_rustc__target_src_spec_riscv64gc__unknown__freebsd.rs deleted file mode 100644 index 9dcbb17ab3c0..000000000000 --- a/lang/rust/files/riscv64/patch-compiler_rustc__target_src_spec_riscv64gc__unknown__freebsd.rs +++ /dev/null @@ -1,21 +0,0 @@ ---- compiler/rustc_target/src/spec/riscv64gc_unknown_freebsd.rs.orig 2021-11-04 11:22:10 UTC -+++ compiler/rustc_target/src/spec/riscv64gc_unknown_freebsd.rs -@@ -0,0 +1,18 @@ -+use crate::spec::{CodeModel, Target, TargetOptions}; -+ -+pub fn target() -> Target { -+ Target { -+ llvm_target: "riscv64-unknown-freebsd".to_string(), -+ pointer_width: 64, -+ data_layout: "e-m:e-p:64:64-i64:64-i128:128-n64-S128".to_string(), -+ arch: "riscv64".to_string(), -+ options: TargetOptions { -+ code_model: Some(CodeModel::Medium), -+ cpu: "generic-rv64".to_string(), -+ features: "+m,+a,+f,+d,+c".to_string(), -+ llvm_abiname: "lp64d".to_string(), -+ max_atomic_width: Some(64), -+ ..super::freebsd_base::opts() -+ }, -+ } -+} diff --git a/lang/rust/files/riscv64/patch-library_std_src_os_raw_mod.rs b/lang/rust/files/riscv64/patch-library_std_src_os_raw_mod.rs deleted file mode 100644 index e880f73fd205..000000000000 --- a/lang/rust/files/riscv64/patch-library_std_src_os_raw_mod.rs +++ /dev/null @@ -1,22 +0,0 @@ ---- library/std/src/os/raw/mod.rs.orig 2021-11-05 15:16:50 UTC -+++ library/std/src/os/raw/mod.rs -@@ -68,7 +68,8 @@ type_alias! { "char.md", c_char = u8, NonZero_c_char = - target_arch = "aarch64", - target_arch = "arm", - target_arch = "powerpc", -- target_arch = "powerpc64" -+ target_arch = "powerpc64", -+ target_arch = "riscv64" - ) - ), - all( -@@ -110,7 +111,8 @@ type_alias! { "char.md", c_char = i8, NonZero_c_char = - target_arch = "aarch64", - target_arch = "arm", - target_arch = "powerpc", -- target_arch = "powerpc64" -+ target_arch = "powerpc64", -+ target_arch = "riscv64" - ) - ), - all( diff --git a/lang/rust/files/riscv64/patch-library_stdarch_crates_std__detect_src_detect_os_freebsd_auxvec.rs b/lang/rust/files/riscv64/patch-library_stdarch_crates_std__detect_src_detect_os_freebsd_auxvec.rs deleted file mode 100644 index d2df5bd0056f..000000000000 --- a/lang/rust/files/riscv64/patch-library_stdarch_crates_std__detect_src_detect_os_freebsd_auxvec.rs +++ /dev/null @@ -1,12 +0,0 @@ ---- library/stdarch/crates/std_detect/src/detect/os/freebsd/auxvec.rs.orig 2021-10-18 09:52:55 UTC -+++ library/stdarch/crates/std_detect/src/detect/os/freebsd/auxvec.rs -@@ -3,7 +3,8 @@ - any( - target_arch = "aarch64", - target_arch = "arm", -- target_arch = "powerpc64" -+ target_arch = "powerpc64", -+ target_arch = "riscv64" - ), - allow(dead_code) - )] diff --git a/lang/rust/files/riscv64/patch-src_bootstrap_bootstrap.py b/lang/rust/files/riscv64/patch-src_bootstrap_bootstrap.py deleted file mode 100644 index d384c0990ca5..000000000000 --- a/lang/rust/files/riscv64/patch-src_bootstrap_bootstrap.py +++ /dev/null @@ -1,11 +0,0 @@ ---- src/bootstrap/bootstrap.py.orig 2021-11-11 14:21:03 UTC -+++ src/bootstrap/bootstrap.py -@@ -283,7 +283,7 @@ def default_build_triple(verbose): - err = "unknown OS type: {}".format(ostype) - sys.exit(err) - -- if cputype == 'powerpc' and ostype == 'unknown-freebsd': -+ if cputype in ['powerpc', 'riscv'] and ostype == 'unknown-freebsd': - cputype = subprocess.check_output( - ['uname', '-p']).strip().decode(default_encoding) - cputype_mapper = { diff --git a/lang/rust/files/riscv64/patch-src_bootstrap_native.rs b/lang/rust/files/riscv64/patch-src_bootstrap_native.rs deleted file mode 100644 index df56a7f09589..000000000000 --- a/lang/rust/files/riscv64/patch-src_bootstrap_native.rs +++ /dev/null @@ -1,20 +0,0 @@ ---- src/bootstrap/native.rs.orig 2021-11-29 19:27:11 UTC -+++ src/bootstrap/native.rs -@@ -248,9 +248,14 @@ impl Step for Llvm { - } - } - -- if target.starts_with("riscv") { -- // In RISC-V, using C++ atomics require linking to `libatomic` but the LLVM build -- // system check cannot detect this. Therefore it is set manually here. -+ if !target.contains("freebsd") && target.starts_with("riscv") { -+ // RISC-V GCC erroneously requires linking against -+ // `libatomic` when using 1-byte and 2-byte C++ -+ // atomics but the LLVM build system check cannot -+ // detect this. Therefore it is set manually here. -+ // FreeBSD uses Clang as its system compiler and -+ // provides no libatomic in its base system so does -+ // not want this. - if !builder.config.llvm_tools_enabled { - cfg.define("CMAKE_EXE_LINKER_FLAGS", "-latomic"); - } else { diff --git a/lang/rust/files/riscv64/patch-src_doc_rustc_src_platform-support.md b/lang/rust/files/riscv64/patch-src_doc_rustc_src_platform-support.md deleted file mode 100644 index 9f82379f9187..000000000000 --- a/lang/rust/files/riscv64/patch-src_doc_rustc_src_platform-support.md +++ /dev/null @@ -1,10 +0,0 @@ ---- src/doc/rustc/src/platform-support.md.orig 2021-11-04 11:32:01 UTC -+++ src/doc/rustc/src/platform-support.md -@@ -261,6 +261,7 @@ target | std | host | notes - `riscv32gc-unknown-linux-gnu` | | | RISC-V Linux (kernel 5.4, glibc 2.33) - `riscv32gc-unknown-linux-musl` | | | RISC-V Linux (kernel 5.4, musl + RISCV32 support patches) - `riscv32imc-esp-espidf` | ✓ | | RISC-V ESP-IDF -+`riscv64gc-unknown-freebsd` | | | RISC-V FreeBSD - `riscv64gc-unknown-linux-musl` | | | RISC-V Linux (kernel 4.20, musl 1.2.0) - `s390x-unknown-linux-musl` | | | S390x Linux (kernel 2.6.32, MUSL) - `sparc-unknown-linux-gnu` | ✓ | | 32-bit SPARC Linux diff --git a/lang/rust/files/riscv64/patch-vendor_libc-0.2.106_src_unix_bsd_freebsdlike_freebsd_freebsd11_mod.rs b/lang/rust/files/riscv64/patch-vendor_libc-0.2.108_src_unix_bsd_freebsdlike_freebsd_freebsd11_mod.rs index bdde822353ff..4427d55ed653 100644 --- a/lang/rust/files/riscv64/patch-vendor_libc-0.2.106_src_unix_bsd_freebsdlike_freebsd_freebsd11_mod.rs +++ b/lang/rust/files/riscv64/patch-vendor_libc-0.2.108_src_unix_bsd_freebsdlike_freebsd_freebsd11_mod.rs @@ -1,5 +1,5 @@ ---- vendor/libc-0.2.106/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs.orig 2021-11-29 20:27:33 UTC -+++ vendor/libc-0.2.106/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs +--- vendor/libc-0.2.108/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs.orig 2021-11-29 20:27:33 UTC ++++ vendor/libc-0.2.108/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs @@ -217,7 +217,8 @@ extern "C" { cfg_if! { diff --git a/lang/rust/files/riscv64/patch-vendor_libc-0.2.106_src_unix_bsd_freebsdlike_freebsd_freebsd12_mod.rs b/lang/rust/files/riscv64/patch-vendor_libc-0.2.108_src_unix_bsd_freebsdlike_freebsd_freebsd12_mod.rs index bde4f77fac49..18f866da36eb 100644 --- a/lang/rust/files/riscv64/patch-vendor_libc-0.2.106_src_unix_bsd_freebsdlike_freebsd_freebsd12_mod.rs +++ b/lang/rust/files/riscv64/patch-vendor_libc-0.2.108_src_unix_bsd_freebsdlike_freebsd_freebsd12_mod.rs @@ -1,5 +1,5 @@ ---- vendor/libc-0.2.106/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs.orig 2021-11-29 20:27:33 UTC -+++ vendor/libc-0.2.106/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs +--- vendor/libc-0.2.108/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs.orig 2021-11-29 20:27:33 UTC ++++ vendor/libc-0.2.108/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs @@ -241,7 +241,8 @@ extern "C" { cfg_if! { diff --git a/lang/rust/files/riscv64/patch-vendor_libc-0.2.106_src_unix_bsd_freebsdlike_freebsd_freebsd13_mod.rs b/lang/rust/files/riscv64/patch-vendor_libc-0.2.108_src_unix_bsd_freebsdlike_freebsd_freebsd13_mod.rs index 3dda6014eeb2..5bf019e846eb 100644 --- a/lang/rust/files/riscv64/patch-vendor_libc-0.2.106_src_unix_bsd_freebsdlike_freebsd_freebsd13_mod.rs +++ b/lang/rust/files/riscv64/patch-vendor_libc-0.2.108_src_unix_bsd_freebsdlike_freebsd_freebsd13_mod.rs @@ -1,5 +1,5 @@ ---- vendor/libc-0.2.106/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs.orig 2021-11-29 20:27:33 UTC -+++ vendor/libc-0.2.106/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs +--- vendor/libc-0.2.108/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs.orig 2021-11-29 20:27:33 UTC ++++ vendor/libc-0.2.108/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs @@ -271,7 +271,8 @@ extern "C" { cfg_if! { diff --git a/lang/rust/files/riscv64/patch-vendor_libc-0.2.106_src_unix_bsd_freebsdlike_freebsd_mod.rs b/lang/rust/files/riscv64/patch-vendor_libc-0.2.108_src_unix_bsd_freebsdlike_freebsd_mod.rs index 371806f231de..affd8555921c 100644 --- a/lang/rust/files/riscv64/patch-vendor_libc-0.2.106_src_unix_bsd_freebsdlike_freebsd_mod.rs +++ b/lang/rust/files/riscv64/patch-vendor_libc-0.2.108_src_unix_bsd_freebsdlike_freebsd_mod.rs @@ -1,5 +1,5 @@ ---- vendor/libc-0.2.106/src/unix/bsd/freebsdlike/freebsd/mod.rs.orig 2021-11-29 20:27:33 UTC -+++ vendor/libc-0.2.106/src/unix/bsd/freebsdlike/freebsd/mod.rs +--- vendor/libc-0.2.108/src/unix/bsd/freebsdlike/freebsd/mod.rs.orig 2021-11-29 20:27:33 UTC ++++ vendor/libc-0.2.108/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -2021,6 +2021,9 @@ cfg_if! { } else if #[cfg(target_arch = "powerpc")] { mod powerpc; diff --git a/lang/rust/files/riscv64/patch-vendor_libc-0.2.106_src_unix_bsd_freebsdlike_freebsd_riscv64.rs b/lang/rust/files/riscv64/patch-vendor_libc-0.2.108_src_unix_bsd_freebsdlike_freebsd_riscv64.rs index 57f82315c60d..c395951cc851 100644 --- a/lang/rust/files/riscv64/patch-vendor_libc-0.2.106_src_unix_bsd_freebsdlike_freebsd_riscv64.rs +++ b/lang/rust/files/riscv64/patch-vendor_libc-0.2.108_src_unix_bsd_freebsdlike_freebsd_riscv64.rs @@ -1,5 +1,5 @@ ---- vendor/libc-0.2.106/src/unix/bsd/freebsdlike/freebsd/riscv64.rs.orig 2021-11-05 13:41:21 UTC -+++ vendor/libc-0.2.106/src/unix/bsd/freebsdlike/freebsd/riscv64.rs +--- vendor/libc-0.2.108/src/unix/bsd/freebsdlike/freebsd/riscv64.rs.orig 2021-11-05 13:41:21 UTC ++++ vendor/libc-0.2.108/src/unix/bsd/freebsdlike/freebsd/riscv64.rs @@ -0,0 +1,154 @@ +pub type c_char = u8; +pub type c_long = i64; diff --git a/lang/rust/files/riscv64/patch-vendor_libc-0.2.98_src_unix_bsd_freebsdlike_freebsd_freebsd11_mod.rs b/lang/rust/files/riscv64/patch-vendor_libc-0.2.98_src_unix_bsd_freebsdlike_freebsd_freebsd11_mod.rs deleted file mode 100644 index 04aef529ce69..000000000000 --- a/lang/rust/files/riscv64/patch-vendor_libc-0.2.98_src_unix_bsd_freebsdlike_freebsd_freebsd11_mod.rs +++ /dev/null @@ -1,12 +0,0 @@ ---- vendor/libc-0.2.98/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs.orig 2021-11-29 20:27:33 UTC -+++ vendor/libc-0.2.98/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs -@@ -217,7 +217,8 @@ extern "C" { - - cfg_if! { - if #[cfg(any(target_arch = "x86_64", -- target_arch = "aarch64"))] { -+ target_arch = "aarch64", -+ target_arch = "riscv64"))] { - mod b64; - pub use self::b64::*; - } diff --git a/lang/rust/files/riscv64/patch-vendor_libc-0.2.98_src_unix_bsd_freebsdlike_freebsd_freebsd12_mod.rs b/lang/rust/files/riscv64/patch-vendor_libc-0.2.98_src_unix_bsd_freebsdlike_freebsd_freebsd12_mod.rs deleted file mode 100644 index e9a428f19c59..000000000000 --- a/lang/rust/files/riscv64/patch-vendor_libc-0.2.98_src_unix_bsd_freebsdlike_freebsd_freebsd12_mod.rs +++ /dev/null @@ -1,12 +0,0 @@ ---- vendor/libc-0.2.98/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs.orig 2021-11-29 20:27:33 UTC -+++ vendor/libc-0.2.98/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs -@@ -235,7 +235,8 @@ extern "C" { - - cfg_if! { - if #[cfg(any(target_arch = "x86_64", -- target_arch = "aarch64"))] { -+ target_arch = "aarch64", -+ target_arch = "riscv64"))] { - mod b64; - pub use self::b64::*; - } diff --git a/lang/rust/files/riscv64/patch-vendor_libc-0.2.98_src_unix_bsd_freebsdlike_freebsd_freebsd13_mod.rs b/lang/rust/files/riscv64/patch-vendor_libc-0.2.98_src_unix_bsd_freebsdlike_freebsd_freebsd13_mod.rs deleted file mode 100644 index fbfa6662aabb..000000000000 --- a/lang/rust/files/riscv64/patch-vendor_libc-0.2.98_src_unix_bsd_freebsdlike_freebsd_freebsd13_mod.rs +++ /dev/null @@ -1,12 +0,0 @@ ---- vendor/libc-0.2.98/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs.orig 2021-11-29 20:27:33 UTC -+++ vendor/libc-0.2.98/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs -@@ -240,7 +240,8 @@ extern "C" { - - cfg_if! { - if #[cfg(any(target_arch = "x86_64", -- target_arch = "aarch64"))] { -+ target_arch = "aarch64", -+ target_arch = "riscv64"))] { - mod b64; - pub use self::b64::*; - } diff --git a/lang/rust/files/riscv64/patch-vendor_libc-0.2.98_src_unix_bsd_freebsdlike_freebsd_mod.rs b/lang/rust/files/riscv64/patch-vendor_libc-0.2.98_src_unix_bsd_freebsdlike_freebsd_mod.rs deleted file mode 100644 index 864d0669534c..000000000000 --- a/lang/rust/files/riscv64/patch-vendor_libc-0.2.98_src_unix_bsd_freebsdlike_freebsd_mod.rs +++ /dev/null @@ -1,12 +0,0 @@ ---- vendor/libc-0.2.98/src/unix/bsd/freebsdlike/freebsd/mod.rs.orig 2021-11-29 20:27:33 UTC -+++ vendor/libc-0.2.98/src/unix/bsd/freebsdlike/freebsd/mod.rs -@@ -1749,6 +1749,9 @@ cfg_if! { - } else if #[cfg(target_arch = "powerpc")] { - mod powerpc; - pub use self::powerpc::*; -+ } else if #[cfg(target_arch = "riscv64")] { -+ mod riscv64; -+ pub use self::riscv64::*; - } else { - // Unknown target_arch - } diff --git a/lang/rust/files/riscv64/patch-vendor_libc-0.2.98_src_unix_bsd_freebsdlike_freebsd_riscv64.rs b/lang/rust/files/riscv64/patch-vendor_libc-0.2.98_src_unix_bsd_freebsdlike_freebsd_riscv64.rs deleted file mode 100644 index d4fddf2844a2..000000000000 --- a/lang/rust/files/riscv64/patch-vendor_libc-0.2.98_src_unix_bsd_freebsdlike_freebsd_riscv64.rs +++ /dev/null @@ -1,157 +0,0 @@ ---- vendor/libc-0.2.98/src/unix/bsd/freebsdlike/freebsd/riscv64.rs.orig 2021-11-05 13:41:21 UTC -+++ vendor/libc-0.2.98/src/unix/bsd/freebsdlike/freebsd/riscv64.rs -@@ -0,0 +1,154 @@ -+pub type c_char = u8; -+pub type c_long = i64; -+pub type c_ulong = u64; -+pub type wchar_t = ::c_int; -+pub type time_t = i64; -+pub type suseconds_t = ::c_long; -+pub type register_t = i64; -+ -+// should be pub(crate), but that requires Rust 1.18.0 -+cfg_if! { -+ if #[cfg(libc_const_size_of)] { -+ #[doc(hidden)] -+ pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_longlong>() - 1; -+ } else { -+ #[doc(hidden)] -+ pub const _ALIGNBYTES: usize = 8 - 1; -+ } -+} -+ -+s_no_extra_traits! { -+ pub struct gpregs { -+ pub gp_ra: ::register_t, -+ pub gp_sp: ::register_t, -+ pub gp_gp: ::register_t, -+ pub gp_tp: ::register_t, -+ pub gp_t: [::register_t; 7], -+ pub gp_s: [::register_t; 12], -+ pub gp_a: [::register_t; 8], -+ pub gp_sepc: ::register_t, -+ pub gp_sstatus: ::register_t, -+ } -+ -+ pub struct fpregs { -+ pub fp_x: [[::register_t; 2]; 32], -+ pub fp_fcsr: ::register_t, -+ pub fp_flags: ::c_int, -+ pub fp_pad: ::c_int, -+ } -+ -+ pub struct mcontext_t { -+ pub mc_gpregs: gpregs, -+ pub mc_fpregs: fpregs, -+ pub mc_flags: ::c_int, -+ pub mc_pad: ::c_int, -+ pub mc_spare: [u64; 8], -+ } -+} -+ -+cfg_if! { -+ if #[cfg(feature = "extra_traits")] { -+ impl PartialEq for gpregs { -+ fn eq(&self, other: &gpregs) -> bool { -+ self.gp_ra == other.gp_ra && -+ self.gp_sp == other.gp_sp && -+ self.gp_gp == other.gp_gp && -+ self.gp_tp == other.gp_tp && -+ self.gp_t.iter().zip(other.gp_t.iter()).all(|(a, b)| a == b) && -+ self.gp_s.iter().zip(other.gp_s.iter()).all(|(a, b)| a == b) && -+ self.gp_a.iter().zip(other.gp_a.iter()).all(|(a, b)| a == b) && -+ self.gp_sepc == other.gp_sepc && -+ self.gp_sstatus == other.gp_sstatus -+ } -+ } -+ impl Eq for gpregs {} -+ impl ::fmt::Debug for gpregs { -+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { -+ f.debug_struct("gpregs") -+ .field("gp_ra", &self.gp_ra) -+ .field("gp_sp", &self.gp_sp) -+ .field("gp_gp", &self.gp_gp) -+ .field("gp_tp", &self.gp_tp) -+ .field("gp_t", &self.gp_t) -+ .field("gp_s", &self.gp_s) -+ .field("gp_a", &self.gp_a) -+ .field("gp_sepc", &self.gp_sepc) -+ .field("gp_sstatus", &self.gp_sstatus) -+ .finish() -+ } -+ } -+ impl ::hash::Hash for gpregs { -+ fn hash<H: ::hash::Hasher>(&self, state: &mut H) { -+ self.gp_ra.hash(state); -+ self.gp_sp.hash(state); -+ self.gp_gp.hash(state); -+ self.gp_tp.hash(state); -+ self.gp_t.hash(state); -+ self.gp_s.hash(state); -+ self.gp_a.hash(state); -+ self.gp_sepc.hash(state); -+ self.gp_sstatus.hash(state); -+ } -+ } -+ impl PartialEq for fpregs { -+ fn eq(&self, other: &fpregs) -> bool { -+ self.fp_x == other.fp_x && -+ self.fp_fcsr == other.fp_fcsr && -+ self.fp_flags == other.fp_flags && -+ self.fp_pad == other.fp_pad -+ } -+ } -+ impl Eq for fpregs {} -+ impl ::fmt::Debug for fpregs { -+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { -+ f.debug_struct("fpregs") -+ .field("fp_x", &self.fp_x) -+ .field("fp_fcsr", &self.fp_fcsr) -+ .field("fp_flags", &self.fp_flags) -+ .field("fp_pad", &self.fp_pad) -+ .finish() -+ } -+ } -+ impl ::hash::Hash for fpregs { -+ fn hash<H: ::hash::Hasher>(&self, state: &mut H) { -+ self.fp_x.hash(state); -+ self.fp_fcsr.hash(state); -+ self.fp_flags.hash(state); -+ self.fp_pad.hash(state); -+ } -+ } -+ impl PartialEq for mcontext_t { -+ fn eq(&self, other: &mcontext_t) -> bool { -+ self.mc_gpregs == other.mc_gpregs && -+ self.mc_fpregs == other.mc_fpregs && -+ self.mc_flags == other.mc_flags && -+ self.mc_pad == other.mc_pad && -+ self.mc_spare.iter().zip(other.mc_spare.iter()).all(|(a, b)| a == b) -+ } -+ } -+ impl Eq for mcontext_t {} -+ impl ::fmt::Debug for mcontext_t { -+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { -+ f.debug_struct("mcontext_t") -+ .field("mc_gpregs", &self.mc_gpregs) -+ .field("mc_fpregs", &self.mc_fpregs) -+ .field("mc_flags", &self.mc_flags) -+ .field("mc_pad", &self.mc_pad) -+ .field("mc_spare", &self.mc_spare) -+ .finish() -+ } -+ } -+ impl ::hash::Hash for mcontext_t { -+ fn hash<H: ::hash::Hasher>(&self, state: &mut H) { -+ self.mc_gpregs.hash(state); -+ self.mc_fpregs.hash(state); -+ self.mc_flags.hash(state); -+ self.mc_pad.hash(state); -+ self.mc_spare.hash(state); -+ } -+ } -+ } -+} -+ -+pub const MAP_32BIT: ::c_int = 0x00080000; -+pub const MINSIGSTKSZ: ::size_t = 4096; // 1024 * 4 diff --git a/lang/rust/files/riscv64/patch-vendor_libc_src_unix_bsd_freebsdlike_freebsd_freebsd11_mod.rs b/lang/rust/files/riscv64/patch-vendor_libc_src_unix_bsd_freebsdlike_freebsd_freebsd11_mod.rs deleted file mode 100644 index 017c18db6f9c..000000000000 --- a/lang/rust/files/riscv64/patch-vendor_libc_src_unix_bsd_freebsdlike_freebsd_freebsd11_mod.rs +++ /dev/null @@ -1,12 +0,0 @@ ---- vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs.orig 2021-11-29 20:27:33 UTC -+++ vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs -@@ -217,7 +217,8 @@ extern "C" { - - cfg_if! { - if #[cfg(any(target_arch = "x86_64", -- target_arch = "aarch64"))] { -+ target_arch = "aarch64", -+ target_arch = "riscv64"))] { - mod b64; - pub use self::b64::*; - } diff --git a/lang/rust/files/riscv64/patch-vendor_libc_src_unix_bsd_freebsdlike_freebsd_freebsd12_mod.rs b/lang/rust/files/riscv64/patch-vendor_libc_src_unix_bsd_freebsdlike_freebsd_freebsd12_mod.rs deleted file mode 100644 index 599ba3d18247..000000000000 --- a/lang/rust/files/riscv64/patch-vendor_libc_src_unix_bsd_freebsdlike_freebsd_freebsd12_mod.rs +++ /dev/null @@ -1,12 +0,0 @@ ---- vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs.orig 2021-11-29 20:27:33 UTC -+++ vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs -@@ -241,7 +241,8 @@ extern "C" { - - cfg_if! { - if #[cfg(any(target_arch = "x86_64", -- target_arch = "aarch64"))] { -+ target_arch = "aarch64", -+ target_arch = "riscv64"))] { - mod b64; - pub use self::b64::*; - } diff --git a/lang/rust/files/riscv64/patch-vendor_libc_src_unix_bsd_freebsdlike_freebsd_freebsd13_mod.rs b/lang/rust/files/riscv64/patch-vendor_libc_src_unix_bsd_freebsdlike_freebsd_freebsd13_mod.rs deleted file mode 100644 index 4098c94249cc..000000000000 --- a/lang/rust/files/riscv64/patch-vendor_libc_src_unix_bsd_freebsdlike_freebsd_freebsd13_mod.rs +++ /dev/null @@ -1,12 +0,0 @@ ---- vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs.orig 2021-11-29 20:27:33 UTC -+++ vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs -@@ -271,7 +271,8 @@ extern "C" { - - cfg_if! { - if #[cfg(any(target_arch = "x86_64", -- target_arch = "aarch64"))] { -+ target_arch = "aarch64", -+ target_arch = "riscv64"))] { - mod b64; - pub use self::b64::*; - } diff --git a/lang/rust/files/riscv64/patch-vendor_libc_src_unix_bsd_freebsdlike_freebsd_mod.rs b/lang/rust/files/riscv64/patch-vendor_libc_src_unix_bsd_freebsdlike_freebsd_mod.rs deleted file mode 100644 index a99c851e9422..000000000000 --- a/lang/rust/files/riscv64/patch-vendor_libc_src_unix_bsd_freebsdlike_freebsd_mod.rs +++ /dev/null @@ -1,12 +0,0 @@ ---- vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs.orig 2021-11-29 20:27:33 UTC -+++ vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs -@@ -2021,6 +2021,9 @@ cfg_if! { - } else if #[cfg(target_arch = "powerpc")] { - mod powerpc; - pub use self::powerpc::*; -+ } else if #[cfg(target_arch = "riscv64")] { -+ mod riscv64; -+ pub use self::riscv64::*; - } else { - // Unknown target_arch - } |