Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 19 pull requests #57309

Closed
wants to merge 77 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
4e7d53d
Search codegen backends based on target libdir instead of sysroot.
o01eg Dec 24, 2018
fcad209
Add closure cannot be moved note.
davidtwco Dec 24, 2018
fff905b
panic when calling MaybeUninhabited::into_inner on uninhabited type
RalfJung Dec 27, 2018
c118b17
use a better way to get at the type parameter
RalfJung Dec 27, 2018
2149d73
Remove unnecessary borrow generation
matthewjasper Dec 1, 2018
49e52e7
Remove unused types from rustc::mir::interpret
matthewjasper Dec 29, 2018
4e77c3a
test: Add test for issues 45510 and 18952.
cjgillot Nov 4, 2018
6de9c13
rustfmt: librust_typeck/check/callee.rs
cjgillot Nov 4, 2018
1827d52
rustc_typeck: Implement resolution advised in issue 45510.
cjgillot Nov 4, 2018
f518cf9
Move tests to ui.
cjgillot Nov 8, 2018
2f42a18
Fix failing diagnostic test.
cjgillot Nov 21, 2018
2530ce9
Add comment.
cjgillot Nov 21, 2018
91c155b
Change return types and check return values in tests.
cjgillot Nov 27, 2018
afb7c06
Remove unused nll debug flags
matthewjasper Dec 30, 2018
3512a72
Implement the re-rebalance coherence rfc
weiznich Nov 20, 2018
b8ee6fa
Add some tests
weiznich Nov 21, 2018
e869e5f
Add some docs about the new feature to the unstable book
weiznich Nov 21, 2018
cae96b1
Fix tidy
weiznich Nov 21, 2018
eee09d5
Update src/doc/unstable-book/src/language-features/re-rebalance-coher…
varkor Nov 22, 2018
6912b2d
Directly check if input_ty is a type parameter and therefore a
weiznich Nov 23, 2018
44089c8
Fix failing compile tests
weiznich Dec 14, 2018
ad7d015
Update some new tests to changed error messages
weiznich Dec 14, 2018
8a5d45d
Unify tests
weiznich Dec 28, 2018
da08a81
Fix typo
weiznich Dec 28, 2018
6caa4ce
Add missing files
weiznich Dec 29, 2018
794b81e
Rename and fix nolink-with-link-args test
Smibu Dec 31, 2018
f4826ab
Fix backtraces on Windows
Zoxc Dec 31, 2018
d2c91a1
Fix broken links to second edition TRPL.
frewsxcv Jan 1, 2019
b903cb9
Move the `Unevaluated` constant arm upwards in the type structure
oli-obk Dec 11, 2018
88df3a2
Mingw is special wrt type sizes
oli-obk Dec 12, 2018
1351328
Simplify and fix some diagnostics around arrays
oli-obk Dec 12, 2018
f36c655
Add `unwrap_usize` to `LazyConst`, too
oli-obk Dec 13, 2018
bb9f717
`const_to_op` is now `lazy_const_to_op`
oli-obk Dec 13, 2018
37a0df3
`<&'tcx ty::Const as Deref>::deref`
oli-obk Dec 13, 2018
17db209
Simplify bit inspection of a constant
oli-obk Dec 13, 2018
d96c4a9
Undo a few - now unnecessary - changes
oli-obk Dec 13, 2018
089c403
Pacify tidy
oli-obk Dec 13, 2018
cb933ef
rebase fallout
oli-obk Dec 15, 2018
3d924a6
Git is drunk
oli-obk Dec 23, 2018
48aa819
what is going on?
oli-obk Dec 27, 2018
e42b21b
Properly lift `Allocations`
oli-obk Dec 28, 2018
72bcf92
Macrofy more `Lift` impls
oli-obk Dec 28, 2018
9654ae9
Remove unused function
oli-obk Dec 28, 2018
03b8928
Check the correct arena
oli-obk Dec 28, 2018
185636e
Update reference of rlibc crate to compiler-builtins crate
king6cong Jan 2, 2019
0fd5003
src/jemalloc is gone, remove its mention from COPYRIGHT
SimonSapin Jan 2, 2019
2a02d6d
Make sure feature gate errors are recoverable (take 2)
petrochenkov Jan 2, 2019
0a6fb84
make `panictry!` private to libsyntax
euclio Dec 4, 2018
0b6d217
Update compiler_builtins 0.1.2 -> 0.1.3
Jan 2, 2019
3852dc8
Add Clippy to config.toml.example
mati865 Jan 2, 2019
ea7fef1
bootstrap: Link LLVM as a dylib with ThinLTO
alexcrichton Dec 18, 2018
a175969
Avoid using open_global_now
alexcrichton Dec 18, 2018
82a1bb3
Remove no longer working test
alexcrichton Dec 19, 2018
fa4f014
Remove now stray comment
alexcrichton Dec 19, 2018
c0662a0
Update the stdsimd submodule
alexcrichton Jan 2, 2019
71fed3a
Don't package up libLLVM.so with libstd
alexcrichton Jan 2, 2019
a944ecf
Fix 'be be' constructs
d-e-s-o Jan 3, 2019
32118a9
More test deduplication
weiznich Jan 3, 2019
677eef5
Rollup merge of #55986 - cjgillot:issue-45510, r=nikomatsakis
Mark-Simulacrum Jan 3, 2019
be8a496
Rollup merge of #56145 - weiznich:re_rebalance_coherence, r=nikomatsakis
Mark-Simulacrum Jan 3, 2019
fee93ea
Rollup merge of #56723 - oli-obk:lazy_const, r=nikomatsakis
Mark-Simulacrum Jan 3, 2019
3baae65
Rollup merge of #56897 - euclio:parse-fatal, r=estebank
Mark-Simulacrum Jan 3, 2019
c90bf0e
Rollup merge of #57099 - davidtwco:issue-57098, r=nikomatsakis
Mark-Simulacrum Jan 3, 2019
4473e32
Rollup merge of #57101 - o01eg:fix-57014, r=alexcrichton
Mark-Simulacrum Jan 3, 2019
2701289
Rollup merge of #57145 - RalfJung:panic-if-uninhabited, r=alexcrichton
Mark-Simulacrum Jan 3, 2019
88818d6
Rollup merge of #57219 - matthewjasper:mir-cleanup, r=nikomatsakis
Mark-Simulacrum Jan 3, 2019
ac58493
Rollup merge of #57233 - Smibu:rename-and-fix-nolink-test, r=alexcric…
Mark-Simulacrum Jan 3, 2019
400d453
Rollup merge of #57238 - Zoxc:bt-fix, r=alexcrichton
Mark-Simulacrum Jan 3, 2019
028774c
Rollup merge of #57249 - frewsxcv:frewsxcv-second-edition, r=KodrAus
Mark-Simulacrum Jan 3, 2019
e78b596
Rollup merge of #57259 - king6cong:master, r=alexcrichton
Mark-Simulacrum Jan 3, 2019
0496b18
Rollup merge of #57267 - rust-lang:SimonSapin-patch-1, r=varkor
Mark-Simulacrum Jan 3, 2019
f05bd30
Rollup merge of #57272 - petrochenkov:featrecov, r=estebank
Mark-Simulacrum Jan 3, 2019
cf56d3f
Rollup merge of #57273 - alexcrichton:update-stdsimd, r=nikomatsakis
Mark-Simulacrum Jan 3, 2019
6e80fb1
Rollup merge of #57275 - jethrogb:jb/update-compiler_builtins, r=alex…
Mark-Simulacrum Jan 3, 2019
e8472e4
Rollup merge of #57278 - mati865:config_clippy, r=alexcrichton
Mark-Simulacrum Jan 3, 2019
5508d36
Rollup merge of #57286 - alexcrichton:less-thin-2-2, r=nikomatsakis
Mark-Simulacrum Jan 3, 2019
6adc37e
Rollup merge of #57295 - d-e-s-o:topic/be-be, r=zackmdavis
Mark-Simulacrum Jan 3, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
32 changes: 0 additions & 32 deletions COPYRIGHT
Original file line number Diff line number Diff line change
Expand Up @@ -229,35 +229,3 @@ their own copyright notices and license terms:
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
OF SUCH DAMAGE. */

