Skip to content

Commit e13f1c6

Browse files
committed
---
yaml --- r: 272376 b: refs/heads/auto c: c0ea2ad h: refs/heads/master
1 parent a92b921 commit e13f1c6

File tree

551 files changed

+7116
-5976
lines changed

Some content is hidden

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

551 files changed

+7116
-5976
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
88
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
99
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1010
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
11-
refs/heads/auto: 9ba3d5e9212bb67166d137efd58fcf5d06906c2a
11+
refs/heads/auto: c0ea2adbe6ad9532cb688f3c71de428f5e5fbc28
1212
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1313
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
1414
refs/tags/0.2: 1754d02027f2924bed83b0160ee340c7f41d5ea1

branches/auto/CONTRIBUTING.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ which includes important information about what platform you're on, what
7171
version of Rust you're using, etc.
7272

7373
Sometimes, a backtrace is helpful, and so including that is nice. To get
74-
a backtrace, set the `RUST_BACKTRACE` environment variable. The easiest way
74+
a backtrace, set the `RUST_BACKTRACE` environment variable to a value
75+
other than `0`. The easiest way
7576
to do this is to invoke `rustc` like this:
7677

7778
```bash

branches/auto/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,11 @@ To contribute to Rust, please see [CONTRIBUTING](CONTRIBUTING.md).
177177
Rust has an [IRC] culture and most real-time collaboration happens in a
178178
variety of channels on Mozilla's IRC network, irc.mozilla.org. The
179179
most popular channel is [#rust], a venue for general discussion about
180-
Rust, and a good place to ask for help.
180+
Rust. And a good place to ask for help would be [#rust-beginners].
181181
182182
[IRC]: https://en.wikipedia.org/wiki/Internet_Relay_Chat
183183
[#rust]: irc://irc.mozilla.org/rust
184+
[#rust-beginners]: irc://irc.mozilla.org/rust-beginners
184185
185186
## License
186187

branches/auto/configure

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,7 @@ opt inject-std-version 1 "inject the current compiler version of libstd into pro
608608
opt llvm-version-check 1 "check if the LLVM version is supported, build anyway"
609609
opt rustbuild 0 "use the rust and cargo based build system"
610610
opt orbit 0 "get MIR where it belongs - everywhere; most importantly, in orbit"
611+
opt codegen-tests 1 "run the src/test/codegen tests"
611612

612613
# Optimization and debugging options. These may be overridden by the release channel, etc.
613614
opt_nosave optimize 1 "build optimized rust code"
@@ -1497,7 +1498,9 @@ do
14971498
LLVM_INST_DIR=$CFG_LLVM_ROOT
14981499
do_reconfigure=0
14991500
# Check that LLVm FileCheck is available. Needed for the tests
1500-
need_cmd $LLVM_INST_DIR/bin/FileCheck
1501+
if [ -z "$CFG_DISABLE_CODEGEN_TESTS" ]; then
1502+
need_cmd $LLVM_INST_DIR/bin/FileCheck
1503+
fi
15011504
fi
15021505

15031506
if [ ${do_reconfigure} -ne 0 ]

branches/auto/man/rustc.1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,15 +268,15 @@ the maximum number of threads used for this purpose.
268268

269269
.TP
270270
\fBRUST_TEST_NOCAPTURE\fR
271-
A synonym for the --nocapture flag.
271+
If set to a value other than "0", a synonym for the --nocapture flag.
272272

273273
.TP
274274
\fBRUST_MIN_STACK\fR
275275
Sets the minimum stack size for new threads.
276276

277277
.TP
278278
\fBRUST_BACKTRACE\fR
279-
If set, produces a backtrace in the output of a program which panics.
279+
If set to a value different than "0", produces a backtrace in the output of a program which panics.
280280

281281
.SH "EXAMPLES"
282282
To build an executable from a source file with a main function:

branches/auto/mk/crates.mk

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ TARGET_CRATES := libc std term \
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 \
59-
rustc_data_structures rustc_front rustc_platform_intrinsics \
59+
rustc_data_structures rustc_platform_intrinsics \
6060
rustc_plugin rustc_metadata rustc_passes rustc_save_analysis \
6161
rustc_const_eval rustc_const_math
6262
HOST_CRATES := syntax syntax_ext $(RUSTC_CRATES) rustdoc fmt_macros \
@@ -93,38 +93,37 @@ DEPS_syntax := std term serialize log arena libc rustc_bitflags rustc_unicode
9393
DEPS_syntax_ext := syntax fmt_macros
9494

9595
DEPS_rustc_const_math := std syntax log serialize
96-
DEPS_rustc_const_eval := rustc_const_math rustc syntax log serialize rustc_front \
96+
DEPS_rustc_const_eval := rustc_const_math rustc syntax log serialize \
9797
rustc_back graphviz
9898

99-
DEPS_rustc := syntax fmt_macros flate arena serialize getopts rbml rustc_front\
99+
DEPS_rustc := syntax fmt_macros flate arena serialize getopts rbml \
100100
log graphviz rustc_back rustc_data_structures\
101101
rustc_const_math
102-
DEPS_rustc_back := std syntax rustc_front flate log libc
103-
DEPS_rustc_borrowck := rustc rustc_front rustc_mir log graphviz syntax
102+
DEPS_rustc_back := std syntax flate log libc
103+
DEPS_rustc_borrowck := rustc rustc_mir log graphviz syntax
104104
DEPS_rustc_data_structures := std log serialize
105105
DEPS_rustc_driver := arena flate getopts graphviz libc rustc rustc_back rustc_borrowck \
106106
rustc_typeck rustc_mir rustc_resolve log syntax serialize rustc_llvm \
107-
rustc_trans rustc_privacy rustc_lint rustc_front rustc_plugin \
107+
rustc_trans rustc_privacy rustc_lint rustc_plugin \
108108
rustc_metadata syntax_ext rustc_passes rustc_save_analysis rustc_const_eval
109-
DEPS_rustc_front := std syntax log serialize
110109
DEPS_rustc_lint := rustc log syntax rustc_const_eval
111110
DEPS_rustc_llvm := native:rustllvm libc std rustc_bitflags
112-
DEPS_rustc_metadata := rustc rustc_front syntax rbml rustc_const_math
113-
DEPS_rustc_passes := syntax rustc core rustc_front rustc_const_eval
114-
DEPS_rustc_mir := rustc rustc_front syntax rustc_const_math rustc_const_eval
115-
DEPS_rustc_resolve := arena rustc rustc_front log syntax
111+
DEPS_rustc_metadata := rustc syntax rbml rustc_const_math
112+
DEPS_rustc_passes := syntax rustc core rustc_const_eval
113+
DEPS_rustc_mir := rustc syntax rustc_const_math rustc_const_eval
114+
DEPS_rustc_resolve := arena rustc log syntax
116115
DEPS_rustc_platform_intrinsics := std
117116
DEPS_rustc_plugin := rustc rustc_metadata syntax rustc_mir
118-
DEPS_rustc_privacy := rustc rustc_front log syntax
117+
DEPS_rustc_privacy := rustc log syntax
119118
DEPS_rustc_trans := arena flate getopts graphviz libc rustc rustc_back rustc_mir \
120-
log syntax serialize rustc_llvm rustc_front rustc_platform_intrinsics \
119+
log syntax serialize rustc_llvm rustc_platform_intrinsics \
121120
rustc_const_math rustc_const_eval
122-
DEPS_rustc_save_analysis := rustc log syntax rustc_front
123-
DEPS_rustc_typeck := rustc syntax rustc_front rustc_platform_intrinsics rustc_const_math \
121+
DEPS_rustc_save_analysis := rustc log syntax
122+
DEPS_rustc_typeck := rustc syntax rustc_platform_intrinsics rustc_const_math \
124123
rustc_const_eval
125124

126125
DEPS_rustdoc := rustc rustc_driver native:hoedown serialize getopts \
127-
test rustc_lint rustc_front rustc_const_eval
126+
test rustc_lint rustc_const_eval
128127

129128

130129
TOOL_DEPS_compiletest := test getopts log

branches/auto/mk/rt.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ else ifeq ($(findstring android, $(OSTYPE_$(1))), android)
157157
# If the test suite passes, however, without symbol prefixes then we should be
158158
# good to go!
159159
JEMALLOC_ARGS_$(1) := --disable-tls --with-jemalloc-prefix=je_
160+
else ifeq ($(findstring dragonfly, $(OSTYPE_$(1))), dragonfly)
161+
JEMALLOC_ARGS_$(1) := --with-jemalloc-prefix=je_
160162
endif
161163

162164
ifdef CFG_ENABLE_DEBUG_JEMALLOC

branches/auto/mk/tests.mk

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,11 +305,15 @@ check-stage$(1)-T-$(2)-H-$(3)-exec: \
305305
check-stage$(1)-T-$(2)-H-$(3)-doc-crates-exec \
306306
check-stage$(1)-T-$(2)-H-$(3)-debuginfo-gdb-exec \
307307
check-stage$(1)-T-$(2)-H-$(3)-debuginfo-lldb-exec \
308-
check-stage$(1)-T-$(2)-H-$(3)-codegen-exec \
309-
check-stage$(1)-T-$(2)-H-$(3)-codegen-units-exec \
310308
check-stage$(1)-T-$(2)-H-$(3)-doc-exec \
311309
check-stage$(1)-T-$(2)-H-$(3)-pretty-exec
312310

311+
ifndef CFG_DISABLE_CODEGEN_TESTS
312+
check-stage$(1)-T-$(2)-H-$(3)-exec: \
313+
check-stage$(1)-T-$(2)-H-$(3)-codegen-exec \
314+
check-stage$(1)-T-$(2)-H-$(3)-codegen-units-exec
315+
endif
316+
313317
# Only test the compiler-dependent crates when the target is
314318
# able to build a compiler (when the target triple is in the set of host triples)
315319
ifneq ($$(findstring $(2),$$(CFG_HOST)),)

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

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,38 @@ fn build_startup_objects(build: &Build, target: &str, into: &Path) {
123123
}
124124
}
125125

126+
/// Build libtest.
127+
///
128+
/// This will build libtest and supporting libraries for a particular stage of
129+
/// the build using the `compiler` targeting the `target` architecture. The
130+
/// artifacts created will also be linked into the sysroot directory.
131+
pub fn test<'a>(build: &'a Build, target: &str, compiler: &Compiler<'a>) {
132+
println!("Building stage{} test artifacts ({} -> {})", compiler.stage,
133+
compiler.host, target);
134+
let out_dir = build.cargo_out(compiler, Mode::Libtest, target);
135+
build.clear_if_dirty(&out_dir, &libstd_shim(build, compiler, target));
136+
let mut cargo = build.cargo(compiler, Mode::Libtest, target, "build");
137+
cargo.arg("--manifest-path")
138+
.arg(build.src.join("src/rustc/test_shim/Cargo.toml"));
139+
build.run(&mut cargo);
140+
test_link(build, target, compiler, compiler.host);
141+
}
142+
143+
/// Link all libtest rlibs/dylibs into the sysroot location.
144+
///
145+
/// Links those artifacts generated in the given `stage` for `target` produced
146+
/// by `compiler` into `host`'s sysroot.
147+
pub fn test_link(build: &Build,
148+
target: &str,
149+
compiler: &Compiler,
150+
host: &str) {
151+
let target_compiler = Compiler::new(compiler.stage, host);
152+
let libdir = build.sysroot_libdir(&target_compiler, target);
153+
let out_dir = build.cargo_out(compiler, Mode::Libtest, target);
154+
add_to_sysroot(&out_dir, &libdir);
155+
}
156+
157+
126158
/// Build the compiler.
127159
///
128160
/// This will build the compiler for a particular stage of the build using
@@ -133,7 +165,7 @@ pub fn rustc<'a>(build: &'a Build, target: &str, compiler: &Compiler<'a>) {
133165
compiler.stage, compiler.host, target);
134166

135167
let out_dir = build.cargo_out(compiler, Mode::Librustc, target);
136-
build.clear_if_dirty(&out_dir, &libstd_shim(build, compiler, target));
168+
build.clear_if_dirty(&out_dir, &libtest_shim(build, compiler, target));
137169

138170
let mut cargo = build.cargo(compiler, Mode::Librustc, target, "build");
139171
cargo.arg("--features").arg(build.rustc_features())
@@ -202,6 +234,12 @@ fn libstd_shim(build: &Build, compiler: &Compiler, target: &str) -> PathBuf {
202234
build.cargo_out(compiler, Mode::Libstd, target).join("libstd_shim.rlib")
203235
}
204236

237+
/// Cargo's output path for libtest in a given stage, compiled by a particular
238+
/// compiler for the specified target.
239+
fn libtest_shim(build: &Build, compiler: &Compiler, target: &str) -> PathBuf {
240+
build.cargo_out(compiler, Mode::Libtest, target).join("libtest_shim.rlib")
241+
}
242+
205243
fn compiler_file(compiler: &Path, file: &str) -> String {
206244
output(Command::new(compiler)
207245
.arg(format!("-print-file-name={}", file))).trim().to_string()

branches/auto/src/bootstrap/build/doc.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,22 @@ pub fn std(build: &Build, stage: u32, host: &str, out: &Path) {
122122
cp_r(&out_dir, out)
123123
}
124124

125+
pub fn test(build: &Build, stage: u32, host: &str, out: &Path) {
126+
println!("Documenting stage{} test ({})", stage, host);
127+
let compiler = Compiler::new(stage, host);
128+
let out_dir = build.stage_out(&compiler, Mode::Libtest)
129+
.join(host).join("doc");
130+
let rustdoc = build.rustdoc(&compiler);
131+
132+
build.clear_if_dirty(&out_dir, &rustdoc);
133+
134+
let mut cargo = build.cargo(&compiler, Mode::Libtest, host, "doc");
135+
cargo.arg("--manifest-path")
136+
.arg(build.src.join("src/rustc/test_shim/Cargo.toml"));
137+
build.run(&mut cargo);
138+
cp_r(&out_dir, out)
139+
}
140+
125141
pub fn rustc(build: &Build, stage: u32, host: &str, out: &Path) {
126142
println!("Documenting stage{} compiler ({})", stage, host);
127143
let compiler = Compiler::new(stage, host);

branches/auto/src/bootstrap/build/mod.rs

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ pub struct Build {
8888

8989
pub enum Mode {
9090
Libstd,
91+
Libtest,
9192
Librustc,
9293
Tool,
9394
}
@@ -141,9 +142,13 @@ impl Build {
141142
return clean::clean(self);
142143
}
143144

145+
self.verbose("finding compilers");
144146
cc::find(self);
147+
self.verbose("running sanity check");
145148
sanity::check(self);
149+
self.verbose("collecting channel variables");
146150
channel::collect(self);
151+
self.verbose("updating submodules");
147152
self.update_submodules();
148153

149154
for target in step::all(self) {
@@ -158,12 +163,18 @@ impl Build {
158163
Libstd { compiler } => {
159164
compile::std(self, target.target, &compiler);
160165
}
166+
Libtest { compiler } => {
167+
compile::test(self, target.target, &compiler);
168+
}
161169
Librustc { compiler } => {
162170
compile::rustc(self, target.target, &compiler);
163171
}
164172
LibstdLink { compiler, host } => {
165173
compile::std_link(self, target.target, &compiler, host);
166174
}
175+
LibtestLink { compiler, host } => {
176+
compile::test_link(self, target.target, &compiler, host);
177+
}
167178
LibrustcLink { compiler, host } => {
168179
compile::rustc_link(self, target.target, &compiler, host);
169180
}
@@ -203,6 +214,9 @@ impl Build {
203214
DocStd { stage } => {
204215
doc::std(self, stage, target.target, &doc_out);
205216
}
217+
DocTest { stage } => {
218+
doc::test(self, stage, target.target, &doc_out);
219+
}
206220
DocRustc { stage } => {
207221
doc::rustc(self, stage, target.target, &doc_out);
208222
}
@@ -312,7 +326,13 @@ impl Build {
312326
if !target.contains("msvc") {
313327
cargo.env(format!("CC_{}", target), self.cc(target))
314328
.env(format!("AR_{}", target), self.ar(target))
315-
.env(format!("CFLAGS_{}", target), self.cflags(target));
329+
.env(format!("CFLAGS_{}", target), self.cflags(target).join(" "));
330+
}
331+
332+
// If we're building for OSX, inform the compiler and the linker that
333+
// we want to build a compiler runnable on 10.7
334+
if target.contains("apple-darwin") {
335+
cargo.env("MACOSX_DEPLOYMENT_TARGET", "10.7");
316336
}
317337

318338
// Environment variables *required* needed throughout the build
@@ -360,6 +380,7 @@ impl Build {
360380
let host = compiler.host;
361381
let paths = vec![
362382
self.cargo_out(compiler, Mode::Libstd, host).join("deps"),
383+
self.cargo_out(compiler, Mode::Libtest, host).join("deps"),
363384
self.cargo_out(compiler, Mode::Librustc, host).join("deps"),
364385
];
365386
add_lib_path(paths, &mut cmd);
@@ -414,7 +435,8 @@ impl Build {
414435
fn stage_out(&self, compiler: &Compiler, mode: Mode) -> PathBuf {
415436
let suffix = match mode {
416437
Mode::Libstd => "-std",
417-
_ => "-rustc",
438+
Mode::Libtest => "-test",
439+
Mode::Tool | Mode::Librustc => "-rustc",
418440
};
419441
self.out.join(compiler.host)
420442
.join(format!("stage{}{}", compiler.stage, suffix))
@@ -481,11 +503,20 @@ impl Build {
481503
self.cc[target].0.path()
482504
}
483505

484-
fn cflags(&self, target: &str) -> String {
485-
self.cc[target].0.args().iter()
486-
.map(|s| s.to_string_lossy())
487-
.collect::<Vec<_>>()
488-
.join(" ")
506+
fn cflags(&self, target: &str) -> Vec<String> {
507+
let mut base = self.cc[target].0.args().iter()
508+
.map(|s| s.to_string_lossy().into_owned())
509+
.collect::<Vec<_>>();
510+
511+
// If we're compiling on OSX then we add a few unconditional flags
512+
// indicating that we want libc++ (more filled out than libstdc++) and
513+
// we want to compile for 10.7. This way we can ensure that
514+
// LLVM/jemalloc/etc are all properly compiled.
515+
if target.contains("apple-darwin") {
516+
base.push("-stdlib=libc++".into());
517+
base.push("-mmacosx-version-min=10.7".into());
518+
}
519+
return base
489520
}
490521

491522
fn ar(&self, target: &str) -> &Path {

branches/auto/src/bootstrap/build/native.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ pub fn llvm(build: &Build, target: &str) {
8686
.define("CMAKE_CXX_COMPILER", build.cxx(target));
8787
}
8888
cfg.build_arg("-j").build_arg(build.jobs().to_string());
89+
90+
cfg.define("CMAKE_C_FLAGS", build.cflags(target).join(" "));
91+
cfg.define("CMAKE_CXX_FLAGS", build.cflags(target).join(" "));
8992
}
9093

9194
// FIXME: we don't actually need to build all LLVM tools and all LLVM

0 commit comments

Comments
 (0)