diff options
author | Mikael Urankar <mikael@FreeBSD.org> | 2024-06-11 12:39:22 +0200 |
---|---|---|
committer | Mikael Urankar <mikael@FreeBSD.org> | 2024-06-18 12:59:01 +0200 |
commit | f709c74213f92898a7dd4387fab413fd294a0cc7 (patch) | |
tree | 7db6e37bb7810cbb41b039c0c87458a49e79d929 /lang/rust/files | |
parent | textproc/sonic: Update to 1.4.9 (diff) |
lang/rust: Update to 1.79.0
Announce: https://blog.rust-lang.org/2024/06/13/Rust-1.79.0.html
ChangeLog: https://github.com/rust-lang/rust/releases/tag/1.79.0
PR: 279707
Tested by: pkubaj,mikael
Diffstat (limited to 'lang/rust/files')
5 files changed, 129 insertions, 62 deletions
diff --git a/lang/rust/files/armv7/patch-vendor_rustix_src_backend_libc_fs_syscalls.rs b/lang/rust/files/armv7/patch-vendor_rustix_src_backend_libc_fs_syscalls.rs deleted file mode 100644 index 423655a62676..000000000000 --- a/lang/rust/files/armv7/patch-vendor_rustix_src_backend_libc_fs_syscalls.rs +++ /dev/null @@ -1,24 +0,0 @@ -gnueabihf was changed to gnu in this commit and it breaks rustix -https://github.com/rust-lang/rust/commit/93ec0e6299e31e6857e8ad741750034f35762b11 - - ---- vendor/rustix/src/backend/libc/fs/syscalls.rs.orig 2024-05-06 16:29:17.182875000 +0200 -+++ vendor/rustix/src/backend/libc/fs/syscalls.rs 2024-05-06 16:29:48.897744000 +0200 -@@ -140,7 +140,7 @@ pub(crate) fn open(path: &CStr, oflags: OFlags, mode: - pub(crate) fn open(path: &CStr, oflags: OFlags, mode: Mode) -> io::Result<OwnedFd> { - // Work around <https://sourceware.org/bugzilla/show_bug.cgi?id=17523>. - // glibc versions before 2.25 don't handle `O_TMPFILE` correctly. -- #[cfg(all(unix, target_env = "gnu", not(target_os = "hurd")))] -+ #[cfg(all(unix, target_env = "gnu", not(any(target_os = "freebsd", target_os = "hurd"))))] - if oflags.contains(OFlags::TMPFILE) && crate::backend::if_glibc_is_less_than_2_25() { - return open_via_syscall(path, oflags, mode); - } -@@ -203,7 +203,7 @@ pub(crate) fn openat( - ) -> io::Result<OwnedFd> { - // Work around <https://sourceware.org/bugzilla/show_bug.cgi?id=17523>. - // glibc versions before 2.25 don't handle `O_TMPFILE` correctly. -- #[cfg(all(unix, target_env = "gnu", not(target_os = "hurd")))] -+ #[cfg(all(unix, target_env = "gnu", not(any(target_os = "freebsd", target_os = "hurd"))))] - if oflags.contains(OFlags::TMPFILE) && crate::backend::if_glibc_is_less_than_2_25() { - return openat_via_syscall(dirfd, path, oflags, mode); - } diff --git a/lang/rust/files/patch-vendor_cc.rs b/lang/rust/files/patch-vendor_cc.rs new file mode 100644 index 000000000000..5b6888c4c087 --- /dev/null +++ b/lang/rust/files/patch-vendor_cc.rs @@ -0,0 +1,107 @@ +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.73/src/lib.rs.orig 2021-03-04 20:58:54 UTC ++++ vendor/cc-1.0.73/src/lib.rs +@@ -2659,24 +2659,7 @@ impl Tool { + } + + fn with_features(path: PathBuf, clang_driver: Option<&str>, cuda: bool) -> Self { +- // Try to detect family of the tool from its name, falling back to Gnu. +- let family = if let Some(fname) = path.file_name().and_then(|p| p.to_str()) { +- if fname.contains("clang-cl") { +- ToolFamily::Msvc { clang_cl: true } +- } else if fname.ends_with("cl") || fname == "cl.exe" { +- ToolFamily::Msvc { clang_cl: false } +- } else if fname.contains("clang") { +- match clang_driver { +- Some("cl") => ToolFamily::Msvc { clang_cl: true }, +- _ => ToolFamily::Clang, +- } +- } else { +- ToolFamily::Gnu +- } +- } else { +- ToolFamily::Gnu +- }; +- ++ let family = ToolFamily::Gnu; + Tool { + path: path, + cc_wrapper_path: None, + +--- vendor/cc-1.0.79/src/lib.rs.orig 2021-03-04 20:58:54 UTC ++++ vendor/cc-1.0.79/src/lib.rs +@@ -2659,24 +2659,7 @@ impl Tool { + } + + fn with_features(path: PathBuf, clang_driver: Option<&str>, cuda: bool) -> Self { +- // Try to detect family of the tool from its name, falling back to Gnu. +- let family = if let Some(fname) = path.file_name().and_then(|p| p.to_str()) { +- if fname.contains("clang-cl") { +- ToolFamily::Msvc { clang_cl: true } +- } else if fname.ends_with("cl") || fname == "cl.exe" { +- ToolFamily::Msvc { clang_cl: false } +- } else if fname.contains("clang") { +- match clang_driver { +- Some("cl") => ToolFamily::Msvc { clang_cl: true }, +- _ => ToolFamily::Clang, +- } +- } else { +- ToolFamily::Gnu +- } +- } else { +- ToolFamily::Gnu +- }; +- ++ let family = ToolFamily::Gnu; + Tool { + path: path, + cc_wrapper_path: None, + +--- vendor/cc-1.0.90/src/tool.rs.orig 2024-03-18 11:23:17 UTC ++++ vendor/cc-1.0.90/src/tool.rs +@@ -122,22 +122,7 @@ impl Tool { + }; + + // Try to detect family of the tool from its name, falling back to Gnu. +- let family = if let Some(fname) = path.file_name().and_then(|p| p.to_str()) { +- if fname.contains("clang-cl") { +- ToolFamily::Msvc { clang_cl: true } +- } else if fname.ends_with("cl") || fname == "cl.exe" { +- ToolFamily::Msvc { clang_cl: false } +- } else if fname.contains("clang") { +- match clang_driver { +- Some("cl") => ToolFamily::Msvc { clang_cl: true }, +- _ => ToolFamily::Clang, +- } +- } else { +- detect_family(&path) +- } +- } else { +- detect_family(&path) +- }; ++ let family = ToolFamily::Gnu; + + Tool { + path, +--- vendor/cc-1.0.92/src/tool.rs.orig 2024-05-09 18:20:47 UTC ++++ vendor/cc-1.0.92/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"); diff --git a/lang/rust/files/patch-vendor_cc_src_tool.rs b/lang/rust/files/patch-vendor_cc_src_tool.rs deleted file mode 100644 index 42c63f436594..000000000000 --- a/lang/rust/files/patch-vendor_cc_src_tool.rs +++ /dev/null @@ -1,36 +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/src/tool.rs.orig 2024-03-18 11:23:17 UTC -+++ vendor/cc/src/tool.rs -@@ -122,22 +122,7 @@ impl Tool { - }; - - // Try to detect family of the tool from its name, falling back to Gnu. -- let family = if let Some(fname) = path.file_name().and_then(|p| p.to_str()) { -- if fname.contains("clang-cl") { -- ToolFamily::Msvc { clang_cl: true } -- } else if fname.ends_with("cl") || fname == "cl.exe" { -- ToolFamily::Msvc { clang_cl: false } -- } else if fname.contains("clang") { -- match clang_driver { -- Some("cl") => ToolFamily::Msvc { clang_cl: true }, -- _ => ToolFamily::Clang, -- } -- } else { -- detect_family(&path) -- } -- } else { -- detect_family(&path) -- }; -+ let family = ToolFamily::Gnu; - - Tool { - path, diff --git a/lang/rust/files/patch-vendor_nix-0.28.0_src_sys_signal.rs b/lang/rust/files/patch-vendor_nix-0.28.0_src_sys_signal.rs new file mode 100644 index 000000000000..fbe6d4e5a216 --- /dev/null +++ b/lang/rust/files/patch-vendor_nix-0.28.0_src_sys_signal.rs @@ -0,0 +1,20 @@ +--- vendor/nix-0.28.0/src/sys/signal.rs.orig 2024-06-14 14:06:00 UTC ++++ vendor/nix-0.28.0/src/sys/signal.rs +@@ -1099,7 +1099,7 @@ pub type type_of_thread_id = libc::lwpid_t; + #[cfg(target_os = "freebsd")] + pub type type_of_thread_id = libc::lwpid_t; + /// Identifies a thread for [`SigevNotify::SigevThreadId`] +-#[cfg(all(not(target_os = "hurd"), any(target_env = "gnu", target_env = "uclibc")))] ++#[cfg(all(not(any(target_os = "freebsd", target_os = "hurd")), any(target_env = "gnu", target_env = "uclibc")))] + pub type type_of_thread_id = libc::pid_t; + + /// Specifies the notification method used by a [`SigEvent`] +@@ -1349,7 +1349,7 @@ mod sigevent { + sev.sigev_value.sival_ptr = si_value as *mut libc::c_void; + sev._sigev_un._threadid = thread_id; + } +- #[cfg(any(target_env = "gnu", target_env = "uclibc"))] ++ #[cfg(all(not(target_os = "freebsd"), any(target_env = "gnu", target_env = "uclibc")))] + SigevNotify::SigevThreadId{signal, thread_id, si_value} => { + sev.sigev_notify = libc::SIGEV_THREAD_ID; + sev.sigev_signo = signal as libc::c_int; diff --git a/lang/rust/files/riscv64/patch-vendor_openssl-src_src_lib.rs b/lang/rust/files/riscv64/patch-vendor_openssl-src_src_lib.rs index 3171b5769f1a..c7fd8cb30f49 100644 --- a/lang/rust/files/riscv64/patch-vendor_openssl-src_src_lib.rs +++ b/lang/rust/files/riscv64/patch-vendor_openssl-src_src_lib.rs @@ -1,5 +1,5 @@ ---- vendor/openssl-src/src/lib.rs.orig 2021-11-04 11:27:54 UTC -+++ vendor/openssl-src/src/lib.rs +--- vendor/openssl-src-111.28.1+1.1.1w/src/lib.rs.orig 2021-11-04 11:27:54 UTC ++++ vendor/openssl-src-111.28.1+1.1.1w/src/lib.rs @@ -260,6 +260,7 @@ impl Build { "powerpc64le-unknown-freebsd" => "BSD-generic64", "powerpc64le-unknown-linux-gnu" => "linux-ppc64le", |