gnu: rust: Update to 1.78.
* gnu/packages/rust.scm (rust): Update to 1.78. [source]: Adjust removal of bundled source libraries. [arguments]: Add a phase skipping tests requiring crates.io. (rust-1.78)[source]: Add patch. * gnu/packages/patches/rust-1.78-unwinding-fix.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. Change-Id: I7bf37a9321447ac21644af0e2d023b8bc556da59 Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
This commit is contained in:
parent
8dae6b4754
commit
179a11c706
@ -2102,6 +2102,7 @@ dist_patch_DATA = \
|
||||
%D%/packages/patches/rustc-1.54.0-src.patch \
|
||||
%D%/packages/patches/rust-1.64-fix-riscv64-bootstrap.patch \
|
||||
%D%/packages/patches/rust-1.70-fix-rustix-build.patch \
|
||||
%D%/packages/patches/rust-1.78-unwinding-fix.patch \
|
||||
%D%/packages/patches/rust-cargo-edit-remove-ureq.patch \
|
||||
%D%/packages/patches/rust-ring-0.17-ring-core.patch \
|
||||
%D%/packages/patches/rust-ndarray-remove-blas-src-dep.patch \
|
||||
|
29
gnu/packages/patches/rust-1.78-unwinding-fix.patch
Normal file
29
gnu/packages/patches/rust-1.78-unwinding-fix.patch
Normal file
@ -0,0 +1,29 @@
|
||||
From ce49a9d9e52ca6062fe0894e72d954511fa8820f Mon Sep 17 00:00:00 2001
|
||||
From: Shmuel Hazan <ShmuelHazan0@gmail.com>
|
||||
Date: Sat, 1 Jun 2024 08:49:44 +0300
|
||||
Subject: [PATCH] Add UWTable attr to functions with a personality function
|
||||
|
||||
Adding a personality function forces LLVM to generate unwinding info that might be incorrect.
|
||||
To solve it, always apply the UWTable attribute when setting a personality function.
|
||||
|
||||
Fixes #123733
|
||||
---
|
||||
compiler/rustc_codegen_llvm/src/builder.rs | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/compiler/rustc_codegen_llvm/src/builder.rs b/compiler/rustc_codegen_llvm/src/builder.rs
|
||||
index 72ff9ea118e28..668f0a33a4e80 100644
|
||||
--- a/compiler/rustc_codegen_llvm/src/builder.rs
|
||||
+++ b/compiler/rustc_codegen_llvm/src/builder.rs
|
||||
@@ -1029,6 +1029,11 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
|
||||
}
|
||||
|
||||
fn set_personality_fn(&mut self, personality: &'ll Value) {
|
||||
+ // Work around for https://github.com/rust-lang/rust/issues/123733
|
||||
+ // add the UWTable attribute to every function with a personality function.
|
||||
+ let uwtable = attributes::uwtable_attr(self.llcx, None);
|
||||
+ attributes::apply_to_llfn(self.llfn(), llvm::AttributePlace::Function, &[uwtable]);
|
||||
+
|
||||
unsafe {
|
||||
llvm::LLVMSetPersonalityFn(self.llfn(), personality);
|
||||
}
|
@ -987,8 +987,15 @@ safety and thread safety guarantees.")
|
||||
"[build]\noptimized-compiler-builtins = false")))))))))))
|
||||
|
||||
(define-public rust-1.78
|
||||
(rust-bootstrapped-package
|
||||
rust-1.77 "1.78.0" "1afmj5g3bz7439w4i8zjhd68zvh0gqg7ymr8h5rz49ybllilhm7z"))
|
||||
(let ((base-rust (rust-bootstrapped-package rust-1.77 "1.78.0"
|
||||
"1afmj5g3bz7439w4i8zjhd68zvh0gqg7ymr8h5rz49ybllilhm7z")))
|
||||
(package
|
||||
(inherit base-rust)
|
||||
(source
|
||||
(origin
|
||||
(inherit (package-source base-rust))
|
||||
;; see https://github.com/rust-lang/rust/pull/125844
|
||||
(patches (search-patches "rust-1.78-unwinding-fix.patch")))))))
|
||||
|
||||
(define-public rust-1.79
|
||||
(let ((base-rust (rust-bootstrapped-package rust-1.78 "1.79.0"
|
||||
@ -1030,7 +1037,7 @@ safety and thread safety guarantees.")
|
||||
;;; Here we take the latest included Rust, make it public, and re-enable tests
|
||||
;;; and extra components such as rustfmt.
|
||||
(define-public rust
|
||||
(let ((base-rust rust-1.77))
|
||||
(let ((base-rust rust-1.78))
|
||||
(package
|
||||
(inherit base-rust)
|
||||
(properties (append
|
||||
@ -1050,11 +1057,10 @@ safety and thread safety guarantees.")
|
||||
;; These are referenced by the cargo output
|
||||
;; so we unbundle them.
|
||||
"vendor/curl-sys/curl"
|
||||
"vendor/curl-sys-0.4.63+curl-8.1.2/curl"
|
||||
"vendor/libffi-sys/libffi"
|
||||
"vendor/libnghttp2-sys/nghttp2"
|
||||
"vendor/libz-sys/src/zlib"
|
||||
"vendor/libz-sys-1.1.9/src/zlib"))
|
||||
"vendor/libz-sys-1.1.12/src/zlib"))
|
||||
;; Use the packaged nghttp2
|
||||
(delete-file "vendor/libnghttp2-sys/build.rs")
|
||||
(with-output-to-file "vendor/libnghttp2-sys/build.rs"
|
||||
@ -1170,6 +1176,11 @@ safety and thread safety guarantees.")
|
||||
(substitute* "features2.rs"
|
||||
,@(make-ignore-test-list
|
||||
'("fn dep_with_optional_host_deps_activated"))))))
|
||||
(add-after 'unpack 'disable-tests-requiring-crates.io
|
||||
(lambda _
|
||||
(substitute* "src/tools/cargo/tests/testsuite/install.rs"
|
||||
,@(make-ignore-test-list
|
||||
'("fn install_global_cargo_config")))))
|
||||
(add-after 'unpack 'patch-command-exec-tests
|
||||
;; This test suite includes some tests that the stdlib's
|
||||
;; `Command` execution properly handles in situations where
|
||||
@ -1228,7 +1239,7 @@ safety and thread safety guarantees.")
|
||||
((" = rpath.*" all)
|
||||
(string-append all
|
||||
" "
|
||||
"rustflags.arg(\"-Clink-args=-Wl,-rpath="
|
||||
"self.rustflags.arg(\"-Clink-args=-Wl,-rpath="
|
||||
out "/lib\");\n"))))))
|
||||
(add-after 'unpack 'unpack-profiler-rt
|
||||
;; Copy compiler-rt sources to where libprofiler_builtins looks
|
||||
|
Loading…
Reference in New Issue
Block a user