Skip to content

Commit 741158b

Browse files
committed
---
yaml --- r: 273085 b: refs/heads/beta c: c21644a h: refs/heads/master i: 273083: daf1285
1 parent 0279117 commit 741158b

File tree

487 files changed

+9134
-7727
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

487 files changed

+9134
-7727
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: bdc176ef6b3909270c187235af657a89e4f2aeec
26+
refs/heads/beta: c21644ad162c69da7c883812be3e473c4e64c257
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ build.
7777
7878
Download [MinGW from
7979
here](http://mingw-w64.org/doku.php/download/mingw-builds), and choose the
80-
`threads=win32,exceptions=dwarf/seh` flavor when installing. After installing,
80+
`threads=win32,exceptions=dwarf/seh` flavor when installing. Also, make sure to install to a path without spaces in it. After installing,
8181
add its `bin` directory to your `PATH`. This is due to [#28260](https://github.com/rust-lang/rust/issues/28260), in the future,
8282
installing from pacman should be just fine.
8383
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# i586-pc-windows-msvc configuration
2+
CC_i586-pc-windows-msvc="$(CFG_MSVC_CL_i386)" -nologo
3+
LINK_i586-pc-windows-msvc="$(CFG_MSVC_LINK_i386)" -nologo
4+
CXX_i586-pc-windows-msvc="$(CFG_MSVC_CL_i386)" -nologo
5+
CPP_i586-pc-windows-msvc="$(CFG_MSVC_CL_i386)" -nologo
6+
AR_i586-pc-windows-msvc="$(CFG_MSVC_LIB_i386)" -nologo
7+
CFG_LIB_NAME_i586-pc-windows-msvc=$(1).dll
8+
CFG_STATIC_LIB_NAME_i586-pc-windows-msvc=$(1).lib
9+
CFG_LIB_GLOB_i586-pc-windows-msvc=$(1)-*.{dll,lib}
10+
CFG_LIB_DSYM_GLOB_i586-pc-windows-msvc=$(1)-*.dylib.dSYM
11+
CFG_JEMALLOC_CFLAGS_i586-pc-windows-msvc :=
12+
CFG_GCCISH_CFLAGS_i586-pc-windows-msvc := -MD -arch:IA32
13+
CFG_GCCISH_CXXFLAGS_i586-pc-windows-msvc := -MD -arch:IA32
14+
CFG_GCCISH_LINK_FLAGS_i586-pc-windows-msvc :=
15+
CFG_GCCISH_DEF_FLAG_i586-pc-windows-msvc :=
16+
CFG_LLC_FLAGS_i586-pc-windows-msvc :=
17+
CFG_INSTALL_NAME_i586-pc-windows-msvc =
18+
CFG_EXE_SUFFIX_i586-pc-windows-msvc := .exe
19+
CFG_WINDOWSY_i586-pc-windows-msvc := 1
20+
CFG_UNIXY_i586-pc-windows-msvc :=
21+
CFG_LDPATH_i586-pc-windows-msvc :=
22+
CFG_RUN_i586-pc-windows-msvc=$(2)
23+
CFG_RUN_TARG_i586-pc-windows-msvc=$(call CFG_RUN_i586-pc-windows-msvc,,$(2))
24+
CFG_GNU_TRIPLE_i586-pc-windows-msvc := i586-pc-win32
25+
26+
# Currently the build system is not configured to build jemalloc
27+
# with MSVC, so we omit this optional dependency.
28+
CFG_DISABLE_JEMALLOC_i586-pc-windows-msvc := 1

branches/beta/mk/cfg/i686-pc-windows-gnu.mk

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,3 @@ CFG_GNU_TRIPLE_i686-pc-windows-gnu := i686-w64-mingw32
2525
CFG_THIRD_PARTY_OBJECTS_i686-pc-windows-gnu := crt2.o dllcrt2.o
2626
CFG_INSTALLED_OBJECTS_i686-pc-windows-gnu := crt2.o dllcrt2.o rsbegin.o rsend.o
2727
CFG_RUSTRT_HAS_STARTUP_OBJS_i686-pc-windows-gnu := 1
28-
# FIXME(#31030) - there's not a great reason to disable jemalloc here
29-
CFG_DISABLE_JEMALLOC_i686-pc-windows-gnu := 1

branches/beta/mk/cfg/x86_64-pc-windows-gnu.mk

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,3 @@ CFG_GNU_TRIPLE_x86_64-pc-windows-gnu := x86_64-w64-mingw32
2525
CFG_THIRD_PARTY_OBJECTS_x86_64-pc-windows-gnu := crt2.o dllcrt2.o
2626
CFG_INSTALLED_OBJECTS_x86_64-pc-windows-gnu := crt2.o dllcrt2.o rsbegin.o rsend.o
2727
CFG_RUSTRT_HAS_STARTUP_OBJS_x86_64-pc-windows-gnu := 1
28-
# FIXME(#31030) - there's not a great reason to disable jemalloc here
29-
CFG_DISABLE_JEMALLOC_x86_64-pc-windows-gnu := 1

branches/beta/mk/crates.mk

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,17 @@
4949
# automatically generated for all stage/host/target combinations.
5050
################################################################################
5151

52-
TARGET_CRATES := libc std flate arena term \
53-
serialize getopts collections test rand \
54-
log graphviz core rbml alloc \
52+
TARGET_CRATES := libc std term \
53+
getopts collections test rand \
54+
core alloc \
5555
rustc_unicode rustc_bitflags \
5656
alloc_system alloc_jemalloc
5757
RUSTC_CRATES := rustc rustc_typeck rustc_mir rustc_borrowck rustc_resolve rustc_driver \
5858
rustc_trans rustc_back rustc_llvm rustc_privacy rustc_lint \
5959
rustc_data_structures rustc_front rustc_platform_intrinsics \
6060
rustc_plugin rustc_metadata rustc_passes
61-
HOST_CRATES := syntax syntax_ext $(RUSTC_CRATES) rustdoc fmt_macros
61+
HOST_CRATES := syntax syntax_ext $(RUSTC_CRATES) rustdoc fmt_macros \
62+
flate arena graphviz rbml log serialize
6263
TOOLS := compiletest rustdoc rustc rustbook error_index_generator
6364

6465
DEPS_core :=
@@ -84,10 +85,10 @@ DEPS_log := std
8485
DEPS_num := std
8586
DEPS_rbml := std log serialize
8687
DEPS_serialize := std log
87-
DEPS_term := std log
88-
DEPS_test := std getopts serialize rbml term native:rust_test_helpers
88+
DEPS_term := std
89+
DEPS_test := std getopts term native:rust_test_helpers
8990

90-
DEPS_syntax := std term serialize log arena libc rustc_bitflags
91+
DEPS_syntax := std term serialize log arena libc rustc_bitflags rustc_unicode
9192
DEPS_syntax_ext := syntax fmt_macros
9293

9394
DEPS_rustc := syntax fmt_macros flate arena serialize getopts rbml rustc_front\
@@ -125,8 +126,8 @@ TOOL_DEPS_error_index_generator := rustdoc syntax serialize
125126
TOOL_SOURCE_compiletest := $(S)src/compiletest/compiletest.rs
126127
TOOL_SOURCE_rustdoc := $(S)src/driver/driver.rs
127128
TOOL_SOURCE_rustc := $(S)src/driver/driver.rs
128-
TOOL_SOURCE_rustbook := $(S)src/rustbook/main.rs
129-
TOOL_SOURCE_error_index_generator := $(S)src/error_index_generator/main.rs
129+
TOOL_SOURCE_rustbook := $(S)src/tools/rustbook/main.rs
130+
TOOL_SOURCE_error_index_generator := $(S)src/tools/error_index_generator/main.rs
130131

131132
ONLY_RLIB_core := 1
132133
ONLY_RLIB_libc := 1

branches/beta/mk/dist.mk

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ PKG_FILES := \
5454
doc \
5555
driver \
5656
etc \
57-
error_index_generator \
5857
$(foreach crate,$(CRATES),lib$(crate)) \
5958
libcollectionstest \
6059
libcoretest \
@@ -65,7 +64,7 @@ PKG_FILES := \
6564
rustc \
6665
snapshots.txt \
6766
rust-installer \
68-
rustbook \
67+
tools \
6968
test) \
7069
$(PKG_GITMODULES) \
7170
$(filter-out config.stamp, \

branches/beta/mk/rt.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ COMPRT_AR_$(1) := $$(AR_$(1))
253253
# We chomp -Werror here because GCC warns about the type signature of
254254
# builtins not matching its own and the build fails. It's a bit hacky,
255255
# but what can we do, we're building libclang-rt using GCC ......
256-
COMPRT_CFLAGS_$(1) := $$(filter-out -Werror -Werror=*,$$(CFG_GCCISH_CFLAGS_$(1))) -std=c99
256+
COMPRT_CFLAGS_$(1) := $$(CFG_GCCISH_CFLAGS_$(1)) -Wno-error -std=c99
257257

258258
# FreeBSD Clang's packaging is problematic; it doesn't copy unwind.h to
259259
# the standard include directory. This should really be in our changes to
@@ -361,7 +361,7 @@ $$(BACKTRACE_BUILD_DIR_$(1))/Makefile: $$(BACKTRACE_DEPS) $$(MKFILE_DEPS)
361361
CC="$$(CC_$(1))" \
362362
AR="$$(AR_$(1))" \
363363
RANLIB="$$(AR_$(1)) s" \
364-
CFLAGS="$$(CFG_GCCISH_CFLAGS_$(1):-Werror=) -fno-stack-protector" \
364+
CFLAGS="$$(CFG_GCCISH_CFLAGS_$(1)) -Wno-error -fno-stack-protector" \
365365
$(S)src/libbacktrace/configure --build=$(CFG_GNU_TRIPLE_$(CFG_BUILD)) --host=$(CFG_GNU_TRIPLE_$(1)))
366366
$$(Q)echo '#undef HAVE_ATOMIC_FUNCTIONS' >> \
367367
$$(BACKTRACE_BUILD_DIR_$(1))/config.h

branches/beta/mk/tests.mk

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -299,9 +299,6 @@ check-stage$(1)-T-$(2)-H-$(3)-exec: \
299299
check-stage$(1)-T-$(2)-H-$(3)-cfail-exec \
300300
check-stage$(1)-T-$(2)-H-$(3)-pfail-exec \
301301
check-stage$(1)-T-$(2)-H-$(3)-rpass-valgrind-exec \
302-
check-stage$(1)-T-$(2)-H-$(3)-rpass-full-exec \
303-
check-stage$(1)-T-$(2)-H-$(3)-rfail-full-exec \
304-
check-stage$(1)-T-$(2)-H-$(3)-cfail-full-exec \
305302
check-stage$(1)-T-$(2)-H-$(3)-rmake-exec \
306303
check-stage$(1)-T-$(2)-H-$(3)-rustdocck-exec \
307304
check-stage$(1)-T-$(2)-H-$(3)-crates-exec \
@@ -317,6 +314,15 @@ check-stage$(1)-T-$(2)-H-$(3)-exec: \
317314
# able to build a compiler (when the target triple is in the set of host triples)
318315
ifneq ($$(findstring $(2),$$(CFG_HOST)),)
319316

317+
check-stage$(1)-T-$(2)-H-$(3)-exec: \
318+
check-stage$(1)-T-$(2)-H-$(3)-rpass-full-exec \
319+
check-stage$(1)-T-$(2)-H-$(3)-rfail-full-exec \
320+
check-stage$(1)-T-$(2)-H-$(3)-cfail-full-exec
321+
322+
check-stage$(1)-T-$(2)-H-$(3)-pretty-exec: \
323+
check-stage$(1)-T-$(2)-H-$(3)-pretty-rpass-full-exec \
324+
check-stage$(1)-T-$(2)-H-$(3)-pretty-rfail-full-exec
325+
320326
check-stage$(1)-T-$(2)-H-$(3)-crates-exec: \
321327
$$(foreach crate,$$(TEST_CRATES), \
322328
check-stage$(1)-T-$(2)-H-$(3)-$$(crate)-exec)
@@ -340,9 +346,7 @@ check-stage$(1)-T-$(2)-H-$(3)-doc-exec: \
340346
check-stage$(1)-T-$(2)-H-$(3)-pretty-exec: \
341347
check-stage$(1)-T-$(2)-H-$(3)-pretty-rpass-exec \
342348
check-stage$(1)-T-$(2)-H-$(3)-pretty-rpass-valgrind-exec \
343-
check-stage$(1)-T-$(2)-H-$(3)-pretty-rpass-full-exec \
344349
check-stage$(1)-T-$(2)-H-$(3)-pretty-rfail-exec \
345-
check-stage$(1)-T-$(2)-H-$(3)-pretty-rfail-full-exec \
346350
check-stage$(1)-T-$(2)-H-$(3)-pretty-pretty-exec
347351

348352
endef

branches/beta/src/bootstrap/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ path = "main.rs"
1515
name = "rustc"
1616
path = "rustc.rs"
1717

18+
[[bin]]
19+
name = "rustdoc"
20+
path = "rustdoc.rs"
21+
1822
[dependencies]
1923
build_helper = { path = "../build_helper" }
2024
cmake = "0.1.10"

branches/beta/src/bootstrap/bootstrap.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ def download_rust_nightly(self):
7373

7474
if self.rustc().startswith(self.bin_root()) and \
7575
(not os.path.exists(self.rustc()) or self.rustc_out_of_date()):
76-
shutil.rmtree(self.bin_root())
76+
if os.path.exists(self.bin_root()):
77+
shutil.rmtree(self.bin_root())
7778
filename = "rust-std-nightly-" + self.build + ".tar.gz"
7879
url = "https://static.rust-lang.org/dist/" + self.snap_rustc_date()
7980
tarball = os.path.join(rustc_cache, filename)
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
use std::process::Command;
12+
13+
use build::{Build, Compiler};
14+
15+
pub fn linkcheck(build: &Build, stage: u32, host: &str) {
16+
println!("Linkcheck stage{} ({})", stage, host);
17+
let compiler = Compiler::new(stage, host);
18+
let linkchecker = build.tool(&compiler, "linkchecker");
19+
build.run(Command::new(&linkchecker)
20+
.arg(build.out.join(host).join("doc")));
21+
}

branches/beta/src/bootstrap/build/compile.rs

Lines changed: 50 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use std::process::Command;
1616
use build_helper::output;
1717

1818
use build::util::{exe, staticlib, libdir, mtime, is_dylib};
19-
use build::{Build, Compiler};
19+
use build::{Build, Compiler, Mode};
2020

2121
/// Build the standard library.
2222
///
@@ -39,9 +39,10 @@ pub fn std<'a>(build: &'a Build, stage: u32, target: &str,
3939

4040
build_startup_objects(build, target, &libdir);
4141

42-
let out_dir = build.cargo_out(stage, &host, true, target);
42+
let out_dir = build.cargo_out(stage, &host, Mode::Libstd, target);
4343
build.clear_if_dirty(&out_dir, &build.compiler_path(compiler));
44-
let mut cargo = build.cargo(stage, compiler, true, target, "build");
44+
let mut cargo = build.cargo(stage, compiler, Mode::Libstd, Some(target),
45+
"build");
4546
cargo.arg("--features").arg(build.std_features())
4647
.arg("--manifest-path")
4748
.arg(build.src.join("src/rustc/std_shim/Cargo.toml"));
@@ -71,7 +72,7 @@ pub fn std_link(build: &Build,
7172
compiler: &Compiler,
7273
host: &str) {
7374
let libdir = build.sysroot_libdir(stage, host, target);
74-
let out_dir = build.cargo_out(stage, compiler.host, true, target);
75+
let out_dir = build.cargo_out(stage, compiler.host, Mode::Libstd, target);
7576

7677
// If we're linking one compiler host's output into another, then we weren't
7778
// called from the `std` method above. In that case we clean out what's
@@ -83,6 +84,19 @@ pub fn std_link(build: &Build,
8384
libdir.join(staticlib("compiler-rt", target))));
8485
}
8586
add_to_sysroot(&out_dir, &libdir);
87+
88+
if target.contains("musl") && (target.contains("x86_64") || target.contains("i686")) {
89+
copy_third_party_objects(build, target, &libdir);
90+
}
91+
}
92+
93+
/// Copies the crt(1,i,n).o startup objects
94+
///
95+
/// Only required for musl targets that statically link to libc
96+
fn copy_third_party_objects(build: &Build, target: &str, into: &Path) {
97+
for &obj in &["crt1.o", "crti.o", "crtn.o"] {
98+
t!(fs::copy(compiler_file(build.cc(target), obj), into.join(obj)));
99+
}
86100
}
87101