* jemalloc, under src/jemalloc:

Copyright (C) 2002-2014 Jason Evans
<[email protected]>. All rights reserved.
Copyright (C) 2007-2012 Mozilla Foundation.
All rights reserved.
Copyright (C) 2009-2014 Facebook, Inc.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice(s),
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice(s),
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S)
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S)
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
OF SUCH DAMAGE.
38 changes: 19 additions & 19 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dependencies = [
name = "alloc"
version = "0.0.0"
dependencies = [
"compiler_builtins 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"compiler_builtins 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"core 0.0.0",
"rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rand_xorshift 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
Expand Down Expand Up @@ -98,7 +98,7 @@ version = "0.1.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)",
"compiler_builtins 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"compiler_builtins 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.45 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-std-workspace-core 1.0.0",
]
Expand Down Expand Up @@ -409,7 +409,7 @@ dependencies = [

[[package]]
name = "compiler_builtins"
version = "0.1.2"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)",
Expand Down Expand Up @@ -665,7 +665,7 @@ name = "dlmalloc"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"compiler_builtins 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"compiler_builtins 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.45 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-std-workspace-core 1.0.0",
]
Expand Down Expand Up @@ -823,7 +823,7 @@ name = "fortanix-sgx-abi"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"compiler_builtins 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"compiler_builtins 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-std-workspace-core 1.0.0",
]

