Rollup merge of #123186 - onur-ozkan:llvm-library-bug, r=Kobzol

copy any file from stage0/lib to stage0-sysroot/lib

With the LLVM 18 upgrade, the name of the LLVM library has been changed to something like `libLLVM.so.18.1-rust-1.78.0-beta`, which `is_dylib` function cannot determine as it only looks whether files are ending with ".so" or not.
This change resolves this problem by no longer doing that ".so" check, as we need all files from the stage0/lib as they are all dependency of rustc anyway.

Fixes #122913
This commit is contained in:
Matthias Krüger 2024-03-29 15:17:10 +01:00 committed by GitHub
commit b48411bcd4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -643,13 +643,13 @@ fn run(self, builder: &Builder<'_>) {
t!(fs::create_dir_all(&sysroot_bin_dir)); t!(fs::create_dir_all(&sysroot_bin_dir));
builder.cp_link_r(&stage0_bin_dir, &sysroot_bin_dir); builder.cp_link_r(&stage0_bin_dir, &sysroot_bin_dir);
// Copy all *.so files from stage0/lib to stage0-sysroot/lib // Copy all files from stage0/lib to stage0-sysroot/lib
let stage0_lib_dir = builder.out.join(host).join("stage0/lib"); let stage0_lib_dir = builder.out.join(host).join("stage0/lib");
if let Ok(files) = fs::read_dir(stage0_lib_dir) { if let Ok(files) = fs::read_dir(stage0_lib_dir) {
for file in files { for file in files {
let file = t!(file); let file = t!(file);
let path = file.path(); let path = file.path();
if path.is_file() && is_dylib(&file.file_name().into_string().unwrap()) { if path.is_file() {
builder builder
.copy_link(&path, &sysroot.join("lib").join(path.file_name().unwrap())); .copy_link(&path, &sysroot.join("lib").join(path.file_name().unwrap()));
} }