Skip to content

Commit afad743

Browse files
committed
Revert "Fix custom relative libdir."
This reverts commit 5bcc365.
1 parent 0ba7d41 commit afad743

File tree

4 files changed

+11
-36
lines changed

4 files changed

+11
-36
lines changed

src/bootstrap/builder.rs

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -634,28 +634,7 @@ impl<'a> Builder<'a> {
634634
if compiler.is_snapshot(self) {
635635
self.rustc_snapshot_libdir()
636636
} else {
637-
match self.config.libdir_relative() {
638-
Some(relative_libdir) if compiler.stage >= 1
639-
=> self.sysroot(compiler).join(relative_libdir),
640-
_ => self.sysroot(compiler).join(libdir(&compiler.host))
641-
}
642-
}
643-
}
644-
645-
/// Returns the compiler's relative libdir where it stores the dynamic libraries that
646-
/// it itself links against.
647-
///
648-
/// For example this returns `lib` on Unix and `bin` on
649-
/// Windows.
650-
pub fn libdir_relative(&self, compiler: Compiler) -> &Path {
651-
if compiler.is_snapshot(self) {
652-
libdir(&self.config.build).as_ref()
653-
} else {
654-
match self.config.libdir_relative() {
655-
Some(relative_libdir) if compiler.stage >= 1
656-
=> relative_libdir,
657-
_ => libdir(&compiler.host).as_ref()
658-
}
637+
self.sysroot(compiler).join(libdir(&compiler.host))
659638
}
660639
}
661640

src/bootstrap/compile.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use filetime::FileTime;
2020
use serde_json;
2121

2222
use crate::dist;
23-
use crate::util::{exe, is_dylib};
23+
use crate::util::{exe, libdir, is_dylib};
2424
use crate::{Compiler, Mode, GitRepo};
2525
use crate::native;
2626

@@ -1005,13 +1005,13 @@ impl Step for Assemble {
10051005

10061006
// Link in all dylibs to the libdir
10071007
let sysroot = builder.sysroot(target_compiler);
1008-
let rustc_libdir = builder.rustc_libdir(target_compiler);
1009-
t!(fs::create_dir_all(&rustc_libdir));
1008+
let sysroot_libdir = sysroot.join(libdir(&*host));
1009+
t!(fs::create_dir_all(&sysroot_libdir));
10101010
let src_libdir = builder.sysroot_libdir(build_compiler, host);
10111011
for f in builder.read_dir(&src_libdir) {
10121012
let filename = f.file_name().into_string().unwrap();
10131013
if is_dylib(&filename) {
1014-
builder.copy(&f.path(), &rustc_libdir.join(&filename));
1014+
builder.copy(&f.path(), &sysroot_libdir.join(&filename));
10151015
}
10161016
}
10171017

src/bootstrap/dist.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use build_helper::output;
1818

1919
use crate::{Compiler, Mode, LLVM_TOOLS};
2020
use crate::channel;
21-
use crate::util::{is_dylib, exe};
21+
use crate::util::{libdir, is_dylib, exe};
2222
use crate::builder::{Builder, RunConfig, ShouldRun, Step};
2323
use crate::compile;
2424
use crate::tool::{self, Tool};
@@ -473,23 +473,21 @@ impl Step for Rustc {
473473
fn prepare_image(builder: &Builder<'_>, compiler: Compiler, image: &Path) {
474474
let host = compiler.host;
475475
let src = builder.sysroot(compiler);
476-
let libdir = builder.rustc_libdir(compiler);
476+
let libdir = libdir(&host);
477477

478478
// Copy rustc/rustdoc binaries
479479
t!(fs::create_dir_all(image.join("bin")));
480480
builder.cp_r(&src.join("bin"), &image.join("bin"));
481481

482482
builder.install(&builder.rustdoc(compiler), &image.join("bin"), 0o755);
483483

484-
let libdir_relative = builder.libdir_relative(compiler);
485-
486484
// Copy runtime DLLs needed by the compiler
487-
if libdir_relative.to_str() != Some("bin") {
488-
for entry in builder.read_dir(&libdir) {
485+
if libdir != "bin" {
486+
for entry in builder.read_dir(&src.join(libdir)) {
489487
let name = entry.file_name();
490488
if let Some(s) = name.to_str() {
491489
if is_dylib(s) {
492-
builder.install(&entry.path(), &image.join(&libdir_relative), 0o644);
490+
builder.install(&entry.path(), &image.join(libdir), 0o644);
493491
}
494492
}
495493
}
@@ -518,8 +516,7 @@ impl Step for Rustc {
518516
.join("bin")
519517
.join(&exe);
520518
// for the rationale about this rename check `compile::copy_lld_to_sysroot`
521-
let dst = image.join(libdir_relative)
522-
.join("rustlib")
519+
let dst = image.join("lib/rustlib")
523520
.join(&*host)
524521
.join("bin")
525522
.join(&exe);

src/bootstrap/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1275,7 +1275,6 @@ impl Build {
12751275
fn install(&self, src: &Path, dstdir: &Path, perms: u32) {
12761276
if self.config.dry_run { return; }
12771277
let dst = dstdir.join(src.file_name().unwrap());
1278-
self.verbose_than(1, &format!("Install {:?} to {:?}", src, dst));
12791278
t!(fs::create_dir_all(dstdir));
12801279
drop(fs::remove_file(&dst));
12811280
{

0 commit comments

Comments
 (0)