summaryrefslogtreecommitdiff
path: root/lang/rust/files
diff options
context:
space:
mode:
authorMikael Urankar <mikael@FreeBSD.org>2024-05-06 09:03:47 +0200
committerMikael Urankar <mikael@FreeBSD.org>2024-05-13 13:03:21 +0200
commit7e86fe10e4c7066dedd15d5268e0a469a553b260 (patch)
tree16644c09aa3bb7ae94edf8594cdac3846d97fe0d /lang/rust/files
parentlang/rust: remap debuginfo (diff)
lang/rust: Update to 1.78.0
While here, disable RUST_BACKTRACE on ppc64le only Announce: https://blog.rust-lang.org/2024/05/02/Rust-1.78.0.html ChangeLog: https://github.com/rust-lang/rust/releases/tag/1.78.0 PR: 278834 Tested by: pkubaj,mikael
Diffstat (limited to 'lang/rust/files')
-rw-r--r--lang/rust/files/armv7/patch-compiler_rustc__driver__impl_src_signal__handler.rs28
-rw-r--r--lang/rust/files/armv7/patch-vendor_rustix_src_backend_libc_fs_syscalls.rs24
-rw-r--r--lang/rust/files/patch-vendor_cc_src_tool.rs (renamed from lang/rust/files/patch-vendor_cc_src_lib.rs)20
3 files changed, 61 insertions, 11 deletions
diff --git a/lang/rust/files/armv7/patch-compiler_rustc__driver__impl_src_signal__handler.rs b/lang/rust/files/armv7/patch-compiler_rustc__driver__impl_src_signal__handler.rs
new file mode 100644
index 000000000000..17585c99ce3d
--- /dev/null
+++ b/lang/rust/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
+@@ -40,7 +40,7 @@ extern "C" fn print_stack_trace(_: libc::c_int) {
+ static mut STACK_TRACE: [*mut libc::c_void; MAX_FRAMES] = [ptr::null_mut(); MAX_FRAMES];
+ let stack = unsafe {
+ // Collect return addresses
+- let depth = libc::backtrace(STACK_TRACE.as_mut_ptr(), MAX_FRAMES as i32);
++ let depth = libc::backtrace(STACK_TRACE.as_mut_ptr(), (MAX_FRAMES as i32).try_into().unwrap());
+ if depth == 0 {
+ return;
+ }
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
new file mode 100644
index 000000000000..423655a62676
--- /dev/null
+++ b/lang/rust/files/armv7/patch-vendor_rustix_src_backend_libc_fs_syscalls.rs
@@ -0,0 +1,24 @@
+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_src_lib.rs b/lang/rust/files/patch-vendor_cc_src_tool.rs
index 16cb75a1f677..42c63f436594 100644
--- a/lang/rust/files/patch-vendor_cc_src_lib.rs
+++ b/lang/rust/files/patch-vendor_cc_src_tool.rs
@@ -8,13 +8,12 @@ until LLVM can be updated to use libc++ by default.
https://reviews.llvm.org/D77776
---- vendor/cc/src/lib.rs.orig 2021-03-04 20:58:54 UTC
-+++ vendor/cc/src/lib.rs
-@@ -2659,24 +2659,7 @@ impl Tool {
- }
+--- vendor/cc/src/tool.rs.orig 2024-03-18 11:23:17 UTC
++++ vendor/cc/src/tool.rs
+@@ -122,22 +122,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.
+ // 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 }
@@ -26,13 +25,12 @@ https://reviews.llvm.org/D77776
- _ => ToolFamily::Clang,
- }
- } else {
-- ToolFamily::Gnu
+- detect_family(&path)
- }
- } else {
-- ToolFamily::Gnu
+- detect_family(&path)
- };
--
+ let family = ToolFamily::Gnu;
+
Tool {
- path: path,
- cc_wrapper_path: None,
+ path,