beta test

This commit is contained in:
Josh Stone 2018-08-31 11:52:04 -07:00
parent fe90904f28
commit 7826701957
3 changed files with 48 additions and 104 deletions

View File

@ -0,0 +1,30 @@
From 66a47182d10542b68773d8a1cb9230a4918a5068 Mon Sep 17 00:00:00 2001
From: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
Date: Thu, 2 Aug 2018 08:49:36 +0200
Subject: [PATCH] rustbuild: fix local_rebuild
If we detect a local rebuild (e.g. bootstrap compiler is the same version as target compiler), we set stage to 1.
When trying to build e.g. UnstableBook, we use Mode::ToolBootstrap and stage is 1.
Just allow Mode::ToolBootstrap and stagge != 0 if we are in a local_rebuild
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
---
src/bootstrap/builder.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
index 724d3b741903..dc0b0aaf0bb3 100644
--- a/src/bootstrap/builder.rs
+++ b/src/bootstrap/builder.rs
@@ -777,7 +777,7 @@ impl<'a> Builder<'a> {
// compiler, but for tools we just use the precompiled libraries that
// we've downloaded
let use_snapshot = mode == Mode::ToolBootstrap;
- assert!(!use_snapshot || stage == 0);
+ assert!(!use_snapshot || stage == 0 || self.local_rebuild);
let maybe_sysroot = self.sysroot(compiler);
let sysroot = if use_snapshot {
--
2.17.1

View File

@ -1,74 +0,0 @@
From 763e72110a913c7aab396a0f687e2ebd3c9e572a Mon Sep 17 00:00:00 2001
From: Josh Stone <jistone@redhat.com>
Date: Thu, 9 Aug 2018 16:35:25 -0700
Subject: [PATCH] rustc_codegen_llvm: Restore the closure env alloca hack for
LLVM 5.
This hack was removed in #50949, but without it I found that building
`std` with full debuginfo would print many LLVM `DW_OP_LLVM_fragment`
errors, then die `LLVM ERROR: Failed to strip malformed debug info`.
It doesn't seem to be a problem for LLVM 6, so we can re-enable the hack
just for older LLVM.
This reverts commit da579ef75e4a8ca11fb98b24a0a3ea0c7ccffeeb.
Fixes #53204.
r? @eddyb
---
src/librustc_codegen_llvm/mir/mod.rs | 26 ++++++++++++++++++++++++--
1 file changed, 24 insertions(+), 2 deletions(-)
diff --git a/src/librustc_codegen_llvm/mir/mod.rs b/src/librustc_codegen_llvm/mir/mod.rs
index 8fdb67f5930c..8bb049be3054 100644
--- a/src/librustc_codegen_llvm/mir/mod.rs
+++ b/src/librustc_codegen_llvm/mir/mod.rs
@@ -574,6 +574,25 @@ fn arg_local_refs(
};
let upvar_tys = upvar_substs.upvar_tys(def_id, tcx);
+ // Store the pointer to closure data in an alloca for debuginfo
+ // because that's what the llvm.dbg.declare intrinsic expects.
+
+ // FIXME(eddyb) this shouldn't be necessary but SROA seems to
+ // mishandle DW_OP_plus not preceded by DW_OP_deref, i.e. it
+ // doesn't actually strip the offset when splitting the closure
+ // environment into its components so it ends up out of bounds.
+ // (cuviper) It seems to be fine without the alloca on LLVM 6 and later.
+ let env_alloca = !env_ref && unsafe { llvm::LLVMRustVersionMajor() < 6 };
+ let env_ptr = if env_alloca {
+ let scratch = PlaceRef::alloca(bx,
+ bx.cx.layout_of(tcx.mk_mut_ptr(arg.layout.ty)),
+ "__debuginfo_env_ptr");
+ bx.store(place.llval, scratch.llval, scratch.align);
+ scratch.llval
+ } else {
+ place.llval
+ };
+
for (i, (decl, ty)) in mir.upvar_decls.iter().zip(upvar_tys).enumerate() {
let byte_offset_of_var_in_env = closure_layout.fields.offset(i).bytes();
@@ -585,7 +604,10 @@ fn arg_local_refs(
};
// The environment and the capture can each be indirect.
- let mut ops = if env_ref { &ops[..] } else { &ops[1..] };
+
+ // FIXME(eddyb) see above why we sometimes have to keep
+ // a pointer in an alloca for debuginfo atm.
+ let mut ops = if env_ref || env_alloca { &ops[..] } else { &ops[1..] };
let ty = if let (true, &ty::TyRef(_, ty, _)) = (decl.by_ref, &ty.sty) {
ty
@@ -595,7 +617,7 @@ fn arg_local_refs(
};
let variable_access = VariableAccess::IndirectVariable {
- alloca: place.llval,
+ alloca: env_ptr,
address_operations: &ops
};
declare_local(
--
2.17.1

View File

@ -63,7 +63,7 @@
Name: rust
Version: %{rustc_version}
Release: 0.1.beta.4%{?dist}
Release: 0.1.beta.7%{?dist}
Summary: The Rust Programming Language
License: (ASL 2.0 or MIT) and (BSD and MIT)
# ^ written as: (rust itself) and (bundled libraries)
@ -80,19 +80,19 @@ Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz
# https://github.com/rust-lang/rust/pull/52876
Patch1: rust-52876-const-endianess.patch
# https://github.com/rust-lang/rust/pull/53239
Patch2: 0001-rustc_codegen_llvm-Restore-the-closure-env-alloca-ha.patch
# https://github.com/alexcrichton/backtrace-rs/pull/122
# https://github.com/rust-lang/rust/pull/53377
Patch3: 0001-backtrace-sys-Use-target_pointer_width-for-BACKTRACE.patch
Patch4: 0001-std-Use-target_pointer_width-for-BACKTRACE_ELF_SIZE.patch
Patch2: 0001-backtrace-sys-Use-target_pointer_width-for-BACKTRACE.patch
Patch3: 0001-std-Use-target_pointer_width-for-BACKTRACE_ELF_SIZE.patch
# https://github.com/rust-lang/rust/pull/53436
Patch5: 0001-std-stop-backtracing-when-the-frames-are-full.patch
Patch4: 0001-std-stop-backtracing-when-the-frames-are-full.patch
# https://github.com/rust-lang/rust/pull/53437
Patch6: 0001-Set-more-llvm-function-attributes-for-__rust_try.patch
Patch5: 0001-Set-more-llvm-function-attributes-for-__rust_try.patch
# https://github.com/rust-lang/rust/pull/52969
Patch6: 0001-rustbuild-fix-local_rebuild.patch
# Get the Rust triple for any arch.
%{lua: function rust_triple(arch)
@ -332,7 +332,7 @@ Version: %{cargo_version}
BuildArch: noarch
# Cargo no longer builds its own documentation
# https://github.com/rust-lang/cargo/pull/4904
Requires: rust-doc
Requires: rust-doc = %{rustc_version}-%{release}
%description -n cargo-doc
This package includes HTML documentation for Cargo.
@ -418,10 +418,10 @@ test -f '%{local_rust_root}/bin/rustc'
%setup -q -n %{rustc_package}
%patch1 -p1
%patch2 -p1
pushd src/vendor/backtrace-sys
%patch3 -p2
%patch2 -p2
popd
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
@ -572,25 +572,8 @@ mkdir -p %{buildroot}%{_datadir}/cargo/registry
# Cargo no longer builds its own documentation
# https://github.com/rust-lang/cargo/pull/4904
mkdir -p %{buildroot}%{_docdir}/cargo/html
cat <<EOF > %{buildroot}%{_docdir}/cargo/html/index.html
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="0; url=../../rust/html/cargo/index.html">
<script type="text/javascript">
window.location.href = "../../rust/html/cargo/index.html"
</script>
<title>cargo-doc redirection</title>
</head>
<body>
Cargo documentation has been moved to the rust-doc package.
If you are not redirected automatically, please follow this
<a href="../../rust/html/cargo/index.html">link</a>.
</body>
</html>
EOF
mkdir -p %{buildroot}%{_docdir}/cargo
ln -sT ../rust/html/cargo/ %{buildroot}%{_docdir}/cargo/html
%if %without lldb
rm -f %{buildroot}%{_bindir}/rust-lldb
@ -680,6 +663,8 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py*
%files -n cargo-doc
%docdir %{_docdir}/cargo
%dir %{_docdir}/cargo
%{_docdir}/cargo/html
@ -713,6 +698,9 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py*
%changelog
* Thu Aug 30 2018 Josh Stone <jistone@redhat.com> - 1.29.0-0.1.beta.7
- beta test
* Thu Aug 16 2018 Josh Stone <jistone@redhat.com> - 1.29.0-0.1.beta.4
- beta test
- Add a clippy-preview subpackage