diff --git a/107360-modified.patch b/107360-modified.patch new file mode 100644 index 0000000..3d59653 --- /dev/null +++ b/107360-modified.patch @@ -0,0 +1,26 @@ +From de363d54c40a378717881240e719f5f7223ba376 Mon Sep 17 00:00:00 2001 +From: bjorn3 <17426603+bjorn3@users.noreply.github.com> +Date: Fri, 27 Jan 2023 11:48:36 +0000 +Subject: [PATCH 3/4] Revert back to LlvmArchiveBuilder on all platforms + +ArArchiveBuilder doesn't support reading thin archives, causing a +regression. +--- + compiler/rustc_codegen_llvm/src/back/archive.rs | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/compiler/rustc_codegen_llvm/src/back/archive.rs b/compiler/rustc_codegen_llvm/src/back/archive.rs +index b00676b7c592b..58ca87524deb6 100644 +--- a/compiler/rustc_codegen_llvm/src/back/archive.rs ++++ b/compiler/rustc_codegen_llvm/src/back/archive.rs +@@ -108,7 +108,9 @@ pub struct LlvmArchiveBuilderBuilder; + + impl ArchiveBuilderBuilder for LlvmArchiveBuilderBuilder { + fn new_archive_builder<'a>(&self, sess: &'a Session) -> Box + 'a> { +- if sess.target.arch == "wasm32" || sess.target.arch == "wasm64" { ++ // FIXME use ArArchiveBuilder on most targets again once reading thin archives is ++ // implemented ++ if true || sess.target.arch == "wasm32" || sess.target.arch == "wasm64" { + Box::new(LlvmArchiveBuilder { sess, additions: Vec::new() }) + } else { + Box::new(ArArchiveBuilder::new(sess, get_llvm_object_symbols)) diff --git a/675fa0b3dd5fe14b43ad5b7862f4528df7322468.patch b/675fa0b3dd5fe14b43ad5b7862f4528df7322468.patch new file mode 100644 index 0000000..eb16066 --- /dev/null +++ b/675fa0b3dd5fe14b43ad5b7862f4528df7322468.patch @@ -0,0 +1,38 @@ +From 675fa0b3dd5fe14b43ad5b7862f4528df7322468 Mon Sep 17 00:00:00 2001 +From: Michael Goulet +Date: Mon, 12 Dec 2022 18:29:33 +0000 +Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A8=20fix=20unsoundness=20in=20bootstr?= + =?UTF-8?q?ap=20cache=20code?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +--- + src/bootstrap/cache.rs | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/bootstrap/cache.rs b/src/bootstrap/cache.rs +index be5c9bb078808..05f25af68ea8f 100644 +--- a/src/bootstrap/cache.rs ++++ b/src/bootstrap/cache.rs +@@ -89,16 +89,16 @@ impl Hash for Interned { + + impl Deref for Interned { + type Target = T::Target; +- fn deref(&self) -> &'static Self::Target { ++ fn deref(&self) -> &Self::Target { + let l = T::intern_cache().lock().unwrap(); +- unsafe { mem::transmute::<&Self::Target, &'static Self::Target>(l.get(*self)) } ++ unsafe { mem::transmute::<&Self::Target, &Self::Target>(l.get(*self)) } + } + } + + impl, U: ?Sized> AsRef for Interned { +- fn as_ref(&self) -> &'static U { ++ fn as_ref(&self) -> &U { + let l = T::intern_cache().lock().unwrap(); +- unsafe { mem::transmute::<&U, &'static U>(l.get(*self).as_ref()) } ++ unsafe { mem::transmute::<&U, &U>(l.get(*self).as_ref()) } + } + } + diff --git a/rust.spec b/rust.spec index 04de8a6..1c2cc6c 100644 --- a/rust.spec +++ b/rust.spec @@ -84,7 +84,7 @@ Name: rust Version: 1.67.0 -Release: 1%{?dist} +Release: 2awb%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -106,6 +106,16 @@ Patch1: 0001-Use-lld-provided-by-system-for-wasm.patch # Set a substitute-path in rust-gdb for standard library sources. Patch2: rustc-1.61.0-rust-gdb-substitute-path.patch +# Fix bootstrap failure +# https://github.com/rust-lang/rust/commit/675fa0b3dd5fe14b43ad5b7862f4528df7322468 +Patch3: 675fa0b3dd5fe14b43ad5b7862f4528df7322468.patch + +# fix build of mesa, possibly other things; patch edited to only +# include the one commit necessary on top of 1.67.0 +# https://github.com/rust-lang/rust/issues/107334 +# https://github.com/rust-lang/rust/pull/107360 +Patch4: 107360-modified.patch + ### RHEL-specific patches below ### # Simple rpm macros for rust-toolset (as opposed to full rust-packaging) @@ -580,6 +590,8 @@ test -f '%{local_rust_root}/bin/rustc' %patch1 -p1 %patch2 -p1 +%patch3 -p1 +%patch4 -p1 %if %with disabled_libssh2 %patch100 -p1 @@ -1035,6 +1047,10 @@ end} %changelog +* Fri Jan 27 2023 Adam Williamson - 1.67.0-2 +- Backport PR #107360 to fix build of mesa +- Backport 675fa0b3 to fix bootstrapping failure + * Thu Jan 26 2023 Josh Stone - 1.67.0-1 - Update to 1.67.0.