Skip to content

Commit 8ec46cb

Browse files
Cherry pick changes from ce3abc5.
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.
1 parent 28065a5 commit 8ec46cb

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/bootstrap/builder.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,13 @@ impl<'a> Builder<'a> {
192192
impl<'a> Step<'a> for Libdir<'a> {
193193
type Output = PathBuf;
194194
fn run(self, builder: &Builder) -> PathBuf {
195-
let sysroot = builder.sysroot(self.compiler)
196-
.join("lib").join("rustlib").join(self.target).join("lib");
195+
let lib = if compiler.stage >= 2 && builder.build.config.libdir_relative.is_some() {
196+
builder.build.config.libdir_relative.cloned().unwrap()
197+
} else {
198+
PathBuf::from("lib")
199+
};
200+
let sysroot = builder.sysroot(self.compiler).join(lib)
201+
.join("rustlib").join(self.target).join("lib");
197202
let _ = fs::remove_dir_all(&sysroot);
198203
t!(fs::create_dir_all(&sysroot));
199204
sysroot

0 commit comments

Comments
 (0)