Merge remote-tracking branch 'up/f38' into f38-riscv64

Signed-off-by: David Abdurachmanov <davidlt@rivosinc.com>
This commit is contained in:
David Abdurachmanov 2023-04-05 10:30:13 +03:00
commit 67c20fe38e
Signed by: davidlt
GPG Key ID: 8B7F1DA0E2C9FDBB
5 changed files with 67 additions and 98 deletions

4
.gitignore vendored
View File

@ -412,3 +412,7 @@
/rustc-1.66.1-src.tar.xz /rustc-1.66.1-src.tar.xz
/rustc-1.67.0-src.tar.xz /rustc-1.67.0-src.tar.xz
/rustc-1.67.1-src.tar.xz /rustc-1.67.1-src.tar.xz
/rustc-1.68.0-src.tar.xz
/wasi-libc-wasi-sdk-19.tar.gz
/rustc-1.68.1-src.tar.xz
/rustc-1.68.2-src.tar.xz

View File

@ -1,55 +0,0 @@
From ecf812777a260e35ec9cd0c7d9dbd17a3f5cf5f9 Mon Sep 17 00:00:00 2001
From: Arpad Borsos <swatinem@swatinem.de>
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<Output>`.
---
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

View File

@ -1,4 +1,4 @@
# Only x86_64 and i686 are Tier 1 platforms at this time. # Only x86_64, i686, and aarch64 are Tier 1 platforms at this time.
# https://doc.rust-lang.org/nightly/rustc/platform-support.html # https://doc.rust-lang.org/nightly/rustc/platform-support.html
%global rust_arches x86_64 i686 armv7hl aarch64 ppc64le s390x riscv64 %global rust_arches x86_64 i686 armv7hl aarch64 ppc64le s390x riscv64
@ -8,9 +8,9 @@
# To bootstrap from scratch, set the channel and date from src/stage0.json # To bootstrap from scratch, set the channel and date from src/stage0.json
# e.g. 1.59.0 wants rustc: 1.58.0-2022-01-13 # e.g. 1.59.0 wants rustc: 1.58.0-2022-01-13
# or nightly wants some beta-YYYY-MM-DD # or nightly wants some beta-YYYY-MM-DD
%global bootstrap_version 1.66.0 %global bootstrap_version 1.67.1
%global bootstrap_channel 1.66.0 %global bootstrap_channel 1.67.1
%global bootstrap_date 2022-12-15 %global bootstrap_date 2023-02-09
# Only the specified arches will use bootstrap binaries. # Only the specified arches will use bootstrap binaries.
# NOTE: Those binaries used to be uploaded with every new release, but that was # NOTE: Those binaries used to be uploaded with every new release, but that was
@ -35,7 +35,7 @@
# src/ci/docker/host-x86_64/dist-various-2/build-wasi-toolchain.sh # src/ci/docker/host-x86_64/dist-various-2/build-wasi-toolchain.sh
# (updated per https://github.com/rust-lang/rust/pull/96907) # (updated per https://github.com/rust-lang/rust/pull/96907)
%global wasi_libc_url https://github.com/WebAssembly/wasi-libc %global wasi_libc_url https://github.com/WebAssembly/wasi-libc
%global wasi_libc_ref wasi-sdk-17 %global wasi_libc_ref wasi-sdk-19
%global wasi_libc_name wasi-libc-%{wasi_libc_ref} %global wasi_libc_name wasi-libc-%{wasi_libc_ref}
%global wasi_libc_source %{wasi_libc_url}/archive/%{wasi_libc_ref}/%{wasi_libc_name}.tar.gz %global wasi_libc_source %{wasi_libc_url}/archive/%{wasi_libc_ref}/%{wasi_libc_name}.tar.gz
%global wasi_libc_dir %{_builddir}/%{wasi_libc_name} %global wasi_libc_dir %{_builddir}/%{wasi_libc_name}
@ -87,7 +87,7 @@
%endif %endif
Name: rust Name: rust
Version: 1.67.1 Version: 1.68.2
Release: 1.0.riscv64%{?dist} Release: 1.0.riscv64%{?dist}
Summary: The Rust Programming Language Summary: The Rust Programming Language
License: (ASL 2.0 or MIT) and (BSD and MIT) License: (ASL 2.0 or MIT) and (BSD and MIT)
@ -110,10 +110,6 @@ Patch1: 0001-Use-lld-provided-by-system-for-wasm.patch
# Set a substitute-path in rust-gdb for standard library sources. # Set a substitute-path in rust-gdb for standard library sources.
Patch2: rustc-1.61.0-rust-gdb-substitute-path.patch Patch2: rustc-1.61.0-rust-gdb-substitute-path.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 ### ### RHEL-specific patches below ###
# Simple rpm macros for rust-toolset (as opposed to full rust-packaging) # Simple rpm macros for rust-toolset (as opposed to full rust-packaging)
@ -124,7 +120,7 @@ Patch100: rustc-1.65.0-disable-libssh2.patch
# libcurl on RHEL7 doesn't have http2, but since cargo requests it, curl-sys # libcurl on RHEL7 doesn't have http2, but since cargo requests it, curl-sys
# will try to build it statically -- instead we turn off the feature. # will try to build it statically -- instead we turn off the feature.
Patch101: rustc-1.67.0-disable-http2.patch Patch101: rustc-1.68.0-disable-http2.patch
# kernel rh1410097 causes too-small stacks for PIE. # kernel rh1410097 causes too-small stacks for PIE.
# (affects RHEL6 kernels when building for RHEL7) # (affects RHEL6 kernels when building for RHEL7)
@ -336,8 +332,9 @@ This package includes the Rust compiler and documentation generator.
%package std-static %package std-static
Summary: Standard library for Rust Summary: Standard library for Rust
Provides: %{name}-std-static-%{rust_triple} = %{version}-%{release}
Requires: %{name} = %{version}-%{release} Requires: %{name} = %{version}-%{release}
Requires: glibc-devel%{?_isa} >= 2.11 Requires: glibc-devel%{?_isa} >= 2.17
%description std-static %description std-static
This package includes the standard libraries for building applications This package includes the standard libraries for building applications
@ -554,12 +551,13 @@ feature for the Rust standard library. The RLS (Rust Language Server) uses this
data to provide information about the Rust standard library. data to provide information about the Rust standard library.
%if 0%{?rhel} && 0%{?rhel} >= 8 %if 0%{?rhel}
%package toolset %package toolset
Summary: Rust Toolset Summary: Rust Toolset
Requires: rust%{?_isa} = %{version}-%{release} BuildArch: noarch
Requires: cargo%{?_isa} = %{version}-%{release} Requires: rust = %{version}-%{release}
Requires: cargo = %{version}-%{release}
%description toolset %description toolset
This is the metapackage for Rust Toolset, bringing in the Rust compiler, This is the metapackage for Rust Toolset, bringing in the Rust compiler,
@ -590,7 +588,6 @@ test -f '%{local_rust_root}/bin/rustc'
%patch1 -p1 %patch1 -p1
%patch2 -p1 %patch2 -p1
%patch3 -p1
%if %with disabled_libssh2 %if %with disabled_libssh2
%patch100 -p1 %patch100 -p1
@ -662,6 +659,12 @@ find vendor -name .cargo-checksum.json \
# it's a shebang and make them executable. Then brp-mangle-shebangs gets upset... # it's a shebang and make them executable. Then brp-mangle-shebangs gets upset...
find -name '*.rs' -type f -perm /111 -exec chmod -v -x '{}' '+' find -name '*.rs' -type f -perm /111 -exec chmod -v -x '{}' '+'
# The distro flags are only appropriate for the host, not our cross-targets,
# and they're not as fine-grained as the settings we choose for std vs rustc.
%if %defined build_rustflags
%global build_rustflags %{nil}
%endif
# Set up shared environment variables for build/install/check # Set up shared environment variables for build/install/check
%global rust_env %{?rustflags:RUSTFLAGS="%{rustflags}"} %global rust_env %{?rustflags:RUSTFLAGS="%{rustflags}"}
%if 0%{?cmake_path:1} %if 0%{?cmake_path:1}
@ -854,7 +857,7 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*
# We don't want Rust copies of LLVM tools (rust-lld, rust-llvm-dwp) # We don't want Rust copies of LLVM tools (rust-lld, rust-llvm-dwp)
rm -f %{buildroot}%{rustlibdir}/%{rust_triple}/bin/rust-ll* rm -f %{buildroot}%{rustlibdir}/%{rust_triple}/bin/rust-ll*
%if 0%{?rhel} && 0%{?rhel} >= 8 %if 0%{?rhel}
# This allows users to build packages using Rust Toolset. # This allows users to build packages using Rust Toolset.
%{__install} -D -m 644 %{S:100} %{buildroot}%{rpmmacrodir}/macros.rust-toolset %{__install} -D -m 644 %{S:100} %{buildroot}%{rpmmacrodir}/macros.rust-toolset
%endif %endif
@ -1041,16 +1044,31 @@ end}
%{rustlibdir}/%{rust_triple}/analysis/ %{rustlibdir}/%{rust_triple}/analysis/
%if 0%{?rhel} && 0%{?rhel} >= 8 %if 0%{?rhel}
%files toolset %files toolset
%{rpmmacrodir}/macros.rust-toolset %{rpmmacrodir}/macros.rust-toolset
%endif %endif
%changelog %changelog
* Fri Feb 17 2023 David Abdurachmanov <davidlt@rivosinc.com> - 1.67.1-1.0.riscv64 * Wed Apr 05 2023 David Abdurachmanov <davidlt@rivosinc.com> - 1.68.2-1.0.riscv64
- Enable riscv64 - Enable riscv64
* Tue Mar 28 2023 Josh Stone <jistone@redhat.com> - 1.68.2-1
- Update to 1.68.2.
* Thu Mar 23 2023 Josh Stone <jistone@redhat.com> - 1.68.1-1
- Update to 1.68.1.
* Thu Mar 09 2023 Josh Stone <jistone@redhat.com> - 1.68.0-1
- Update to 1.68.0.
* Tue Mar 07 2023 David Michael <fedora.dm0@gmail.com> - 1.67.1-3
- Add a virtual Provides to rust-std-static containing the target triple.
* Mon Feb 20 2023 Orion Poplawski <orion@nwra.com> - 1.67.1-2
- Ship rust-toolset for EPEL7
* Thu Feb 09 2023 Josh Stone <jistone@redhat.com> - 1.67.1-1 * Thu Feb 09 2023 Josh Stone <jistone@redhat.com> - 1.67.1-1
- Update to 1.67.1. - Update to 1.67.1.

View File

@ -1,6 +1,6 @@
--- rustc-beta-src/Cargo.lock.orig 2023-01-24 13:25:47.822917185 -0800 --- rustc-beta-src/Cargo.lock.orig 2023-03-03 17:26:41.309081970 -0800
+++ rustc-beta-src/Cargo.lock 2023-01-24 13:25:47.824917142 -0800 +++ rustc-beta-src/Cargo.lock 2023-03-03 17:26:41.311081929 -0800
@@ -1062,7 +1062,6 @@ @@ -1152,7 +1152,6 @@
dependencies = [ dependencies = [
"cc", "cc",
"libc", "libc",
@ -8,7 +8,7 @@
"libz-sys", "libz-sys",
"openssl-sys", "openssl-sys",
"pkg-config", "pkg-config",
@@ -2181,16 +2180,6 @@ @@ -2399,16 +2398,6 @@
checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a" checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a"
[[package]] [[package]]
@ -25,20 +25,20 @@
name = "libz-sys" name = "libz-sys"
version = "1.1.3" version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2023-01-24 13:25:47.824917142 -0800 --- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2023-03-03 17:26:41.311081929 -0800
+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2023-01-24 13:26:29.209044200 -0800 +++ rustc-beta-src/src/tools/cargo/Cargo.toml 2023-03-03 17:27:32.999013773 -0800
@@ -21,7 +21,7 @@ @@ -21,7 +21,7 @@
cargo-platform = { path = "crates/cargo-platform", version = "0.1.2" } cargo-platform = { path = "crates/cargo-platform", version = "0.1.2" }
cargo-util = { path = "crates/cargo-util", version = "0.2.3" } cargo-util = { path = "crates/cargo-util", version = "0.2.3" }
crates-io = { path = "crates/crates-io", version = "0.35.0" } crates-io = { path = "crates/crates-io", version = "0.35.1" }
-curl = { version = "0.4.44", features = ["http2"] } -curl = { version = "0.4.44", features = ["http2"] }
+curl = { version = "0.4.44", features = [] } +curl = { version = "0.4.44", features = [] }
curl-sys = "0.4.59" curl-sys = "0.4.59"
env_logger = "0.10.0" env_logger = "0.10.0"
pretty_env_logger = { version = "0.4", optional = true } pretty_env_logger = { version = "0.4", optional = true }
--- rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs.orig 2023-01-21 17:17:19.000000000 -0800 --- rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs.orig 2023-02-26 19:02:38.000000000 -0800
+++ rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs 2023-01-24 13:25:47.824917142 -0800 +++ rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs 2023-03-03 17:26:41.311081929 -0800
@@ -403,16 +403,9 @@ @@ -402,16 +402,9 @@
sources: SourceMap<'cfg>, sources: SourceMap<'cfg>,
config: &'cfg Config, config: &'cfg Config,
) -> CargoResult<PackageSet<'cfg>> { ) -> CargoResult<PackageSet<'cfg>> {
@ -58,18 +58,9 @@
Ok(PackageSet { Ok(PackageSet {
packages: package_ids packages: package_ids
@@ -658,7 +651,7 @@ --- rustc-beta-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs.orig 2023-02-26 19:02:38.000000000 -0800
macro_rules! try_old_curl { +++ rustc-beta-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs 2023-03-03 17:26:41.311081929 -0800
($e:expr, $msg:expr) => { @@ -220,16 +220,8 @@
let result = $e;
- if cfg!(target_os = "macos") {
+ if cfg!(any(target_os = "linux", target_os = "macos")) {
if let Err(e) = result {
warn!("ignoring libcurl {} error: {}", $msg, e);
}
--- rustc-beta-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs.orig 2023-01-21 17:17:19.000000000 -0800
+++ rustc-beta-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs 2023-01-24 13:25:47.824917142 -0800
@@ -223,16 +223,8 @@
} }
self.fetch_started = true; self.fetch_started = true;
@ -88,3 +79,14 @@
self.config self.config
.shell() .shell()
--- rustc-beta-src/src/tools/cargo/src/cargo/util/network.rs.orig 2023-02-26 19:02:38.000000000 -0800
+++ rustc-beta-src/src/tools/cargo/src/cargo/util/network.rs 2023-03-03 17:29:54.808076261 -0800
@@ -116,7 +116,7 @@
macro_rules! try_old_curl {
($e:expr, $msg:expr) => {
let result = $e;
- if cfg!(target_os = "macos") {
+ if cfg!(any(target_os = "linux", target_os = "macos")) {
if let Err(e) = result {
warn!("ignoring libcurl {} error: {}", $msg, e);
}

View File

@ -1,2 +1,2 @@
SHA512 (rustc-1.67.1-src.tar.xz) = 42d77ee93b168ae139b026138fb48d925624ff436a836aa97ee235f870e61ea11643b0cf7ad20bcafda774c6cd3855a4bc10a2e2ed1c4d82c6f15158963b304d SHA512 (rustc-1.68.2-src.tar.xz) = 8b085d0351e19100e9abc24b10c44a0939a1d35ba23421da4ece345d7373f7dbad1dc6a2ae153c1259404dd96b41e2682e711cf2b0b63fd03a196760cddbcdd3
SHA512 (wasi-libc-wasi-sdk-17.tar.gz) = 5870f86d4a8431edefaef41163d1fa7eddeabcfa6bc5794c7bf18b4fd320b6ea43c261a7e41966d0da1490a2d96b9742c82cbcca7c56bb404830722664cab376 SHA512 (wasi-libc-wasi-sdk-19.tar.gz) = 312f4d01d1b1108c24a1e9b233648ec44408ec1b7c17e8a65288038a94f117be9ed8181c60f99f9593ff80ca380f53c51756357bad466cd65027cb23a3646d23