Skip to content

Commit d349e32

Browse files
committed
Merge branch 'master' into rusty-hermit, resolve conflicts
2 parents ddcd157 + d54111a commit d349e32

File tree

277 files changed

+3582
-2736
lines changed

Some content is hidden

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

277 files changed

+3582
-2736
lines changed

CONTRIBUTING.md

+8
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,14 @@ the master branch to your feature branch.
128128
Also, please make sure that fixup commits are squashed into other related
129129
commits with meaningful commit messages.
130130

131+
GitHub allows [closing issues using keywords][closing-keywords]. This feature
132+
should be used to keep the issue tracker tidy. However, it is generally preferred
133+
to put the "closes #123" text in the PR description rather than the issue commit;
134+
particularly during rebasing, citing the issue number in the commit can "spam"
135+
the issue in question.
136+
137+
[closing-keywords]: https://help.github.com/en/articles/closing-issues-using-keywords
138+
131139
Please make sure your pull request is in compliance with Rust's style
132140
guidelines by running
133141

Cargo.lock

+6-6
Original file line numberDiff line numberDiff line change
@@ -556,9 +556,9 @@ dependencies = [
556556

557557
[[package]]
558558
name = "compiletest_rs"
559-
version = "0.3.24"
559+
version = "0.3.25"
560560
source = "registry+https://github.com/rust-lang/crates.io-index"
561-
checksum = "676a74b493d50ac33cacd83fd536597e6b52c0b46b9856f7b9c809d82fef4ac0"
561+
checksum = "f75b10a18fb53549fdd090846eb01c7f8593914494d1faabc4d3005c436e417a"
562562
dependencies = [
563563
"diff",
564564
"filetime",
@@ -1297,9 +1297,9 @@ dependencies = [
12971297

12981298
[[package]]
12991299
name = "hashbrown"
1300-
version = "0.6.1"
1300+
version = "0.6.2"
13011301
source = "registry+https://github.com/rust-lang/crates.io-index"
1302-
checksum = "6587d09be37fb98a11cb08b9000a3f592451c1b1b613ca69d949160e313a430a"
1302+
checksum = "3cd9867f119b19fecb08cd5c326ad4488d7a1da4bf75b4d95d71db742525aaab"
13031303
dependencies = [
13041304
"autocfg",
13051305
"compiler_builtins",
@@ -3494,6 +3494,7 @@ dependencies = [
34943494
"rustc_data_structures",
34953495
"rustc_errors",
34963496
"rustc_interface",
3497+
"rustc_lint",
34973498
"rustc_metadata",
34983499
"rustc_mir",
34993500
"rustc_plugin",
@@ -4156,9 +4157,8 @@ dependencies = [
41564157
"core",
41574158
"dlmalloc",
41584159
"fortanix-sgx-abi",
4159-
"hashbrown 0.6.1",
4160+
"hashbrown 0.6.2",
41604161
"hermit-abi",
4161-
"libc",
41624162
"panic_abort",
41634163
"panic_unwind",
41644164
"profiler_builtins",

src/bootstrap/builder.rs

+1
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,7 @@ impl<'a> Builder<'a> {
443443
dist::Rustc,
444444
dist::DebuggerScripts,
445445
dist::Std,
446+
dist::RustcDev,
446447
dist::Analysis,
447448
dist::Src,
448449
dist::PlainSourceTarball,

src/bootstrap/check.rs

+4
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ impl Step for Std {
5555
cargo,
5656
args(builder.kind),
5757
&libstd_stamp(builder, compiler, target),
58+
vec![],
5859
true);
5960

6061
let libdir = builder.sysroot_libdir(compiler, target);
@@ -103,6 +104,7 @@ impl Step for Rustc {
103104
cargo,
104105
args(builder.kind),
105106
&librustc_stamp(builder, compiler, target),
107+
vec![],
106108
true);
107109

108110
let libdir = builder.sysroot_libdir(compiler, target);
@@ -155,6 +157,7 @@ impl Step for CodegenBackend {
155157
cargo,
156158
args(builder.kind),
157159
&codegen_backend_stamp(builder, compiler, target, backend),
160+
vec![],
158161
true);
159162
}
160163
}
@@ -199,6 +202,7 @@ impl Step for Rustdoc {
199202
cargo,
200203
args(builder.kind),
201204
&rustdoc_stamp(builder, compiler, target),
205+
vec![],
202206
true);
203207

204208
let libdir = builder.sysroot_libdir(compiler, target);

src/bootstrap/compile.rs

+41-22
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ impl Step for Std {
6969
return;
7070
}
7171

72-
builder.ensure(StartupObjects { compiler, target });
72+
let mut target_deps = builder.ensure(StartupObjects { compiler, target });
7373

7474
let compiler_to_use = builder.compiler_for(compiler.stage, compiler.host, target);
7575
if compiler_to_use != compiler {
@@ -91,7 +91,7 @@ impl Step for Std {
9191
return;
9292
}
9393

94-
copy_third_party_objects(builder, &compiler, target);
94+
target_deps.extend(copy_third_party_objects(builder, &compiler, target).into_iter());
9595

9696
let mut cargo = builder.cargo(compiler, Mode::Std, target, "build");
9797
std_cargo(builder, &compiler, target, &mut cargo);
@@ -102,6 +102,7 @@ impl Step for Std {
102102
cargo,
103103
vec![],
104104
&libstd_stamp(builder, compiler, target),
105+
target_deps,
105106
false);
106107

107108
builder.ensure(StdLink {
@@ -113,29 +114,36 @@ impl Step for Std {
113114
}
114115

115116
/// Copies third pary objects needed by various targets.
116-
fn copy_third_party_objects(builder: &Builder<'_>, compiler: &Compiler, target: Interned<String>) {
117+
fn copy_third_party_objects(builder: &Builder<'_>, compiler: &Compiler, target: Interned<String>)
118+
-> Vec<PathBuf>
119+
{
117120
let libdir = builder.sysroot_libdir(*compiler, target);
118121

122+
let mut target_deps = vec![];
123+
124+
let mut copy_and_stamp = |sourcedir: &Path, name: &str| {
125+
let target = libdir.join(name);
126+
builder.copy(
127+
&sourcedir.join(name),
128+
&target,
129+
);
130+
target_deps.push(target);
131+
};
132+
119133
// Copies the crt(1,i,n).o startup objects
120134
//
121135
// Since musl supports fully static linking, we can cross link for it even
122136
// with a glibc-targeting toolchain, given we have the appropriate startup
123137
// files. As those shipped with glibc won't work, copy the ones provided by
124138
// musl so we have them on linux-gnu hosts.
125139
if target.contains("musl") {
140+
let srcdir = builder.musl_root(target).unwrap().join("lib");
126141
for &obj in &["crt1.o", "crti.o", "crtn.o"] {
127-
builder.copy(
128-
&builder.musl_root(target).unwrap().join("lib").join(obj),
129-
&libdir.join(obj),
130-
);
142+
copy_and_stamp(&srcdir, obj);
131143
}
132144
} else if target.ends_with("-wasi") {
133-
for &obj in &["crt1.o"] {
134-
builder.copy(
135-
&builder.wasi_root(target).unwrap().join("lib/wasm32-wasi").join(obj),
136-
&libdir.join(obj),
137-
);
138-
}
145+
let srcdir = builder.wasi_root(target).unwrap().join("lib/wasm32-wasi");
146+
copy_and_stamp(&srcdir, "crt1.o");
139147
}
140148

141149
// Copies libunwind.a compiled to be linked wit x86_64-fortanix-unknown-sgx.
@@ -145,11 +153,11 @@ fn copy_third_party_objects(builder: &Builder<'_>, compiler: &Compiler, target:
145153
// which is provided by std for this target.
146154
if target == "x86_64-fortanix-unknown-sgx" {
147155
let src_path_env = "X86_FORTANIX_SGX_LIBS";
148-
let obj = "libunwind.a";
149156
let src = env::var(src_path_env).expect(&format!("{} not found in env", src_path_env));
150-
let src = Path::new(&src).join(obj);
151-
builder.copy(&src, &libdir.join(obj));
157+
copy_and_stamp(Path::new(&src), "libunwind.a");
152158
}
159+
160+
target_deps
153161
}
154162

155163
/// Configure cargo to compile the standard library, adding appropriate env vars
@@ -306,7 +314,7 @@ pub struct StartupObjects {
306314
}
307315

308316
impl Step for StartupObjects {
309-
type Output = ();
317+
type Output = Vec<PathBuf>;
310318

311319
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
312320
run.path("src/rtstartup")
@@ -325,13 +333,15 @@ impl Step for StartupObjects {
325333
/// They don't require any library support as they're just plain old object
326334
/// files, so we just use the nightly snapshot compiler to always build them (as
327335
/// no other compilers are guaranteed to be available).
328-
fn run(self, builder: &Builder<'_>) {
336+
fn run(self, builder: &Builder<'_>) -> Vec<PathBuf> {
329337
let for_compiler = self.compiler;
330338
let target = self.target;
331339
if !target.contains("windows-gnu") {
332-
return
340+
return vec![]
333341
}
334342

343+
let mut target_deps = vec![];
344+
335345
let src_dir = &builder.src.join("src/rtstartup");
336346
let dst_dir = &builder.native_dir(target).join("rtstartup");
337347
let sysroot_dir = &builder.sysroot_libdir(for_compiler, target);
@@ -350,16 +360,22 @@ impl Step for StartupObjects {
350360
.arg(src_file));
351361
}
352362

353-
builder.copy(dst_file, &sysroot_dir.join(file.to_string() + ".o"));
363+
let target = sysroot_dir.join(file.to_string() + ".o");
364+
builder.copy(dst_file, &target);
365+
target_deps.push(target);
354366
}
355367

356368
for obj in ["crt2.o", "dllcrt2.o"].iter() {
357369
let src = compiler_file(builder,
358370
builder.cc(target),
359371
target,
360372
obj);
361-
builder.copy(&src, &sysroot_dir.join(obj));
373+
let target = sysroot_dir.join(obj);
374+
builder.copy(&src, &target);
375+
target_deps.push(target);
362376
}
377+
378+
target_deps
363379
}
364380
}
365381

@@ -437,6 +453,7 @@ impl Step for Rustc {
437453
cargo,
438454
vec![],
439455
&librustc_stamp(builder, compiler, target),
456+
vec![],
440457
false);
441458

442459
builder.ensure(RustcLink {
@@ -585,7 +602,7 @@ impl Step for CodegenBackend {
585602

586603
let tmp_stamp = out_dir.join(".tmp.stamp");
587604

588-
let files = run_cargo(builder, cargo, vec![], &tmp_stamp, false);
605+
let files = run_cargo(builder, cargo, vec![], &tmp_stamp, vec![], false);
589606
if builder.config.dry_run {
590607
return;
591608
}
@@ -941,6 +958,7 @@ pub fn run_cargo(builder: &Builder<'_>,
941958
cargo: Cargo,
942959
tail_args: Vec<String>,
943960
stamp: &Path,
961+
additional_target_deps: Vec<PathBuf>,
944962
is_check: bool)
945963
-> Vec<PathBuf>
946964
{
@@ -1057,6 +1075,7 @@ pub fn run_cargo(builder: &Builder<'_>,
10571075
deps.push((path_to_add.into(), false));
10581076
}
10591077

1078+
deps.extend(additional_target_deps.into_iter().map(|d| (d, false)));
10601079
deps.sort();
10611080
let mut new_contents = Vec::new();
10621081
for (dep, proc_macro) in deps.iter() {

0 commit comments

Comments
 (0)