88102
/// Build and prepare startup objects like rsbegin.o and rsend.o
@@ -122,19 +136,15 @@ pub fn rustc<'a>(build: &'a Build, stage: u32, target: &str,
122136
println!("Building stage{} compiler artifacts ({} -> {})", stage,
123137
host, target);
124138

125-
let out_dir = build.cargo_out(stage, &host, false, target);
139+
let out_dir = build.cargo_out(stage, &host, Mode::Librustc, target);
126140
build.clear_if_dirty(&out_dir, &libstd_shim(build, stage, &host, target));
127141

128-
let mut cargo = build.cargo(stage, compiler, false, target, "build");
129-
cargo.arg("--features").arg(build.rustc_features(stage))
142+
let mut cargo = build.cargo(stage, compiler, Mode::Librustc, Some(target),
143+
"build");
144+
cargo.arg("--features").arg(build.rustc_features())
130145
.arg("--manifest-path")
131146
.arg(build.src.join("src/rustc/Cargo.toml"));
132147

133-
// In stage0 we may not need to build as many executables
134-
if stage == 0 {
135-
cargo.arg("--bin").arg("rustc");
136-
}
137-
138148
// Set some configuration variables picked up by build scripts and
139149
// the compiler alike
140150
cargo.env("CFG_RELEASE", &build.release)
@@ -187,14 +197,14 @@ pub fn rustc_link(build: &Build,
187197
compiler: &Compiler,
188198
host: &str) {
189199
let libdir = build.sysroot_libdir(stage, host, target);
190-
let out_dir = build.cargo_out(stage, compiler.host, false, target);
200+
let out_dir = build.cargo_out(stage, compiler.host, Mode::Librustc, target);
191201
add_to_sysroot(&out_dir, &libdir);
192202
}
193203

