Skip to content

Commit

Permalink
Cherry pick changes from ce3abc5.
Browse files Browse the repository at this point in the history
Fix stage 2 builds with a custom libdir.

When copying libstd for the stage 2 compiler, the builder ignores the
configured libdir/libdir_relative configuration parameters.  This causes
the compiler to fail to find libstd, which cause any tools built with the
stage 2 compiler to fail.

To fix this, make the copy steps of rustbuild aware of the libdir_relative
parameter when the stage >= 2.  Also update the dist target to be aware of
the new location of libstd.
  • Loading branch information
Mark-Simulacrum committed Jul 11, 2017
1 parent 28065a5 commit 8ec46cb
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,13 @@ impl<'a> Builder<'a> {
impl<'a> Step<'a> for Libdir<'a> {
type Output = PathBuf;
fn run(self, builder: &Builder) -> PathBuf {
let sysroot = builder.sysroot(self.compiler)
.join("lib").join("rustlib").join(self.target).join("lib");
let lib = if compiler.stage >= 2 && builder.build.config.libdir_relative.is_some() {
builder.build.config.libdir_relative.cloned().unwrap()
} else {
PathBuf::from("lib")
};
let sysroot = builder.sysroot(self.compiler).join(lib)
.join("rustlib").join(self.target).join("lib");
let _ = fs::remove_dir_all(&sysroot);
t!(fs::create_dir_all(&sysroot));
sysroot
Expand Down

0 comments on commit 8ec46cb

Please sign in to comment.