diff options
Diffstat (limited to 'lang/rust/files')
5 files changed, 67 insertions, 109 deletions
diff --git a/lang/rust/files/patch-src_bootstrap_src_core_build__steps_install.rs b/lang/rust/files/patch-src_bootstrap_src_core_build__steps_install.rs index 6d7f6d612496..5cfec3ce509c 100644 --- a/lang/rust/files/patch-src_bootstrap_src_core_build__steps_install.rs +++ b/lang/rust/files/patch-src_bootstrap_src_core_build__steps_install.rs @@ -6,12 +6,12 @@ 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 { +@@ -204,7 +204,7 @@ install!((self, builder, _config), } install!((self, builder, _config), -- Docs, path = "src/doc", _config.docs, only_hosts: false, { -+ Docs, path = "src/doc", _config.docs, only_hosts: true, { +- Docs, path = "src/doc", _config.docs, IS_HOST: false, { ++ Docs, path = "src/doc", _config.docs, IS_HOST: true, { let tarball = builder.ensure(dist::Docs { host: self.target }).expect("missing docs"); - install_sh(builder, "docs", self.compiler.stage, Some(self.target), &tarball); + install_sh(builder, "docs", self.build_compiler, Some(self.target), &tarball); }; diff --git a/lang/rust/files/patch-vendor_cc.rs b/lang/rust/files/patch-vendor_cc.rs deleted file mode 100644 index dbcbe5771fdd..000000000000 --- a/lang/rust/files/patch-vendor_cc.rs +++ /dev/null @@ -1,75 +0,0 @@ -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/rust/files/patch-vendor_git2-0.19.0_src_lib.rs b/lang/rust/files/patch-vendor_git2-0.19.0_src_lib.rs deleted file mode 100644 index 1676f0c23188..000000000000 --- a/lang/rust/files/patch-vendor_git2-0.19.0_src_lib.rs +++ /dev/null @@ -1,18 +0,0 @@ ---- 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/rust/files/patch-vendor_openssl-probe_src_lib.rs b/lang/rust/files/patch-vendor_openssl-probe_src_lib.rs new file mode 100644 index 000000000000..064018790d0f --- /dev/null +++ b/lang/rust/files/patch-vendor_openssl-probe_src_lib.rs @@ -0,0 +1,50 @@ +--- vendor/openssl-probe-0.1.6/src/lib.rs ++++ vendor/openssl-probe-0.1.6/src/lib.rs +@@ -26,6 +26,7 @@ pub fn find_certs_dirs() -> Vec<PathBuf> { + /// found. + /// + /// This will only search known system locations. ++#[cfg(not(target_os = "freebsd"))] + pub fn candidate_cert_dirs() -> impl Iterator<Item = &'static Path> { + // see http://gagravarr.org/writing/openssl-certs/others.shtml + [ +@@ -52,6 +53,19 @@ pub fn candidate_cert_dirs() -> impl Iterator<Item = &'static Path> { + .map(Path::new) + .filter(|p| p.exists()) + } ++#[cfg(target_os = "freebsd")] ++pub fn candidate_cert_dirs() -> impl Iterator<Item = &'static Path> { ++ // see manpage of certctl(8): https://man.freebsd.org/cgi/man.cgi?query=certctl&sektion=8 ++ // see security/openssl* ports ++ [ ++ "/etc/ssl", ++ "/usr/local/etc/ssl", ++ "/usr/local/openssl", ++ ] ++ .iter() ++ .map(Path::new) ++ .filter(|p| p.exists()) ++} + + /// Deprecated as this isn't sound, use [`init_openssl_env_vars`] instead. + #[doc(hidden)] +@@ -169,6 +183,7 @@ pub fn probe() -> ProbeResult { + for certs_dir in candidate_cert_dirs() { + // cert.pem looks to be an openssl 1.0.1 thing, while + // certs/ca-certificates.crt appears to be a 0.9.8 thing ++ #[cfg(not(target_os = "freebsd"))] + let cert_filenames = [ + "cert.pem", + "certs.pem", +@@ -181,6 +196,11 @@ pub fn probe() -> ProbeResult { + "CARootCertificates.pem", + "tls-ca-bundle.pem", + ]; ++ #[cfg(target_os = "freebsd")] ++ let cert_filenames = [ ++ "cert.pem", ++ "ca-root-nss.crt", ++ ]; + if result.cert_file.is_none() { + result.cert_file = cert_filenames + .iter() diff --git a/lang/rust/files/patch-vendor_openssl_crypto_threads__pthread.c b/lang/rust/files/patch-vendor_openssl_crypto_threads__pthread.c index 87c398a91538..e8ade04d557a 100644 --- a/lang/rust/files/patch-vendor_openssl_crypto_threads__pthread.c +++ b/lang/rust/files/patch-vendor_openssl_crypto_threads__pthread.c @@ -1,9 +1,7 @@ /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 +--- vendor/openssl-src-300.5.0+3.5.0/openssl/crypto/threads_pthread.c.orig 2025-05-09 22:37:37.000000000 +0200 ++++ vendor/openssl-src-300.5.0+3.5.0/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 @@ -15,13 +13,16 @@ https://github.com/openssl/openssl/commit/65787e2dc219685c30539c6f60eb6b64b890bf #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) +--- vendor/openssl-src-300.5.2+3.5.2/openssl/crypto/threads_pthread.c.orig 2025-05-09 22:37:37.000000000 +0200 ++++ vendor/openssl-src-300.5.2+3.5.2/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 - # define ATOMIC_COMPARE_EXCHANGE_N(t, p, e, d, s, f) fallback_atomic_compare_exchange_n_##t(p, e, d, s, f) ++#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) |
