From 752fe3bcd2d1df989986fc5829445ec937311e74 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 9 Feb 2023 16:52:15 -0800 Subject: [PATCH] Update to 1.67.1. --- 0001-Fix-Async-Generator-ABI.patch | 55 +++++++++++++++++++ 107360-modified.patch | 26 --------- ...a0b3dd5fe14b43ad5b7862f4528df7322468.patch | 38 ------------- rust.spec | 20 +++---- 4 files changed, 63 insertions(+), 76 deletions(-) create mode 100644 0001-Fix-Async-Generator-ABI.patch delete mode 100644 107360-modified.patch delete mode 100644 675fa0b3dd5fe14b43ad5b7862f4528df7322468.patch diff --git a/0001-Fix-Async-Generator-ABI.patch b/0001-Fix-Async-Generator-ABI.patch new file mode 100644 index 0000000..34dd1bc --- /dev/null +++ b/0001-Fix-Async-Generator-ABI.patch @@ -0,0 +1,55 @@ +From ecf812777a260e35ec9cd0c7d9dbd17a3f5cf5f9 Mon Sep 17 00:00:00 2001 +From: Arpad Borsos +Date: Tue, 29 Nov 2022 23:17:08 +0100 +Subject: [PATCH] Fix Async Generator ABI + +This change was missed when making async generators implement `Future` directly. +It did not cause any problems in codegen so far, as `GeneratorState<(), Output>` +happens to have the same ABI as `Poll`. +--- + compiler/rustc_ty_utils/src/abi.rs | 22 +++++++++++++++++----- + 1 file changed, 17 insertions(+), 5 deletions(-) + +diff --git a/compiler/rustc_ty_utils/src/abi.rs b/compiler/rustc_ty_utils/src/abi.rs +index 73c7eb6992f0..d644cbccea11 100644 +--- a/compiler/rustc_ty_utils/src/abi.rs ++++ b/compiler/rustc_ty_utils/src/abi.rs +@@ -85,7 +85,7 @@ fn fn_sig_for_fn_abi<'tcx>( + bound_vars, + ) + } +- ty::Generator(_, substs, _) => { ++ ty::Generator(did, substs, _) => { + let sig = substs.as_generator().poly_sig(); + + let bound_vars = tcx.mk_bound_variable_kinds( +@@ -104,10 +104,22 @@ fn fn_sig_for_fn_abi<'tcx>( + let env_ty = tcx.mk_adt(pin_adt_ref, pin_substs); + + let sig = sig.skip_binder(); +- let state_did = tcx.require_lang_item(LangItem::GeneratorState, None); +- let state_adt_ref = tcx.adt_def(state_did); +- let state_substs = tcx.intern_substs(&[sig.yield_ty.into(), sig.return_ty.into()]); +- let ret_ty = tcx.mk_adt(state_adt_ref, state_substs); ++ // The `FnSig` and the `ret_ty` here is for a generators main ++ // `Generator::resume(...) -> GeneratorState` function in case we ++ // have an ordinary generator, or the `Future::poll(...) -> Poll` ++ // function in case this is a special generator backing an async construct. ++ let ret_ty = if tcx.generator_is_async(did) { ++ let state_did = tcx.require_lang_item(LangItem::Poll, None); ++ let state_adt_ref = tcx.adt_def(state_did); ++ let state_substs = tcx.intern_substs(&[sig.return_ty.into()]); ++ tcx.mk_adt(state_adt_ref, state_substs) ++ } else { ++ let state_did = tcx.require_lang_item(LangItem::GeneratorState, None); ++ let state_adt_ref = tcx.adt_def(state_did); ++ let state_substs = tcx.intern_substs(&[sig.yield_ty.into(), sig.return_ty.into()]); ++ tcx.mk_adt(state_adt_ref, state_substs) ++ }; ++ + ty::Binder::bind_with_vars( + tcx.mk_fn_sig( + [env_ty, sig.resume_ty].iter(), +-- +2.39.1 + diff --git a/107360-modified.patch b/107360-modified.patch deleted file mode 100644 index 3d59653..0000000 --- a/107360-modified.patch +++ /dev/null @@ -1,26 +0,0 @@ -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 deleted file mode 100644 index eb16066..0000000 --- a/675fa0b3dd5fe14b43ad5b7862f4528df7322468.patch +++ /dev/null @@ -1,38 +0,0 @@ -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 03c816f..5a377de 100644 --- a/rust.spec +++ b/rust.spec @@ -83,8 +83,8 @@ %endif Name: rust -Version: 1.67.0 -Release: 3%{?dist} +Version: 1.67.1 +Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -106,15 +106,9 @@ 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 +# Fix Async Generator ABI (rhbz2168622) +# https://github.com/rust-lang/rust/pull/105082 +Patch3: 0001-Fix-Async-Generator-ABI.patch ### RHEL-specific patches below ### @@ -591,7 +585,6 @@ test -f '%{local_rust_root}/bin/rustc' %patch1 -p1 %patch2 -p1 %patch3 -p1 -%patch4 -p1 %if %with disabled_libssh2 %patch100 -p1 @@ -1047,6 +1040,9 @@ end} %changelog +* Thu Feb 09 2023 Josh Stone - 1.67.1-1 +- Update to 1.67.1. + * Fri Feb 03 2023 Josh Stone - 1.67.0-3 - Unbundle libgit2 on Fedora 38.