diff options
Diffstat (limited to 'lang/rust188/files')
12 files changed, 1012 insertions, 0 deletions
diff --git a/lang/rust188/files/armv7/patch-compiler_rustc__driver__impl_src_signal__handler.rs b/lang/rust188/files/armv7/patch-compiler_rustc__driver__impl_src_signal__handler.rs new file mode 100644 index 000000000000..07a775d26727 --- /dev/null +++ b/lang/rust188/files/armv7/patch-compiler_rustc__driver__impl_src_signal__handler.rs @@ -0,0 +1,28 @@ +error[E0308]: mismatched types + --> compiler/rustc_driver_impl/src/signal_handler.rs:43:63 + | +43 | let depth = libc::backtrace(STACK_TRACE.as_mut_ptr(), MAX_FRAMES as i32); + | --------------- ^^^^^^^^^^^^^^^^^ expected `usize`, found `i32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> /wrkdirs/usr/ports/lang/rust-bootstrap/work-armv7/rustc-1.78.0-src/vendor/libc/src/unix/bsd/freebsdlike/mod.rs:1861:12 + | +1861 | pub fn backtrace(addrlist: *mut *mut ::c_void, len: ::size_t) -> ::size_t; + | ^^^^^^^^^ +help: you can convert an `i32` to a `usize` and panic if the converted value doesn't fit + | +43 | let depth = libc::backtrace(STACK_TRACE.as_mut_ptr(), (MAX_FRAMES as i32).try_into().unwrap()); + +--- compiler/rustc_driver_impl/src/signal_handler.rs.orig 2024-05-06 16:00:17 UTC ++++ compiler/rustc_driver_impl/src/signal_handler.rs +@@ -46,7 +46,7 @@ unsafe extern "C" fn print_stack_trace(_: libc::c_int) + // in incredibly undesirable and unexpected ways due to e.g. the allocator deadlocking + static mut STACK_TRACE: [*mut libc::c_void; MAX_FRAMES] = [ptr::null_mut(); MAX_FRAMES]; + // Collect return addresses +- let depth = libc::backtrace(&raw mut STACK_TRACE as _, MAX_FRAMES as i32); ++ let depth = libc::backtrace(&raw mut STACK_TRACE as _, (MAX_FRAMES as i32).try_into().unwrap()); + if depth == 0 { + return; + } diff --git a/lang/rust188/files/armv7/patch-compiler_rustc__target_src_spec_base_freebsd.rs b/lang/rust188/files/armv7/patch-compiler_rustc__target_src_spec_base_freebsd.rs new file mode 100644 index 000000000000..6bbfec294be6 --- /dev/null +++ b/lang/rust188/files/armv7/patch-compiler_rustc__target_src_spec_base_freebsd.rs @@ -0,0 +1,11 @@ +--- compiler/rustc_target/src/spec/base/freebsd.rs.orig 2024-11-16 UTC ++++ compiler/rustc_target/src/spec/base/freebsd.rs +@@ -9,7 +9,7 @@ pub fn opts() -> TargetOptions { + crt_static_respected: true, + position_independent_executables: true, + relro_level: RelroLevel::Full, +- has_thread_local: true, ++ has_thread_local: false, + abi_return_struct_as_int: true, + default_dwarf_version: 2, + ..Default::default() diff --git a/lang/rust188/files/extra-patch-compiler_rustc__target_src_spec_targets_i686__unknown__freebsd.rs b/lang/rust188/files/extra-patch-compiler_rustc__target_src_spec_targets_i686__unknown__freebsd.rs new file mode 100644 index 000000000000..45d479133343 --- /dev/null +++ b/lang/rust188/files/extra-patch-compiler_rustc__target_src_spec_targets_i686__unknown__freebsd.rs @@ -0,0 +1,13 @@ +i386 should be pentiumpro (no SSE2, no ...) + +--- compiler/rustc_target/src/spec/targets/i686_unknown_freebsd.rs.orig 2023-12-22 11:18:00 UTC ++++ compiler/rustc_target/src/spec/targets/i686_unknown_freebsd.rs +@@ -2,7 +2,7 @@ pub fn target() -> Target { + + pub fn target() -> Target { + let mut base = base::freebsd::opts(); +- base.cpu = "pentium4".into(); ++ base.cpu = "pentiumpro".into(); + base.max_atomic_width = Some(64); + base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m32", "-Wl,-znotext"]); + base.stack_probes = StackProbeType::X86; diff --git a/lang/rust188/files/patch-compiler_rustc__target_src_callconv_powerpc64.rs b/lang/rust188/files/patch-compiler_rustc__target_src_callconv_powerpc64.rs new file mode 100644 index 000000000000..9a31c92a74a7 --- /dev/null +++ b/lang/rust188/files/patch-compiler_rustc__target_src_callconv_powerpc64.rs @@ -0,0 +1,11 @@ +--- compiler/rustc_target/src/callconv/powerpc64.rs.orig 2020-03-09 22:11:17 UTC ++++ compiler/rustc_target/src/callconv/powerpc64.rs +@@ -95,7 +95,7 @@ where + ELFv2 + } else { + match cx.data_layout().endian { +- Endian::Big => ELFv1, ++ Endian::Big => ELFv2, + Endian::Little => ELFv2, + } + }; diff --git a/lang/rust188/files/patch-library_backtrace_src_backtrace_mod.rs b/lang/rust188/files/patch-library_backtrace_src_backtrace_mod.rs new file mode 100644 index 000000000000..f4f618ac6bf1 --- /dev/null +++ b/lang/rust188/files/patch-library_backtrace_src_backtrace_mod.rs @@ -0,0 +1,10 @@ +--- library/backtrace/src/backtrace/mod.rs.orig 2021-11-29 19:27:28 UTC ++++ library/backtrace/src/backtrace/mod.rs +@@ -176,6 +176,7 @@ cfg_if::cfg_if! { + unix, + not(target_os = "emscripten"), + not(all(target_os = "ios", target_arch = "arm")), ++ not(all(target_os = "freebsd", target_arch = "riscv64")), + ), + all( + target_env = "sgx", diff --git a/lang/rust188/files/patch-src_bootstrap_src_core_build__steps_install.rs b/lang/rust188/files/patch-src_bootstrap_src_core_build__steps_install.rs new file mode 100644 index 000000000000..6d7f6d612496 --- /dev/null +++ b/lang/rust188/files/patch-src_bootstrap_src_core_build__steps_install.rs @@ -0,0 +1,17 @@ +Only install docs for the host target + +It otherwise wastes significant time (there are a lot of individual +files) and stages host docs, wasm docs, which unstages the host +docs first. + +--- src/bootstrap/src/core/build_steps/install.rs.orig 2022-05-01 20:28:31 UTC ++++ src/bootstrap/src/core/build_steps/install.rs +@@ -138,7 +138,7 @@ macro_rules! install { + } + + install!((self, builder, _config), +- Docs, path = "src/doc", _config.docs, only_hosts: false, { ++ Docs, path = "src/doc", _config.docs, only_hosts: true, { + let tarball = builder.ensure(dist::Docs { host: self.target }).expect("missing docs"); + install_sh(builder, "docs", self.compiler.stage, Some(self.target), &tarball); + }; diff --git a/lang/rust188/files/patch-src_tools_cargo_src_cargo_sources_git_source.rs b/lang/rust188/files/patch-src_tools_cargo_src_cargo_sources_git_source.rs new file mode 100644 index 000000000000..3add18d71b22 --- /dev/null +++ b/lang/rust188/files/patch-src_tools_cargo_src_cargo_sources_git_source.rs @@ -0,0 +1,36 @@ +We run cargo update during USES=cargo ports builds to update specific +crates and patch Cargo.lock for us. For normal crates this is based +on what's available in the vendor dir. For Git sources this pulls +new changes from the net instead even if we replace the source with +a static path in a patch section in the config file. Add a hack +to skip this. + +This is for experimentation to solve [1]. For this to maybe be +useful for USES=cargo, the patch-in-config feature also needs to +be stabilized first. It will be available in Rust 1.56. + +[1] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=256581 + +--- src/tools/cargo/src/cargo/sources/git/source.rs.orig 2021-10-04 20:59:57 UTC ++++ src/tools/cargo/src/cargo/sources/git/source.rs +@@ -205,6 +205,9 @@ impl<'cfg> Source for GitSource<'cfg> { + kind: QueryKind, + f: &mut dyn FnMut(IndexSummary), + ) -> Poll<CargoResult<()>> { ++ if std::env::var("CARGO_FREEBSD_PORTS_SKIP_GIT_UPDATE").is_ok() { ++ return Poll::Ready(Ok(())); ++ } + if let Some(src) = self.path_source.as_mut() { + src.query(dep, kind, f) + } else { +@@ -228,6 +231,10 @@ impl<'cfg> Source for GitSource<'cfg> { + if self.path_source.is_some() { + self.mark_used(None)?; + return Ok(()); ++ } ++ ++ if std::env::var("CARGO_FREEBSD_PORTS_SKIP_GIT_UPDATE").is_ok() { ++ return Ok(()); + } + + let git_fs = self.config.git_path(); diff --git a/lang/rust188/files/patch-vendor_cc.rs b/lang/rust188/files/patch-vendor_cc.rs new file mode 100644 index 000000000000..dbcbe5771fdd --- /dev/null +++ b/lang/rust188/files/patch-vendor_cc.rs @@ -0,0 +1,75 @@ +When the compiler has "clang" in its name the cc crate will pass +an LLVM target triple to it. Rust uses a triple that lacks the OS +version and LLVM will default to FreeBSD 9 behavior, i.e., it will +default to libstdc++ which is no longer available in newer releases. + +To avoid this issue assume we have a GNU compatible toolchain instead +until LLVM can be updated to use libc++ by default. + +https://reviews.llvm.org/D77776 + +--- vendor/cc-1.0.99/src/tool.rs.orig 2024-05-09 18:20:47 UTC ++++ vendor/cc-1.0.99/src/tool.rs +@@ -151,9 +151,7 @@ impl Tool { + + match (clang, accepts_cl_style_flags, gcc) { + (clang_cl, true, _) => Ok(ToolFamily::Msvc { clang_cl }), +- (true, false, _) => Ok(ToolFamily::Clang { +- zig_cc: is_zig_cc(path, cargo_output), +- }), ++ (true, false, _) => Ok(ToolFamily::Gnu), + (false, false, true) => Ok(ToolFamily::Gnu), + (false, false, false) => { + cargo_output.print_warning(&"Compiler family detection failed since it does not define `__clang__`, `__GNUC__` or `_MSC_VER`, fallback to treating it as GNU"); +--- vendor/cc-1.2.0/src/tool.rs.orig 2024-05-09 18:20:47 UTC ++++ vendor/cc-1.2.0/src/tool.rs +@@ -174,9 +174,7 @@ impl Tool { + + match (clang, accepts_cl_style_flags, gcc, emscripten, vxworks) { + (clang_cl, true, _, false, false) => Ok(ToolFamily::Msvc { clang_cl }), +- (true, _, _, _, false) | (_, _, _, true, false) => Ok(ToolFamily::Clang { +- zig_cc: is_zig_cc(path, cargo_output), +- }), ++ (true, _, _, _, false) | (_, _, _, true, false) => Ok(ToolFamily::Gnu), + (false, false, true, _, false) | (_, _, _, _, true) => Ok(ToolFamily::Gnu), + (false, false, false, false, false) => { + cargo_output.print_warning(&"Compiler family detection failed since it does not define `__clang__`, `__GNUC__`, `__EMSCRIPTEN__` or `__VXWORKS__`, also does not accept cl style flag `-?`, fallback to treating it as GNU"); +--- vendor/cc-1.2.16/src/tool.rs.orig 2024-05-09 18:20:47 UTC ++++ vendor/cc-1.2.16/src/tool.rs +@@ -174,9 +174,7 @@ impl Tool { + + match (clang, accepts_cl_style_flags, gcc, emscripten, vxworks) { + (clang_cl, true, _, false, false) => Ok(ToolFamily::Msvc { clang_cl }), +- (true, _, _, _, false) | (_, _, _, true, false) => Ok(ToolFamily::Clang { +- zig_cc: is_zig_cc(path, cargo_output), +- }), ++ (true, _, _, _, false) | (_, _, _, true, false) => Ok(ToolFamily::Gnu), + (false, false, true, _, false) | (_, _, _, _, true) => Ok(ToolFamily::Gnu), + (false, false, false, false, false) => { + cargo_output.print_warning(&"Compiler family detection failed since it does not define `__clang__`, `__GNUC__`, `__EMSCRIPTEN__` or `__VXWORKS__`, also does not accept cl style flag `-?`, fallback to treating it as GNU"); +--- vendor/cc-1.2.17/src/tool.rs.orig 2024-05-09 18:20:47 UTC ++++ vendor/cc-1.2.17/src/tool.rs +@@ -174,9 +174,7 @@ impl Tool { + + match (clang, accepts_cl_style_flags, gcc, emscripten, vxworks) { + (clang_cl, true, _, false, false) => Ok(ToolFamily::Msvc { clang_cl }), +- (true, _, _, _, false) | (_, _, _, true, false) => Ok(ToolFamily::Clang { +- zig_cc: is_zig_cc(path, cargo_output), +- }), ++ (true, _, _, _, false) | (_, _, _, true, false) => Ok(ToolFamily::Gnu), + (false, false, true, _, false) | (_, _, _, _, true) => Ok(ToolFamily::Gnu), + (false, false, false, false, false) => { + cargo_output.print_warning(&"Compiler family detection failed since it does not define `__clang__`, `__GNUC__`, `__EMSCRIPTEN__` or `__VXWORKS__`, also does not accept cl style flag `-?`, fallback to treating it as GNU"); +--- vendor/cc-1.2.21/src/tool.rs.orig 2024-05-09 18:20:47 UTC ++++ vendor/cc-1.2.21/src/tool.rs +@@ -174,9 +174,7 @@ impl Tool { + + match (clang, accepts_cl_style_flags, gcc, emscripten, vxworks) { + (clang_cl, true, _, false, false) => Ok(ToolFamily::Msvc { clang_cl }), +- (true, _, _, _, false) | (_, _, _, true, false) => Ok(ToolFamily::Clang { +- zig_cc: is_zig_cc(path, cargo_output), +- }), ++ (true, _, _, _, false) | (_, _, _, true, false) => Ok(ToolFamily::Gnu), + (false, false, true, _, false) | (_, _, _, _, true) => Ok(ToolFamily::Gnu), + (false, false, false, false, false) => { + cargo_output.print_warning(&"Compiler family detection failed since it does not define `__clang__`, `__GNUC__`, `__EMSCRIPTEN__` or `__VXWORKS__`, also does not accept cl style flag `-?`, fallback to treating it as GNU"); diff --git a/lang/rust188/files/patch-vendor_git2-0.19.0_src_lib.rs b/lang/rust188/files/patch-vendor_git2-0.19.0_src_lib.rs new file mode 100644 index 000000000000..1676f0c23188 --- /dev/null +++ b/lang/rust188/files/patch-vendor_git2-0.19.0_src_lib.rs @@ -0,0 +1,18 @@ +--- vendor/git2-0.20.0/src/lib.rs.orig 2025-02-21 20:02:44 UTC ++++ vendor/git2-0.20.0/src/lib.rs +@@ -759,6 +759,7 @@ fn init() { + unix, + not(target_os = "macos"), + not(target_os = "ios"), ++ not(target_os = "freebsd"), + feature = "https" + ))] + fn openssl_env_init() { +@@ -880,6 +881,7 @@ fn openssl_env_init() { + windows, + target_os = "macos", + target_os = "ios", ++ target_os = "freebsd", + not(feature = "https") + ))] + fn openssl_env_init() {} diff --git a/lang/rust188/files/patch-vendor_libc-0.2.155 b/lang/rust188/files/patch-vendor_libc-0.2.155 new file mode 100644 index 000000000000..69c2a03f7062 --- /dev/null +++ b/lang/rust188/files/patch-vendor_libc-0.2.155 @@ -0,0 +1,745 @@ +https://github.com/rust-lang/rust/issues/130677 + +From 9049542fabce9eea669d1fe3d4d973931c9d7d23 Mon Sep 17 00:00:00 2001 +From: Alan Somers <asomers@gmail.com> +Date: Mon, 23 Sep 2024 10:22:32 -0600 +Subject: [PATCH] Fix the definition of ino_t on 32-bit FreeBSD 12+ + +Commit 7437d0a6f1 erroneously defined it as "ulong" instead of u64. +Nobody noticed the mistake, probably because it was only tested on +64-bit architectures, where those are equivalent. But it's a problem +now, after #3723 , which switched the standard library to a FreeBSD 12 +ABI. + +Issue https://github.com/rust-lang/rust/issues/130677 +--- + src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs | 2 +- + src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs | 2 +- + src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs | 2 +- + src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs | 2 +- + src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs | 2 +- + 5 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs +index de34069eabdf2..68a8364194607 100644 +--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs ++++ vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs +@@ -4,7 +4,7 @@ + pub type nlink_t = u16; + // Type of `dev_t` changed from `u32` to `u64` in FreeBSD 12: + pub type dev_t = u32; +-// Type of `ino_t` changed from `unsigned int` to `unsigned long` in FreeBSD 12: ++// Type of `ino_t` changed from `__uint32_t` to `__uint64_t` in FreeBSD 12: + pub type ino_t = u32; + + s! { +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs +index 10fcaa03a4ef6..197400ffb4e28 100644 +--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs ++++ vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs +@@ -2,7 +2,7 @@ + + pub type nlink_t = u64; + pub type dev_t = u64; +-pub type ino_t = ::c_ulong; ++pub type ino_t = u64; + pub type shmatt_t = ::c_uint; + + s! { +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs +index ec6bce2a03091..d3a77d03c48d0 100644 +--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs ++++ vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs +@@ -2,7 +2,7 @@ + + pub type nlink_t = u64; + pub type dev_t = u64; +-pub type ino_t = ::c_ulong; ++pub type ino_t = u64; + pub type shmatt_t = ::c_uint; + pub type kpaddr_t = u64; + pub type kssize_t = i64; +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs +index 160a4baae481b..9d65317d29cb4 100644 +--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs ++++ vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs +@@ -2,7 +2,7 @@ + + pub type nlink_t = u64; + pub type dev_t = u64; +-pub type ino_t = ::c_ulong; ++pub type ino_t = u64; + pub type shmatt_t = ::c_uint; + pub type kpaddr_t = u64; + pub type kssize_t = i64; +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs +index d73215a68ec33..f76208400f324 100644 +--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs ++++ vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs +@@ -2,7 +2,7 @@ + + pub type nlink_t = u64; + pub type dev_t = u64; +-pub type ino_t = ::c_ulong; ++pub type ino_t = u64; + pub type shmatt_t = ::c_uint; + pub type kpaddr_t = u64; + pub type kssize_t = i64; + + +From 8aca9c0126f3aa5a7dce1ad7fc016b4a0d6af70a Mon Sep 17 00:00:00 2001 +From: Alan Somers <asomers@gmail.com> +Date: Mon, 23 Sep 2024 10:44:13 -0600 +Subject: [PATCH] Fix the definition of "struct stat" on 32-bit FreeBSD 12+ + +The original definitions were never correct. But nobody noticed because +we don't do CI on 32-bit FreeBSD. The problem is apparent now due to + #3723 , which caused the nightly toolchain to switch to a FreeBSD 12 +ABI. + +Fixes https://github.com/rust-lang/rust/issues/130677 +--- + .../{freebsd12/b64.rs => freebsd11/b32.rs} | 13 +++--- + .../bsd/freebsdlike/freebsd/freebsd11/mod.rs | 7 +-- + .../bsd/freebsdlike/freebsd/freebsd12/mod.rs | 43 +++++++++++++++---- + .../bsd/freebsdlike/freebsd/freebsd13/b64.rs | 34 --------------- + .../bsd/freebsdlike/freebsd/freebsd13/mod.rs | 43 +++++++++++++++---- + .../bsd/freebsdlike/freebsd/freebsd14/b64.rs | 34 --------------- + .../bsd/freebsdlike/freebsd/freebsd14/mod.rs | 43 +++++++++++++++---- + .../bsd/freebsdlike/freebsd/freebsd15/b64.rs | 34 --------------- + .../bsd/freebsdlike/freebsd/freebsd15/mod.rs | 43 +++++++++++++++---- + src/unix/bsd/freebsdlike/freebsd/x86.rs | 25 ----------- + 10 files changed, 146 insertions(+), 173 deletions(-) + rename src/unix/bsd/freebsdlike/freebsd/{freebsd12/b64.rs => freebsd11/b32.rs} (89%) + delete mode 100644 src/unix/bsd/freebsdlike/freebsd/freebsd13/b64.rs + delete mode 100644 src/unix/bsd/freebsdlike/freebsd/freebsd14/b64.rs + delete mode 100644 src/unix/bsd/freebsdlike/freebsd/freebsd15/b64.rs + +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd12/b64.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd11/b32.rs +similarity index 89% +rename from src/unix/bsd/freebsdlike/freebsd/freebsd12/b64.rs +rename to src/unix/bsd/freebsdlike/freebsd/freebsd11/b32.rs + +--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd11/b32.rs.orig 2024-10-24 17:21:07.154172000 +0200 ++++ vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd11/b32.rs 2024-10-24 17:21:02.029962000 +0200 +@@ -0,0 +1,34 @@ ++#[repr(C)] ++#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))] ++pub struct stat { ++ pub st_dev: ::dev_t, ++ pub st_ino: ::ino_t, ++ pub st_nlink: ::nlink_t, ++ pub st_mode: ::mode_t, ++ st_padding0: i16, ++ pub st_uid: ::uid_t, ++ pub st_gid: ::gid_t, ++ st_padding1: i32, ++ pub st_rdev: ::dev_t, ++ pub st_atime: ::time_t, ++ pub st_atime_nsec: ::c_long, ++ pub st_mtime: ::time_t, ++ pub st_mtime_nsec: ::c_long, ++ pub st_ctime: ::time_t, ++ pub st_ctime_nsec: ::c_long, ++ pub st_birthtime: ::time_t, ++ pub st_birthtime_nsec: ::c_long, ++ pub st_size: ::off_t, ++ pub st_blocks: ::blkcnt_t, ++ pub st_blksize: ::blksize_t, ++ pub st_flags: ::fflags_t, ++ pub st_gen: u64, ++ pub st_spare: [u64; 10], ++} ++ ++impl ::Copy for ::stat {} ++impl ::Clone for ::stat { ++ fn clone(&self) -> ::stat { ++ *self ++ } ++} + + +index 80c6fa1684530..5c1156581fd61 100644 +--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd12/b64.rs ++++ vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd11/b32.rs +@@ -3,12 +3,10 @@ + pub struct stat { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, +- pub st_nlink: ::nlink_t, + pub st_mode: ::mode_t, +- st_padding0: i16, ++ pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, +- st_padding1: i32, + pub st_rdev: ::dev_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, +@@ -16,14 +14,15 @@ pub struct stat { + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, +- pub st_birthtime: ::time_t, +- pub st_birthtime_nsec: ::c_long, + pub st_size: ::off_t, + pub st_blocks: ::blkcnt_t, + pub st_blksize: ::blksize_t, + pub st_flags: ::fflags_t, +- pub st_gen: u64, +- pub st_spare: [u64; 10], ++ pub st_gen: u32, ++ pub st_lspare: i32, ++ pub st_birthtime: ::time_t, ++ pub st_birthtime_nsec: ::c_long, ++ __unused: [u8; 8], + } + + impl ::Copy for ::stat {} +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs +index 68a8364194607..e416ebf745841 100644 +--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs ++++ vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs +@@ -479,10 +479,11 @@ extern "C" { + } + + cfg_if! { +- if #[cfg(any(target_arch = "x86_64", +- target_arch = "aarch64", +- target_arch = "riscv64"))] { ++ if #[cfg(target_pointer_width = "64")] { + mod b64; + pub use self::b64::*; ++ } else { ++ mod b32; ++ pub use self::b32::*; + } + } +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs +index 197400ffb4e28..c4431a6458e8f 100644 +--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs ++++ vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs +@@ -218,6 +218,40 @@ s! { + /// kthread flag. + pub ki_tdflags: ::c_long, + } ++ ++ pub struct stat { ++ pub st_dev: ::dev_t, ++ pub st_ino: ::ino_t, ++ pub st_nlink: ::nlink_t, ++ pub st_mode: ::mode_t, ++ st_padding0: i16, ++ pub st_uid: ::uid_t, ++ pub st_gid: ::gid_t, ++ st_padding1: i32, ++ pub st_rdev: ::dev_t, ++ #[cfg(target_arch = "x86")] ++ st_atim_ext: i32, ++ pub st_atime: ::time_t, ++ pub st_atime_nsec: ::c_long, ++ #[cfg(target_arch = "x86")] ++ st_mtim_ext: i32, ++ pub st_mtime: ::time_t, ++ pub st_mtime_nsec: ::c_long, ++ #[cfg(target_arch = "x86")] ++ st_ctim_ext: i32, ++ pub st_ctime: ::time_t, ++ pub st_ctime_nsec: ::c_long, ++ #[cfg(target_arch = "x86")] ++ st_btim_ext: i32, ++ pub st_birthtime: ::time_t, ++ pub st_birthtime_nsec: ::c_long, ++ pub st_size: ::off_t, ++ pub st_blocks: ::blkcnt_t, ++ pub st_blksize: ::blksize_t, ++ pub st_flags: ::fflags_t, ++ pub st_gen: u64, ++ pub st_spare: [u64; 10], ++ } + } + + s_no_extra_traits! { +@@ -488,15 +522,6 @@ extern "C" { + pub fn basename(path: *mut ::c_char) -> *mut ::c_char; + } + +-cfg_if! { +- if #[cfg(any(target_arch = "x86_64", +- target_arch = "aarch64", +- target_arch = "riscv64"))] { +- mod b64; +- pub use self::b64::*; +- } +-} +- + cfg_if! { + if #[cfg(target_arch = "x86_64")] { + mod x86_64; +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd13/b64.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd13/b64.rs +deleted file mode 100644 +index 80c6fa1684530..0000000000000 +--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd13/b64.rs ++++ /dev/null +@@ -1,34 +0,0 @@ +-#[repr(C)] +-#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))] +-pub struct stat { +- pub st_dev: ::dev_t, +- pub st_ino: ::ino_t, +- pub st_nlink: ::nlink_t, +- pub st_mode: ::mode_t, +- st_padding0: i16, +- pub st_uid: ::uid_t, +- pub st_gid: ::gid_t, +- st_padding1: i32, +- pub st_rdev: ::dev_t, +- pub st_atime: ::time_t, +- pub st_atime_nsec: ::c_long, +- pub st_mtime: ::time_t, +- pub st_mtime_nsec: ::c_long, +- pub st_ctime: ::time_t, +- pub st_ctime_nsec: ::c_long, +- pub st_birthtime: ::time_t, +- pub st_birthtime_nsec: ::c_long, +- pub st_size: ::off_t, +- pub st_blocks: ::blkcnt_t, +- pub st_blksize: ::blksize_t, +- pub st_flags: ::fflags_t, +- pub st_gen: u64, +- pub st_spare: [u64; 10], +-} +- +-impl ::Copy for ::stat {} +-impl ::Clone for ::stat { +- fn clone(&self) -> ::stat { +- *self +- } +-} +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs +index d3a77d03c48d0..118404e8b089b 100644 +--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs ++++ vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs +@@ -228,6 +228,40 @@ s! { + /// kthread flag. + pub ki_tdflags: ::c_long, + } ++ ++ pub struct stat { ++ pub st_dev: ::dev_t, ++ pub st_ino: ::ino_t, ++ pub st_nlink: ::nlink_t, ++ pub st_mode: ::mode_t, ++ st_padding0: i16, ++ pub st_uid: ::uid_t, ++ pub st_gid: ::gid_t, ++ st_padding1: i32, ++ pub st_rdev: ::dev_t, ++ #[cfg(target_arch = "x86")] ++ st_atim_ext: i32, ++ pub st_atime: ::time_t, ++ pub st_atime_nsec: ::c_long, ++ #[cfg(target_arch = "x86")] ++ st_mtim_ext: i32, ++ pub st_mtime: ::time_t, ++ pub st_mtime_nsec: ::c_long, ++ #[cfg(target_arch = "x86")] ++ st_ctim_ext: i32, ++ pub st_ctime: ::time_t, ++ pub st_ctime_nsec: ::c_long, ++ #[cfg(target_arch = "x86")] ++ st_btim_ext: i32, ++ pub st_birthtime: ::time_t, ++ pub st_birthtime_nsec: ::c_long, ++ pub st_size: ::off_t, ++ pub st_blocks: ::blkcnt_t, ++ pub st_blksize: ::blksize_t, ++ pub st_flags: ::fflags_t, ++ pub st_gen: u64, ++ pub st_spare: [u64; 10], ++ } + } + + s_no_extra_traits! { +@@ -529,15 +563,6 @@ extern "C" { + pub fn kvm_kerndisp(kd: *mut ::kvm_t) -> ::kssize_t; + } + +-cfg_if! { +- if #[cfg(any(target_arch = "x86_64", +- target_arch = "aarch64", +- target_arch = "riscv64"))] { +- mod b64; +- pub use self::b64::*; +- } +-} +- + cfg_if! { + if #[cfg(target_arch = "x86_64")] { + mod x86_64; +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd14/b64.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd14/b64.rs +deleted file mode 100644 +index 80c6fa1684530..0000000000000 +--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd14/b64.rs ++++ /dev/null +@@ -1,34 +0,0 @@ +-#[repr(C)] +-#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))] +-pub struct stat { +- pub st_dev: ::dev_t, +- pub st_ino: ::ino_t, +- pub st_nlink: ::nlink_t, +- pub st_mode: ::mode_t, +- st_padding0: i16, +- pub st_uid: ::uid_t, +- pub st_gid: ::gid_t, +- st_padding1: i32, +- pub st_rdev: ::dev_t, +- pub st_atime: ::time_t, +- pub st_atime_nsec: ::c_long, +- pub st_mtime: ::time_t, +- pub st_mtime_nsec: ::c_long, +- pub st_ctime: ::time_t, +- pub st_ctime_nsec: ::c_long, +- pub st_birthtime: ::time_t, +- pub st_birthtime_nsec: ::c_long, +- pub st_size: ::off_t, +- pub st_blocks: ::blkcnt_t, +- pub st_blksize: ::blksize_t, +- pub st_flags: ::fflags_t, +- pub st_gen: u64, +- pub st_spare: [u64; 10], +-} +- +-impl ::Copy for ::stat {} +-impl ::Clone for ::stat { +- fn clone(&self) -> ::stat { +- *self +- } +-} +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs +index 9d65317d29cb4..e624dd7201b0a 100644 +--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs ++++ vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs +@@ -228,6 +228,40 @@ s! { + /// kthread flag. + pub ki_tdflags: ::c_long, + } ++ ++ pub struct stat { ++ pub st_dev: ::dev_t, ++ pub st_ino: ::ino_t, ++ pub st_nlink: ::nlink_t, ++ pub st_mode: ::mode_t, ++ st_padding0: i16, ++ pub st_uid: ::uid_t, ++ pub st_gid: ::gid_t, ++ st_padding1: i32, ++ pub st_rdev: ::dev_t, ++ #[cfg(target_arch = "x86")] ++ st_atim_ext: i32, ++ pub st_atime: ::time_t, ++ pub st_atime_nsec: ::c_long, ++ #[cfg(target_arch = "x86")] ++ st_mtim_ext: i32, ++ pub st_mtime: ::time_t, ++ pub st_mtime_nsec: ::c_long, ++ #[cfg(target_arch = "x86")] ++ st_ctim_ext: i32, ++ pub st_ctime: ::time_t, ++ pub st_ctime_nsec: ::c_long, ++ #[cfg(target_arch = "x86")] ++ st_btim_ext: i32, ++ pub st_birthtime: ::time_t, ++ pub st_birthtime_nsec: ::c_long, ++ pub st_size: ::off_t, ++ pub st_blocks: ::blkcnt_t, ++ pub st_blksize: ::blksize_t, ++ pub st_flags: ::fflags_t, ++ pub st_gen: u64, ++ pub st_spare: [u64; 10], ++ } + } + + s_no_extra_traits! { +@@ -529,15 +563,6 @@ extern "C" { + pub fn kvm_kerndisp(kd: *mut ::kvm_t) -> ::kssize_t; + } + +-cfg_if! { +- if #[cfg(any(target_arch = "x86_64", +- target_arch = "aarch64", +- target_arch = "riscv64"))] { +- mod b64; +- pub use self::b64::*; +- } +-} +- + cfg_if! { + if #[cfg(target_arch = "x86_64")] { + mod x86_64; +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd15/b64.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd15/b64.rs +deleted file mode 100644 +index 80c6fa1684530..0000000000000 +--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd15/b64.rs ++++ /dev/null +@@ -1,34 +0,0 @@ +-#[repr(C)] +-#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))] +-pub struct stat { +- pub st_dev: ::dev_t, +- pub st_ino: ::ino_t, +- pub st_nlink: ::nlink_t, +- pub st_mode: ::mode_t, +- st_padding0: i16, +- pub st_uid: ::uid_t, +- pub st_gid: ::gid_t, +- st_padding1: i32, +- pub st_rdev: ::dev_t, +- pub st_atime: ::time_t, +- pub st_atime_nsec: ::c_long, +- pub st_mtime: ::time_t, +- pub st_mtime_nsec: ::c_long, +- pub st_ctime: ::time_t, +- pub st_ctime_nsec: ::c_long, +- pub st_birthtime: ::time_t, +- pub st_birthtime_nsec: ::c_long, +- pub st_size: ::off_t, +- pub st_blocks: ::blkcnt_t, +- pub st_blksize: ::blksize_t, +- pub st_flags: ::fflags_t, +- pub st_gen: u64, +- pub st_spare: [u64; 10], +-} +- +-impl ::Copy for ::stat {} +-impl ::Clone for ::stat { +- fn clone(&self) -> ::stat { +- *self +- } +-} +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs +index f76208400f324..a299af7d5d53e 100644 +--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs ++++ vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs +@@ -228,6 +228,40 @@ s! { + /// kthread flag. + pub ki_tdflags: ::c_long, + } ++ ++ pub struct stat { ++ pub st_dev: ::dev_t, ++ pub st_ino: ::ino_t, ++ pub st_nlink: ::nlink_t, ++ pub st_mode: ::mode_t, ++ st_padding0: i16, ++ pub st_uid: ::uid_t, ++ pub st_gid: ::gid_t, ++ st_padding1: i32, ++ pub st_rdev: ::dev_t, ++ #[cfg(target_arch = "x86")] ++ st_atim_ext: i32, ++ pub st_atime: ::time_t, ++ pub st_atime_nsec: ::c_long, ++ #[cfg(target_arch = "x86")] ++ st_mtim_ext: i32, ++ pub st_mtime: ::time_t, ++ pub st_mtime_nsec: ::c_long, ++ #[cfg(target_arch = "x86")] ++ st_ctim_ext: i32, ++ pub st_ctime: ::time_t, ++ pub st_ctime_nsec: ::c_long, ++ #[cfg(target_arch = "x86")] ++ st_btim_ext: i32, ++ pub st_birthtime: ::time_t, ++ pub st_birthtime_nsec: ::c_long, ++ pub st_size: ::off_t, ++ pub st_blocks: ::blkcnt_t, ++ pub st_blksize: ::blksize_t, ++ pub st_flags: ::fflags_t, ++ pub st_gen: u64, ++ pub st_spare: [u64; 10], ++ } + } + + s_no_extra_traits! { +@@ -529,15 +563,6 @@ extern "C" { + pub fn kvm_kerndisp(kd: *mut ::kvm_t) -> ::kssize_t; + } + +-cfg_if! { +- if #[cfg(any(target_arch = "x86_64", +- target_arch = "aarch64", +- target_arch = "riscv64"))] { +- mod b64; +- pub use self::b64::*; +- } +-} +- + cfg_if! { + if #[cfg(target_arch = "x86_64")] { + mod x86_64; +diff --git a/src/unix/bsd/freebsdlike/freebsd/x86.rs b/src/unix/bsd/freebsdlike/freebsd/x86.rs +index c3c576ed66681..31a660e7d0a22 100644 +--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/x86.rs ++++ vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/x86.rs +@@ -42,31 +42,6 @@ s_no_extra_traits! { + } + + s! { +- pub struct stat { +- pub st_dev: ::dev_t, +- pub st_ino: ::ino_t, +- pub st_mode: ::mode_t, +- pub st_nlink: ::nlink_t, +- pub st_uid: ::uid_t, +- pub st_gid: ::gid_t, +- pub st_rdev: ::dev_t, +- pub st_atime: ::time_t, +- pub st_atime_nsec: ::c_long, +- pub st_mtime: ::time_t, +- pub st_mtime_nsec: ::c_long, +- pub st_ctime: ::time_t, +- pub st_ctime_nsec: ::c_long, +- pub st_size: ::off_t, +- pub st_blocks: ::blkcnt_t, +- pub st_blksize: ::blksize_t, +- pub st_flags: ::fflags_t, +- pub st_gen: u32, +- pub st_lspare: i32, +- pub st_birthtime: ::time_t, +- pub st_birthtime_nsec: ::c_long, +- __unused: [u8; 8], +- } +- + pub struct ucontext_t { + pub uc_sigmask: ::sigset_t, + pub uc_mcontext: ::mcontext_t, + + +From f381e010b2439579c9f548ef86fb06409c2c55d2 Mon Sep 17 00:00:00 2001 +From: Alan Somers <asomers@gmail.com> +Date: Mon, 23 Sep 2024 16:03:48 -0600 +Subject: [PATCH] fixup: fix build on powerpc, powerpc64, and arm + +--- + src/unix/bsd/freebsdlike/freebsd/arm.rs | 30 ------------------- + src/unix/bsd/freebsdlike/freebsd/powerpc.rs | 26 ---------------- + src/unix/bsd/freebsdlike/freebsd/powerpc64.rs | 26 ---------------- + 3 files changed, 82 deletions(-) + +diff --git a/src/unix/bsd/freebsdlike/freebsd/arm.rs b/src/unix/bsd/freebsdlike/freebsd/arm.rs +index 300b3dd45ca9d..8ff500c65981c 100644 +--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/arm.rs ++++ vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/arm.rs +@@ -6,36 +6,6 @@ pub type time_t = i64; + pub type suseconds_t = i32; + pub type register_t = i32; + +-s! { +- pub struct stat { +- pub st_dev: ::dev_t, +- pub st_ino: ::ino_t, +- pub st_mode: ::mode_t, +- pub st_nlink: ::nlink_t, +- pub st_uid: ::uid_t, +- pub st_gid: ::gid_t, +- pub st_rdev: ::dev_t, +- pub st_atime: ::time_t, +- pub st_atime_nsec: ::c_long, +- pub st_atime_pad: ::c_long, +- pub st_mtime: ::time_t, +- pub st_mtime_nsec: ::c_long, +- pub st_mtime_pad: ::c_long, +- pub st_ctime: ::time_t, +- pub st_ctime_nsec: ::c_long, +- pub st_ctime_pad: ::c_long, +- pub st_size: ::off_t, +- pub st_blocks: ::blkcnt_t, +- pub st_blksize: ::blksize_t, +- pub st_flags: ::fflags_t, +- pub st_gen: u32, +- pub st_lspare: i32, +- pub st_birthtime: ::time_t, +- pub st_birthtime_nsec: ::c_long, +- pub st_birthtime_pad: ::c_long, +- } +-} +- + // should be pub(crate), but that requires Rust 1.18.0 + cfg_if! { + if #[cfg(libc_const_size_of)] { +diff --git a/src/unix/bsd/freebsdlike/freebsd/powerpc.rs b/src/unix/bsd/freebsdlike/freebsd/powerpc.rs +index a0120c337e0ad..f84062ba34b93 100644 +--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/powerpc.rs ++++ vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/powerpc.rs +@@ -6,32 +6,6 @@ pub type time_t = i64; + pub type suseconds_t = i32; + pub type register_t = i32; + +-s! { +- pub struct stat { +- pub st_dev: ::dev_t, +- pub st_ino: ::ino_t, +- pub st_mode: ::mode_t, +- pub st_nlink: ::nlink_t, +- pub st_uid: ::uid_t, +- pub st_gid: ::gid_t, +- pub st_rdev: ::dev_t, +- pub st_atime: ::time_t, +- pub st_atime_nsec: ::c_long, +- pub st_mtime: ::time_t, +- pub st_mtime_nsec: ::c_long, +- pub st_ctime: ::time_t, +- pub st_ctime_nsec: ::c_long, +- pub st_size: ::off_t, +- pub st_blocks: ::blkcnt_t, +- pub st_blksize: ::blksize_t, +- pub st_flags: ::fflags_t, +- pub st_gen: u32, +- pub st_lspare: i32, +- pub st_birthtime: ::time_t, +- pub st_birthtime_nsec: ::c_long, +- } +-} +- + // should be pub(crate), but that requires Rust 1.18.0 + cfg_if! { + if #[cfg(libc_const_size_of)] { +diff --git a/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs b/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs +index 7f5b9752264e3..69cf4c5fc88c7 100644 +--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs ++++ vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs +@@ -6,32 +6,6 @@ pub type time_t = i64; + pub type suseconds_t = i64; + pub type register_t = i64; + +-s! { +- pub struct stat { +- pub st_dev: ::dev_t, +- pub st_ino: ::ino_t, +- pub st_mode: ::mode_t, +- pub st_nlink: ::nlink_t, +- pub st_uid: ::uid_t, +- pub st_gid: ::gid_t, +- pub st_rdev: ::dev_t, +- pub st_atime: ::time_t, +- pub st_atime_nsec: ::c_long, +- pub st_mtime: ::time_t, +- pub st_mtime_nsec: ::c_long, +- pub st_ctime: ::time_t, +- pub st_ctime_nsec: ::c_long, +- pub st_size: ::off_t, +- pub st_blocks: ::blkcnt_t, +- pub st_blksize: ::blksize_t, +- pub st_flags: ::fflags_t, +- pub st_gen: u32, +- pub st_lspare: i32, +- pub st_birthtime: ::time_t, +- pub st_birthtime_nsec: ::c_long, +- } +-} +- + // should be pub(crate), but that requires Rust 1.18.0 + cfg_if! { + if #[cfg(libc_const_size_of)] { diff --git a/lang/rust188/files/patch-vendor_openssl_crypto_threads__pthread.c b/lang/rust188/files/patch-vendor_openssl_crypto_threads__pthread.c new file mode 100644 index 000000000000..87c398a91538 --- /dev/null +++ b/lang/rust188/files/patch-vendor_openssl_crypto_threads__pthread.c @@ -0,0 +1,27 @@ +/usr/ports/security/openssl34/files/patch-crypto_threads__pthread.c ++ fix dup IMPL_fallback_atomic_exchange_n (this code was removed in +https://github.com/openssl/openssl/commit/65787e2dc219685c30539c6f60eb6b64b890bf6f) + +--- vendor/openssl-src-300.4.2+3.4.1/openssl/crypto/threads_pthread.c.orig 2025-05-09 22:37:37.000000000 +0200 ++++ vendor/openssl-src-300.4.2+3.4.1/openssl/crypto/threads_pthread.c 2025-05-21 14:44:18.563852000 +0200 +@@ -50,6 +50,10 @@ __tsan_mutex_post_lock((x), 0, 0) + # define BROKEN_CLANG_ATOMICS + #endif + ++#if defined(__FreeBSD__) && (defined(__i386__) || (defined(__powerpc__) && defined(__ILP32__))) ++#define BROKEN_CLANG_ATOMICS ++#endif ++ + #if defined(OPENSSL_THREADS) && !defined(CRYPTO_TDEBUG) && !defined(OPENSSL_SYS_WINDOWS) + + # if defined(OPENSSL_SYS_UNIX) +@@ -210,8 +214,7 @@ IMPL_fallback_atomic_exchange_n(prcu_cb_item) + pthread_mutex_unlock(&atomic_sim_lock); \ + return ret; \ + } +- +-IMPL_fallback_atomic_exchange_n(uint64_t) ++IMPL_fallback_atomic_compare_exchange_n(uint64_t) + + # define ATOMIC_COMPARE_EXCHANGE_N(t, p, e, d, s, f) fallback_atomic_compare_exchange_n_##t(p, e, d, s, f) + diff --git a/lang/rust188/files/riscv64/patch-vendor_rustc__ap__rustc__target_src_spec_riscv64gc__unknown__freebsd.rs b/lang/rust188/files/riscv64/patch-vendor_rustc__ap__rustc__target_src_spec_riscv64gc__unknown__freebsd.rs new file mode 100644 index 000000000000..5faf5e2aacf8 --- /dev/null +++ b/lang/rust188/files/riscv64/patch-vendor_rustc__ap__rustc__target_src_spec_riscv64gc__unknown__freebsd.rs @@ -0,0 +1,21 @@ +--- vendor/rustc-ap-rustc_target/src/spec/riscv64gc_unknown_freebsd.rs.orig 2021-11-04 11:22:10 UTC ++++ vendor/rustc-ap-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() ++ }, ++ } ++} |