194204
/// Cargo's output path for the standard library in a given stage, compiled
195205
/// by a particular compiler for the specified target.
196206
fn libstd_shim(build: &Build, stage: u32, host: &str, target: &str) -> PathBuf {
197-
build.cargo_out(stage, host, true, target).join("libstd_shim.rlib")
207+
build.cargo_out(stage, host, Mode::Libstd, target).join("libstd_shim.rlib")
198208
}
199209

200210
fn compiler_file(compiler: &Path, file: &str) -> String {
@@ -226,7 +236,8 @@ pub fn assemble_rustc(build: &Build, stage: u32, host: &str) {
226236
}
227237
}
228238

229-
let out_dir = build.cargo_out(stage - 1, &build.config.build, false, host);
239+
let out_dir = build.cargo_out(stage - 1, &build.config.build,
240+
Mode::Librustc, host);
230241

231242
// Link the compiler binary itself into place
232243
let rustc = out_dir.join(exe("rustc", host));
@@ -285,3 +296,27 @@ fn add_to_sysroot(out_dir: &Path, sysroot_dst: &Path) {
285296
sysroot_dst.join(path.file_name().unwrap())));
286297
}
287298
}
299+
300+
/// Build a tool in `src/tools`
301+
///
302+
/// This will build the specified tool with the specified `host` compiler in
303+
/// `stage` into the normal cargo output directory.
304+
pub fn tool(build: &Build, stage: u32, host: &str, tool: &str) {
305+
println!("Building stage{} tool {} ({})", stage, tool, host);
306+
307+
let compiler = Compiler::new(stage, host);
308+
309+
// FIXME: need to clear out previous tool and ideally deps, may require
310+
// isolating output directories or require a pseudo shim step to
311+
// clear out all the info.
312+
//
313+
// Maybe when libstd is compiled it should clear out the rustc of the
314+
// corresponding stage?
315+
// let out_dir = build.cargo_out(stage, &host, Mode::Librustc, target);
316+
// build.clear_if_dirty(&out_dir, &libstd_shim(build, stage, &host, target));
317+
318+
let mut cargo = build.cargo(stage, &compiler, Mode::Tool, None, "build");
319+
cargo.arg("--manifest-path")
320+
.arg(build.src.join(format!("src/tools/{}/Cargo.toml", tool)));
321+
build.run(&mut cargo);
322+
}

0 commit comments

Comments
 (0)