about summary refs log tree commit diff
path: root/src/bootstrap/compile.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2018-03-05 09:47:54 -0800
committerAlex Crichton <alex@alexcrichton.com>2018-03-09 07:29:08 -0800
commitbe902e7168505954b85e1bbb35322f8df8a29c19 (patch)
tree1c68f40b0ae7d2c2b8a6e51064e18ab1dc601ca1 /src/bootstrap/compile.rs
parentfedce67cd21dc08ece5a484fe1a060346acac98a (diff)
downloadrust-be902e7168505954b85e1bbb35322f8df8a29c19.tar.gz
rust-be902e7168505954b85e1bbb35322f8df8a29c19.zip
rustbuild: Fix MSBuild location of `llvm-config.exe`
For LLD integration the path to `llvm-config` needed to change to inside the
build directory itself (for whatever reason) but the build directory is
different on MSBuild than it is on `ninja` for MSVC builds, so the path to
`llvm-config.exe` was actually wrong and not working!

This commit removes the `Build::llvm_config` function in favor of the source of
truth, the `Llvm` build step itself. The build step was then updated to find the
right build directory for MSBuild as well as `ninja` for where `llvm-config.exe`
is located.

Closes #48749
Diffstat (limited to 'src/bootstrap/compile.rs')
-rw-r--r--src/bootstrap/compile.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs
index 695cf04a82c..86263c8fa07 100644
--- a/src/bootstrap/compile.rs
+++ b/src/bootstrap/compile.rs
@@ -105,7 +105,7 @@ impl Step for Std {
         let out_dir = build.stage_out(compiler, Mode::Libstd);
         build.clear_if_dirty(&out_dir, &builder.rustc(compiler));
         let mut cargo = builder.cargo(compiler, Mode::Libstd, target, "build");
-        std_cargo(build, &compiler, target, &mut cargo);
+        std_cargo(builder, &compiler, target, &mut cargo);
         run_cargo(build,
                   &mut cargo,
                   &libstd_stamp(build, compiler, target),
@@ -135,7 +135,7 @@ fn copy_musl_third_party_objects(build: &Build,
 
 /// Configure cargo to compile the standard library, adding appropriate env vars
 /// and such.
-pub fn std_cargo(build: &Build,
+pub fn std_cargo(build: &Builder,
                  compiler: &Compiler,
                  target: Interned<String>,
                  cargo: &mut Command) {
@@ -162,7 +162,11 @@ pub fn std_cargo(build: &Build,
         // missing
         // We also only build the runtimes when --enable-sanitizers (or its
         // config.toml equivalent) is used
-        cargo.env("LLVM_CONFIG", build.llvm_config(target));
+        let llvm_config = build.ensure(native::Llvm {
+            target: build.config.build,
+            emscripten: false,
+        });
+        cargo.env("LLVM_CONFIG", llvm_config);
     }
 
     cargo.arg("--features").arg(features)