Expand Down Expand Up @@ -1516,7 +1516,7 @@ dependencies = [
name = "panic_abort"
version = "0.0.0"
dependencies = [
"compiler_builtins 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"compiler_builtins 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"core 0.0.0",
"libc 0.2.45 (registry+https://github.com/rust-lang/crates.io-index)",
]
Expand All @@ -1526,7 +1526,7 @@ name = "panic_unwind"
version = "0.0.0"
dependencies = [
"alloc 0.0.0",
"compiler_builtins 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"compiler_builtins 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"core 0.0.0",
"libc 0.2.45 (registry+https://github.com/rust-lang/crates.io-index)",
"unwind 0.0.0",
Expand Down Expand Up @@ -1679,7 +1679,7 @@ name = "profiler_builtins"
version = "0.0.0"
dependencies = [
"cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)",
"compiler_builtins 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"compiler_builtins 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"core 0.0.0",
]

Expand Down Expand Up @@ -1810,7 +1810,7 @@ name = "rand_chacha"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
]

Expand All @@ -1832,7 +1832,7 @@ name = "rand_hc"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
Expand All @@ -1857,7 +1857,7 @@ name = "rand_xorshift"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
Expand Down Expand Up @@ -2198,7 +2198,7 @@ name = "rustc-demangle"
version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"compiler_builtins 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"compiler_builtins 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-std-workspace-core 1.0.0",
]

Expand Down Expand Up @@ -2296,7 +2296,7 @@ dependencies = [
"alloc 0.0.0",
"build_helper 0.1.0",
"cmake 0.1.33 (registry+https://github.com/rust-lang/crates.io-index)",
"compiler_builtins 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"compiler_builtins 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"core 0.0.0",
]

Expand Down Expand Up @@ -2490,7 +2490,7 @@ dependencies = [
"alloc 0.0.0",
"build_helper 0.1.0",
"cmake 0.1.33 (registry+https://github.com/rust-lang/crates.io-index)",
"compiler_builtins 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"compiler_builtins 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"core 0.0.0",
]

Expand Down Expand Up @@ -2542,7 +2542,7 @@ dependencies = [
"alloc 0.0.0",
"build_helper 0.1.0",
"cmake 0.1.33 (registry+https://github.com/rust-lang/crates.io-index)",
"compiler_builtins 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"compiler_builtins 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"core 0.0.0",
]

Expand Down Expand Up @@ -2655,7 +2655,7 @@ dependencies = [
"alloc 0.0.0",
"build_helper 0.1.0",
"cmake 0.1.33 (registry+https://github.com/rust-lang/crates.io-index)",
"compiler_builtins 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"compiler_builtins 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"core 0.0.0",
]

