use crate::dist;
use crate::native;
use crate::tool::SourceType;
-use crate::util::{exe, is_dylib, symlink_dir};
+use crate::util::{exe, is_debug_info, is_dylib, symlink_dir};
use crate::{Compiler, DependencyType, GitRepo, Mode};
#[derive(Debug, PartialOrd, Ord, Copy, Clone, PartialEq, Eq, Hash)]
let src_libdir = builder.sysroot_libdir(build_compiler, host);
for f in builder.read_dir(&src_libdir) {
let filename = f.file_name().into_string().unwrap();
- if is_dylib(&filename) && !proc_macros.contains(&filename) {
+ if (is_dylib(&filename) || is_debug_info(&filename)) && !proc_macros.contains(&filename)
+ {
builder.copy(&f.path(), &rustc_libdir.join(&filename));
}
}
let src_exe = exe("llvm-dwp", target_compiler.host);
let dst_exe = exe("rust-llvm-dwp", target_compiler.host);
let llvm_config_bin = builder.ensure(native::Llvm { target: target_compiler.host });
- let llvm_bin_dir = llvm_config_bin.parent().unwrap();
- builder.copy(&llvm_bin_dir.join(&src_exe), &libdir_bin.join(&dst_exe));
+ if !builder.config.dry_run {
+ let llvm_bin_dir = output(Command::new(llvm_config_bin).arg("--bindir"));
+ let llvm_bin_dir = Path::new(llvm_bin_dir.trim());
+ builder.copy(&llvm_bin_dir.join(&src_exe), &libdir_bin.join(&dst_exe));
+ }
}
// Ensure that `libLLVM.so` ends up in the newly build compiler directory,
if !(filename.ends_with(".rlib")
|| filename.ends_with(".lib")
|| filename.ends_with(".a")
+ || is_debug_info(&filename)
|| is_dylib(&filename)
|| (is_check && filename.ends_with(".rmeta")))
{