about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/bootstrap/tool.rs22
1 files changed, 7 insertions, 15 deletions
diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs
index aec75df82c1..bd77f7a91d9 100644
--- a/src/bootstrap/tool.rs
+++ b/src/bootstrap/tool.rs
@@ -655,22 +655,13 @@ impl<'a> Builder<'a> {
     pub fn tool_cmd(&self, tool: Tool) -> Command {
         let mut cmd = Command::new(self.tool_exe(tool));
         let compiler = self.compiler(0, self.config.build);
-        self.prepare_tool_cmd(compiler, &mut cmd);
-        cmd
-    }
-
-    /// Prepares the `cmd` provided to be able to run the `compiler` provided.
-    ///
-    /// Notably this munges the dynamic library lookup path to point to the
-    /// right location to run `compiler`.
-    fn prepare_tool_cmd(&self, compiler: Compiler, cmd: &mut Command) {
         let host = &compiler.host;
+        // Prepares the `cmd` provided to be able to run the `compiler` provided.
+        //
+        // Notably this munges the dynamic library lookup path to point to the
+        // right location to run `compiler`.
         let mut lib_paths: Vec<PathBuf> = vec![
-            if compiler.stage == 0 {
-                self.build.rustc_snapshot_libdir()
-            } else {
-                PathBuf::from(&self.sysroot_libdir(compiler, compiler.host))
-            },
+            self.build.rustc_snapshot_libdir(),
             self.cargo_out(compiler, Mode::ToolBootstrap, *host).join("deps"),
         ];
 
@@ -692,6 +683,7 @@ impl<'a> Builder<'a> {
             }
         }
 
-        add_lib_path(lib_paths, cmd);
+        add_lib_path(lib_paths, &mut cmd);
+        cmd
     }
 }