Expand Down Expand Up @@ -2891,7 +2891,7 @@ dependencies = [
"alloc 0.0.0",
"backtrace-sys 0.1.27 (registry+https://github.com/rust-lang/crates.io-index)",
"cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)",
"compiler_builtins 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"compiler_builtins 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"core 0.0.0",
"dlmalloc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"fortanix-sgx-abi 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
Expand Down Expand Up @@ -3232,7 +3232,7 @@ dependencies = [
name = "unwind"
version = "0.0.0"
dependencies = [
"compiler_builtins 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"compiler_builtins 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"core 0.0.0",
"libc 0.2.45 (registry+https://github.com/rust-lang/crates.io-index)",
]
Expand Down Expand Up @@ -3412,7 +3412,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum colored 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b0aa3473e85a3161b59845d6096b289bb577874cafeaf75ea1b1beaa6572c7fc"
"checksum commoncrypto 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d056a8586ba25a1e4d61cb090900e495952c7886786fc55f909ab2f819b69007"
"checksum commoncrypto-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1fed34f46747aa73dfaa578069fd8279d2818ade2b55f38f22a9401c7f4083e2"
"checksum compiler_builtins 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "8ad611263b9f31bdb66e66227d3b781600fd1e68d5deee29b23f5e2ac9cb4892"
"checksum compiler_builtins 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e066bf05ea052f9891699abcf8c3025256e3f29b50b741441be1e614b10d9c4a"
"checksum compiletest_rs 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)" = "89747fe073b7838343bd2c2445e7a7c2e0d415598f8925f0fa9205b9cdfc48cb"
"checksum core-foundation 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4e2640d6d0bf22e82bed1b73c6aef8d5dd31e5abe6666c57e6d45e2649f4f887"
"checksum core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e7ca8a5221364ef15ce201e8ed2f609fc312682a8f4e0e3d4aa5879764e0fa3b"
Expand Down
2 changes: 1 addition & 1 deletion config.toml.example
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@

# Installs chosen set of extended tools if enables. By default builds all.
# If chosen tool failed to build the installation fails.
#tools = ["cargo", "rls", "rustfmt", "analysis", "src"]
#tools = ["cargo", "rls", "clippy", "rustfmt", "analysis", "src"]

# Verbosity level: 0 == not verbose, 1 == verbose, 2 == very verbose
#verbose = 0
Expand Down
5 changes: 0 additions & 5 deletions src/bootstrap/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ impl Step for Std {
builder.info(&format!("Checking std artifacts ({} -> {})", &compiler.host, target));
run_cargo(builder,
&mut cargo,
vec![],
&libstd_stamp(builder, compiler, target),
true);

Expand Down Expand Up @@ -85,7 +84,6 @@ impl Step for Rustc {
builder.info(&format!("Checking compiler artifacts ({} -> {})", &compiler.host, target));
run_cargo(builder,
&mut cargo,
vec![],
&librustc_stamp(builder, compiler, target),
true);

Expand Down Expand Up @@ -136,7 +134,6 @@ impl Step for CodegenBackend {
let _folder = builder.fold_output(|| format!("stage{}-rustc_codegen_llvm", compiler.stage));
run_cargo(builder,
&mut cargo,
vec![],
&codegen_backend_stamp(builder, compiler, target, backend),
true);
}
Expand Down Expand Up @@ -174,7 +171,6 @@ impl Step for Test {
builder.info(&format!("Checking test artifacts ({} -> {})", &compiler.host, target));
run_cargo(builder,
&mut cargo,
vec![],
&libtest_stamp(builder, compiler, target),
true);

Expand Down Expand Up @@ -222,7 +218,6 @@ impl Step for Rustdoc {
println!("Checking rustdoc artifacts ({} -> {})", &compiler.host, target);
run_cargo(builder,
&mut cargo,
vec![],
&rustdoc_stamp(builder, compiler, target),
true);

Expand Down
49 changes: 8 additions & 41 deletions src/bootstrap/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ use build_helper::{output, mtime, up_to_date};
use filetime::FileTime;
use serde_json;

use crate::dist;
use crate::util::{exe, libdir, is_dylib};
use crate::{Compiler, Mode, GitRepo};
use crate::native;
Expand Down Expand Up @@ -104,7 +105,6 @@ impl Step for Std {
&compiler.host, target));
run_cargo(builder,
&mut cargo,
vec![],
&libstd_stamp(builder, compiler, target),
false);

Expand Down Expand Up @@ -365,7 +365,6 @@ impl Step for Test {
&compiler.host, target));
run_cargo(builder,
&mut cargo,
vec![],
&libtest_stamp(builder, compiler, target),
false);

Expand Down Expand Up @@ -493,7 +492,6 @@ impl Step for Rustc {
compiler.stage, &compiler.host, target));
run_cargo(builder,
&mut cargo,
vec![],
&librustc_stamp(builder, compiler, target),
false);

Expand Down Expand Up @@ -636,47 +634,18 @@ impl Step for CodegenBackend {

let out_dir = builder.cargo_out(compiler, Mode::Codegen, target);

let mut cargo = builder.cargo(compiler, Mode::Codegen, target, "rustc");
let mut cargo = builder.cargo(compiler, Mode::Codegen, target, "build");
cargo.arg("--manifest-path")
.arg(builder.src.join("src/librustc_codegen_llvm/Cargo.toml"));
rustc_cargo_env(builder, &mut cargo);

let features = build_codegen_backend(&builder, &mut cargo, &compiler, target, backend);

let mut cargo_tails_args = vec![];

if builder.config.llvm_thin_lto {
cargo_tails_args.push("--".to_string());

let num_jobs = builder.jobs();

if !target.contains("msvc") {
// Here we assume that the linker is clang. If it's not, there'll
// be linker errors.
cargo_tails_args.push("-Clink-arg=-fuse-ld=lld".to_string());
cargo_tails_args.push("-Clink-arg=-flto=thin".to_string());

if builder.config.llvm_optimize {
cargo_tails_args.push("-Clink-arg=-O2".to_string());
}

// Let's make LLD respect the `-j` option.
let num_jobs_arg = format!("-Clink-arg=-Wl,--thinlto-jobs={}", num_jobs);
cargo_tails_args.push(num_jobs_arg);
} else {
// Here we assume that the linker is lld-link.exe. lld-link.exe
// does not need the extra arguments except for num_jobs
let num_jobs_arg = format!("-Clink-arg=/opt:lldltojobs={}", num_jobs);
cargo_tails_args.push(num_jobs_arg);
}
}

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

let _folder = builder.fold_output(|| format!("stage{}-rustc_codegen_llvm", compiler.stage));
let files = run_cargo(builder,
cargo.arg("--features").arg(features),
cargo_tails_args,
&tmp_stamp,
false);
if builder.config.dry_run {
Expand Down Expand Up @@ -749,7 +718,9 @@ pub fn build_codegen_backend(builder: &Builder,
"libstdc++.a");
cargo.env("LLVM_STATIC_STDCPP", file);
}
if builder.config.llvm_link_shared {
if builder.config.llvm_link_shared ||
(builder.config.llvm_thin_lto && backend != "emscripten")
{
cargo.env("LLVM_LINK_SHARED", "1");
}
}
Expand Down Expand Up @@ -989,6 +960,8 @@ impl Step for Assemble {
copy_lld_to_sysroot(builder, target_compiler, &lld_install);
}

dist::maybe_install_llvm_dylib(builder, target_compiler.host, &sysroot);

// Link the compiler binary itself into place
let out_dir = builder.cargo_out(build_compiler, Mode::Rustc, host);
let rustc = out_dir.join(exe("rustc_binary", &*host));
Expand All @@ -1015,7 +988,6 @@ pub fn add_to_sysroot(builder: &Builder, sysroot_dst: &Path, stamp: &Path) {

pub fn run_cargo(builder: &Builder,
cargo: &mut Command,
tail_args: Vec<String>,
stamp: &Path,
is_check: bool)
-> Vec<PathBuf>
Expand All @@ -1038,7 +1010,7 @@ pub fn run_cargo(builder: &Builder,
// files we need to probe for later.
let mut deps = Vec::new();
let mut toplevel = Vec::new();
let ok = stream_cargo(builder, cargo, tail_args, &mut |msg| {
let ok = stream_cargo(builder, cargo, &mut |msg| {
let filenames = match msg {
CargoMessage::CompilerArtifact { filenames, .. } => filenames,
_ => return,
Expand Down Expand Up @@ -1163,7 +1135,6 @@ pub fn run_cargo(builder: &Builder,
pub fn stream_cargo(
builder: &Builder,
cargo: &mut Command,
tail_args: Vec<String>,
cb: &mut dyn FnMut(CargoMessage),
) -> bool {
if builder.config.dry_run {
Expand All @@ -1174,10 +1145,6 @@ pub fn stream_cargo(
cargo.arg("--message-format").arg("json")
.stdout(Stdio::piped());

for arg in tail_args {
cargo.arg(arg);
}

builder.verbose(&format!("running: {:?}", cargo));
let mut child = match cargo.spawn() {
Ok(child) => child,
Expand Down
Loading