Update to 1.11.0.

- Drop the backported patches.
- Patch get-stage0.py to trust existing bootstrap binaries.
- Use libclang_rt.builtins from compiler-rt, dodging llvm-static issues.
- Use --local-rust-root to make sure the right bootstrap is used.
This commit is contained in:
Josh Stone 2016-08-24 00:47:10 -07:00
parent 5529092afe
commit ba0dc4eb0b
7 changed files with 55 additions and 247 deletions

3
.gitignore vendored
View File

@ -1,3 +1,6 @@
/rustc-1.10.0-src.tar.gz
/rustc-1.9.0-i686-unknown-linux-gnu.tar.gz
/rustc-1.9.0-x86_64-unknown-linux-gnu.tar.gz
/rustc-1.11.0-src.tar.gz
/rustc-1.10.0-i686-unknown-linux-gnu.tar.gz
/rustc-1.10.0-x86_64-unknown-linux-gnu.tar.gz

View File

@ -0,0 +1,14 @@
--- rustc-1.11.0/src/etc/get-stage0.py.no-download 2016-08-24 00:34:03.561598809 -0700
+++ rustc-1.11.0/src/etc/get-stage0.py 2016-08-24 00:34:08.636555684 -0700
@@ -31,9 +31,8 @@ def main(triple):
filename = 'rustc-{}-{}.tar.gz'.format(channel, triple)
url = 'https://static.rust-lang.org/dist/{}/{}'.format(date, filename)
dst = dl_dir + '/' + filename
- if os.path.exists(dst):
- os.unlink(dst)
- bootstrap.get(url, dst)
+ if not os.path.exists(dst):
+ bootstrap.get(url, dst)
stage0_dst = triple + '/stage0'
if os.path.exists(stage0_dst):

View File

