mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-04 12:44:40 +00:00
Cherry pick changes from ce3abc5801
.
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.
This commit is contained in:
parent
a1fa2681cf
commit
c7435b52a9
@ -192,8 +192,13 @@ impl<'a> Builder<'a> {
|
|||||||
impl<'a> Step<'a> for Libdir<'a> {
|
impl<'a> Step<'a> for Libdir<'a> {
|
||||||
type Output = PathBuf;
|
type Output = PathBuf;
|
||||||
fn run(self, builder: &Builder) -> PathBuf {
|
fn run(self, builder: &Builder) -> PathBuf {
|
||||||
let sysroot = builder.sysroot(self.compiler)
|
let lib = if compiler.stage >= 2 && builder.build.config.libdir_relative.is_some() {
|
||||||
.join("lib").join("rustlib").join(self.target).join("lib");
|
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);
|
let _ = fs::remove_dir_all(&sysroot);
|
||||||
t!(fs::create_dir_all(&sysroot));
|
t!(fs::create_dir_all(&sysroot));
|
||||||
sysroot
|
sysroot
|
||||||
|
Loading…
Reference in New Issue
Block a user