@ -1,30 +0,0 @@
commit a3736a0a1907cbc8bf619708738815a5fd789c80 (from 4638c60dedfa581fd5fa7c6420d8f32274c9ca0b)
Merge: 4638c60dedfa 2c3e600653f4
Author: Alex Crichton <alex@alexcrichton.com>
Date: Tue May 31 10:51:47 2016 -0700
Merge pull request #6 from intelfx/patch-1
document.c: fix trigger of -Werror=misleading-indentation
diff --git a/src/document.c b/src/document.c
index e2731dab41a2..8cd7315b418c 100644
--- a/src/document.c
+++ b/src/document.c
@@ -1154,13 +1154,13 @@ char_link(hoedown_buffer *ob, hoedown_document *doc, uint8_t *data, size_t offse
while (i < size) {
if (data[i] == '\\') i += 2;
else if (data[i] == '(' && i != 0) {
- nb_p++; i++;
+ nb_p++;
}
else if (data[i] == ')') {
if (nb_p == 0) break;
- else nb_p--; i++;
+ else nb_p--;
} else if (i >= 1 && _isspace(data[i-1]) && (data[i] == '\'' || data[i] == '"')) break;
- else i++;
+ i++;
}
if (i >= size) goto cleanup;

View File

@ -1,134 +0,0 @@
commit dd6e8d45e183861d44ed91a99f0a50403b2776a3 (from 57ef015132ec09345b88d2ec20a9d9809b5d3dfc)
Merge: 57ef015132ec 0ca7d3dc1ffd
Author: bors <bors@rust-lang.org>
Date: Mon May 23 20:02:23 2016 -0700
Auto merge of #33787 - cuviper:local-rebuild, r=alexcrichton
Add --enable-local-rebuild to bootstrap from the current release
In Linux distributions, it is often necessary to rebuild packages for cases like applying new patches or linking against new system libraries. In this scenario, the rustc in the distro build environment may already match the current release that we're trying to rebuild. Thus we don't want to use the prior release's bootstrap key, nor `--cfg stage0` for the prior unstable features.
The new `configure --enable-local-rebuild` option specifies that we are rebuilding from the current release. The current bootstrap key is used for the local rustc, and current stage1 features are also assumed. Both the makefiles and rustbuild support this configuration.
Fixes #29556
r? @alexcrichton
diff --git a/configure b/configure
index 38f3e3b00c6d..b7053c5c54f5 100755
--- a/configure
+++ b/configure
@@ -599,6 +599,7 @@ opt debug-assertions 0 "build with debugging assertions"
opt fast-make 0 "use .gitmodules as timestamp for submodule deps"
opt ccache 0 "invoke gcc/clang via ccache to reuse object files between builds"
opt local-rust 0 "use an installed rustc rather than downloading a snapshot"
+opt local-rebuild 0 "use an installed rustc matching the current version, for rebuilds"
opt llvm-static-stdcpp 0 "statically link to libstdc++ for LLVM"
opt rpath 1 "build rpaths into rustc itself"
opt stage0-landing-pads 1 "enable landing pads during bootstrap with stage0"
@@ -847,6 +848,16 @@ then
BIN_SUF=.exe
fi
+# --enable-local-rebuild implies --enable-local-rust too
+if [ -n "$CFG_ENABLE_LOCAL_REBUILD" ]
+then
+ if [ -z "$CFG_ENABLE_LOCAL_RUST" ]
+ then
+ CFG_ENABLE_LOCAL_RUST=1
+ putvar CFG_ENABLE_LOCAL_RUST
+ fi
+fi
+
if [ -n "$CFG_ENABLE_LOCAL_RUST" ]
then
system_rustc=$(which rustc)
diff --git a/mk/main.mk b/mk/main.mk
index 493b61051331..6feb53ec7b17 100644
--- a/mk/main.mk
+++ b/mk/main.mk
@@ -34,7 +34,14 @@ CFG_FILENAME_EXTRA=$(shell printf '%s' $(CFG_RELEASE)$(CFG_EXTRA_FILENAME) | $(C
# intentionally not "secure" by any definition, this is largely just a deterrent
# from users enabling unstable features on the stable compiler.
CFG_BOOTSTRAP_KEY=$(CFG_FILENAME_EXTRA)
+
+# The stage0 compiler needs to use the previous key recorded in src/stage0.txt,
+# except for local-rebuild when it just uses the same current key.
+ifdef CFG_ENABLE_LOCAL_REBUILD
+CFG_BOOTSTRAP_KEY_STAGE0=$(CFG_BOOTSTRAP_KEY)
+else
CFG_BOOTSTRAP_KEY_STAGE0=$(shell grep 'rustc_key' $(S)src/stage0.txt | sed 's/rustc_key: '//)
+endif
ifeq ($(CFG_RELEASE_CHANNEL),stable)
# This is the normal semver version string, e.g. "0.12.0", "0.12.0-nightly"
@@ -526,6 +533,11 @@ ifneq ($(strip $(CFG_BUILD)),$(strip $(3)))
CFGFLAG$(1)_T_$(2)_H_$(3) = stage1
RPATH_VAR$(1)_T_$(2)_H_$(3) := $$(TARGET_RPATH_VAR1_T_$(2)_H_$$(CFG_BUILD))
+else
+ifdef CFG_ENABLE_LOCAL_REBUILD
+# Assume the local-rebuild rustc already has stage1 features too.
+CFGFLAG$(1)_T_$(2)_H_$(3) = stage1
+endif
endif
endif
diff --git a/src/bootstrap/build/config.rs b/src/bootstrap/build/config.rs
index 3c35b9a95169..fb1ad12d914f 100644
--- a/src/bootstrap/build/config.rs
+++ b/src/bootstrap/build/config.rs
@@ -67,6 +67,7 @@ pub struct Config {
pub target: Vec<String>,
pub rustc: Option<String>,
pub cargo: Option<String>,
+ pub local_rebuild: bool,
// libstd features
pub debug_jemalloc: bool,
@@ -315,6 +316,7 @@ impl Config {
("RPATH", self.rust_rpath),
("OPTIMIZE_TESTS", self.rust_optimize_tests),
("DEBUGINFO_TESTS", self.rust_debuginfo_tests),
+ ("LOCAL_REBUILD", self.local_rebuild),
}
match key {
diff --git a/src/bootstrap/build/mod.rs b/src/bootstrap/build/mod.rs
index ebc05c5f61c5..21d12d27d92e 100644
--- a/src/bootstrap/build/mod.rs
+++ b/src/bootstrap/build/mod.rs
@@ -510,6 +510,14 @@ impl Build {
.arg("-j").arg(self.jobs().to_string())
.arg("--target").arg(target);
+ let stage;
+ if compiler.stage == 0 && self.config.local_rebuild {
+ // Assume the local-rebuild rustc already has stage1 features.
+ stage = 1;
+ } else {
+ stage = compiler.stage;
+ }
+
// Customize the compiler we're running. Specify the compiler to cargo
// as our shim and then pass it some various options used to configure
// how the actual compiler itself is called.
@@ -518,7 +526,7 @@ impl Build {
// src/bootstrap/{rustc,rustdoc.rs}
cargo.env("RUSTC", self.out.join("bootstrap/debug/rustc"))
.env("RUSTC_REAL", self.compiler_path(compiler))
- .env("RUSTC_STAGE", compiler.stage.to_string())
+ .env("RUSTC_STAGE", stage.to_string())
.env("RUSTC_DEBUGINFO", self.config.rust_debuginfo.to_string())
.env("RUSTC_CODEGEN_UNITS",
self.config.rust_codegen_units.to_string())
@@ -744,7 +752,7 @@ impl Build {
// In stage0 we're using a previously released stable compiler, so we
// use the stage0 bootstrap key. Otherwise we use our own build's
// bootstrap key.
- let bootstrap_key = if compiler.is_snapshot(self) {
+ let bootstrap_key = if compiler.is_snapshot(self) && !self.config.local_rebuild {
&self.bootstrap_key_stage0
} else {
&self.bootstrap_key

View File

@ -1,58 +0,0 @@
commit 7bddce693cec4ae4eb6970ed91289815b316cff3 (from 17b6261cc41343b1f2b611ca12f1ccd2d4306ee5)
Merge: 17b6261cc413 6e9774f4bb70
Author: bors <bors@rust-lang.org>
Date: Fri May 27 14:49:10 2016 -0700
Auto merge of #33798 - locallycompact:lc/misleading-intentation, r=alexcrichton
Fix misleading intentation errors on gcc 6.0
Currently building with latest gcc results in the following error:
compile: x86_64-unknown-linux-gnu/rt/miniz.o
/home/lc/rust/src/rt/miniz.c: In function tinfl_decompress:
/home/lc/rust/src/rt/miniz.c:578:9: error: this for clause does not guard... [-Werror=misleading-indentation]
for ( i = 0; i <= 143; ++i) *p++ = 8; for ( ; i <= 255; ++i) *p++ = 9; for ( ; i <= 279; ++i) *p++ = 7; for ( ; i <= 287; ++i) *p++ = 8;
^~~
/home/lc/rust/src/rt/miniz.c:578:47: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the for
for ( i = 0; i <= 143; ++i) *p++ = 8; for ( ; i <= 255; ++i) *p++ = 9; for ( ; i <= 279; ++i) *p++ = 7; for ( ; i <= 287; ++i) *p++ = 8;
^~~
/home/lc/rust/src/rt/miniz.c: In function tdefl_find_match:
/home/lc/rust/src/rt/miniz.c:1396:5: error: this if clause does not guard... [-Werror=misleading-indentation]
if (!dist) break; p = s; q = d->m_dict + probe_pos; for (probe_len = 0; probe_len < max_match_len; probe_len++) if (*p++ != *q++) break;
^~
/home/lc/rust/src/rt/miniz.c:1396:23: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the if
if (!dist) break; p = s; q = d->m_dict + probe_pos; for (probe_len = 0; probe_len < max_match_len; probe_len++) if (*p++ != *q++) break;
^
This patch stops this.
diff --git a/src/rt/miniz.c b/src/rt/miniz.c
index 2b803b06d099..2daca9378a4a 100644
--- a/src/rt/miniz.c
+++ b/src/rt/miniz.c
@@ -575,7 +575,10 @@ tinfl_status tinfl_decompress(tinfl_decompressor *r, const mz_uint8 *pIn_buf_nex
{
mz_uint8 *p = r->m_tables[0].m_code_size; mz_uint i;
r->m_table_sizes[0] = 288; r->m_table_sizes[1] = 32; TINFL_MEMSET(r->m_tables[1].m_code_size, 5, 32);
- for ( i = 0; i <= 143; ++i) *p++ = 8; for ( ; i <= 255; ++i) *p++ = 9; for ( ; i <= 279; ++i) *p++ = 7; for ( ; i <= 287; ++i) *p++ = 8;
+ for ( i = 0; i <= 143; ++i) *p++ = 8;
+ for ( ; i <= 255; ++i) *p++ = 9;
+ for ( ; i <= 279; ++i) *p++ = 7;
+ for ( ; i <= 287; ++i) *p++ = 8;
}
else
{
@@ -1393,7 +1396,10 @@ static MZ_FORCEINLINE void tdefl_find_match(tdefl_compressor *d, mz_uint lookahe
if ((d->m_dict[probe_pos + match_len] == c0) && (d->m_dict[probe_pos + match_len - 1] == c1)) break;
TDEFL_PROBE; TDEFL_PROBE; TDEFL_PROBE;
}
- if (!dist) break; p = s; q = d->m_dict + probe_pos; for (probe_len = 0; probe_len < max_match_len; probe_len++) if (*p++ != *q++) break;
+ if (!dist) break;
+ p = s; q = d->m_dict + probe_pos;
+ for (probe_len = 0; probe_len < max_match_len; probe_len++)
+ if (*p++ != *q++) break;
if (probe_len > match_len)
{
*pMatch_dist = dist; if ((*pMatch_len = match_len = probe_len) == max_match_len) return;

View File

@ -5,22 +5,24 @@
# e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24
# or nightly wants some beta-YYYY-MM-DD
%bcond_with bootstrap
%global bootstrap_channel 1.9.0
%global bootstrap_date 2016-05-24
%global bootstrap_channel 1.10.0
%global bootstrap_date 2016-07-05
# Use "rebuild" when building with a distro rustc of the same version.
# Turn this off when the distro has the prior release, matching bootstrap.
%bcond_without rebuild
# Note, 1.12 will be able to autodetect this via PR34779.
%bcond_with rebuild
# The script for minidebuginfo copies symbols and *notes* into a "mini"
# ELF object compressed into the .gnu_debugdata section. This includes our
# relatively large .note.rustc metadata, bloating every library. Eventually
# that metadata should be stripped beforehand -- see rust #23366 and #26764.
# Note, 1.12 will move to unallocated data via PR35409, then can be stripped.
%undefine _include_minidebuginfo
Name: rust
Version: 1.10.0
Release: 4%{?dist}
Version: 1.11.0
Release: 1%{?dist}
Summary: The Rust Programming Language
License: (ASL 2.0 or MIT) and (BSD and ISC and MIT)
# ^ written as: (rust itself) and (bundled libraries)
@ -48,19 +50,10 @@ ExclusiveArch: x86_64 i686
%ifarch armv7hl
%global rust_triple armv7-unknown-linux-gnueabihf
%else
%define rust_triple %{_target_cpu}-unknown-linux-gnu
%global rust_triple %{_target_cpu}-unknown-linux-gnu
%endif
# merged for 1.11.0: https://github.com/rust-lang/rust/pull/33787
Patch1: rust-pr33787-enable-local-rebuild.patch
# merged for 1.11.0: https://github.com/rust-lang/rust/pull/33798
Patch2: rust-pr33798-miniz-misleading-indentation.patch
# merged for 1.11.0: https://github.com/rust-lang/hoedown/pull/6
# via https://github.com/rust-lang/rust/pull/33988
# (but eventually we should ditch this bundled hoedown)
Patch3: rust-hoedown-pr6-misleading-indentation.patch
Patch1: rust-1.11.0-no-bootstrap-download.patch
BuildRequires: make
BuildRequires: cmake
@ -84,8 +77,18 @@ BuildRequires: %{name} >= %{bootstrap_channel}
# make check: src/test/run-pass/wait-forked-but-failed-child.rs
BuildRequires: /usr/bin/ps
# TODO: work on unbundling these!
# Rust started using cmake for its bundled compiler-rt, but this requires
# llvm-static to be installed. But then llvm-config starts printing flags
# for static linkage, with no way to force it shared.
#
# For now, we'll bypass all that and just use the distro build. Then in the
# next release, Rust is moving toward a true fork of these builtins, with the
# eventual goal of rewriting them in Rust proper.
BuildRequires: compiler-rt
Provides: bundled(compiler-rt) = 3.8
%global clang_builtins %{_libdir}/clang/3.8.0/lib/libclang_rt.builtins-%{_target_cpu}.a
# TODO: work on unbundling these!
Provides: bundled(hoedown) = 3.0.5
Provides: bundled(jquery) = 2.1.4
Provides: bundled(libbacktrace) = 6.1.0
@ -138,12 +141,11 @@ its standard library.
%prep
%setup -q -n %{rustc_package}
%patch1 -p1 -b .rebuild
%patch2 -p1 -b .miniz-indent
%patch3 -p1 -d src/rt/hoedown/ -b .hoedown-indent
%patch1 -p1 -b .no-download
# unbundle
rm -rf src/llvm/ src/jemalloc/
rm -rf src/compiler-rt/
# extract bundled licenses for packaging
cp src/rt/hoedown/LICENSE src/rt/hoedown/LICENSE-hoedown
@ -178,12 +180,16 @@ cp -t dl/ %{SOURCE1} %{SOURCE2} # %{SOURCE3} %{SOURCE4}
%build
%configure --disable-option-checking \
--build=%{rust_triple} --host=%{rust_triple} --target=%{rust_triple} \
%{!?with_bootstrap:--enable-local-rust %{?with_rebuild:--enable-local-rebuild}} \
--llvm-root=/usr --disable-codegen-tests \
%{!?with_bootstrap:--enable-local-rust --local-rust-root=%{_prefix} %{?with_rebuild:--enable-local-rebuild}} \
--llvm-root=%{_prefix} --disable-codegen-tests \
--disable-jemalloc \
--disable-rpath \
--enable-debuginfo \
--release-channel=%{channel}
# Bypass the compiler-rt build -- see above.
cp %{clang_builtins} ./%{rust_triple}/rt/libcompiler-rt.a
%make_build VERBOSE=1
@ -259,6 +265,13 @@ make check-lite VERBOSE=1 -k || echo "make check-lite exited with code $?"
%changelog
* Wed Aug 24 2016 Josh Stone <jistone@redhat.com> - 1.11.0-1
- Update to 1.11.0.
- Drop the backported patches.
- Patch get-stage0.py to trust existing bootstrap binaries.
- Use libclang_rt.builtins from compiler-rt, dodging llvm-static issues.
- Use --local-rust-root to make sure the right bootstrap is used.
* Sat Aug 13 2016 Josh Stone <jistone@redhat.com> 1.10.0-4
- Rebuild without bootstrap binaries.

View File

@ -1,3 +1,3 @@
a48fef30353fc9daa70b484b690ce5db rustc-1.10.0-src.tar.gz
287d0f4838afa56abfab6be0805cf07a rustc-1.9.0-i686-unknown-linux-gnu.tar.gz
f1cf6d2fe15e4be18a08259f1540a4ae rustc-1.9.0-x86_64-unknown-linux-gnu.tar.gz
bdbd8fa629208c94496adf40c68746a9 rustc-1.11.0-src.tar.gz
059dbecdf8a7360f04450487a19be863 rustc-1.10.0-i686-unknown-linux-gnu.tar.gz
eb49a590e9c30f77bb15741488ef2c2f rustc-1.10.0-x86_64-unknown-linux-gnu.tar.gz