Adjust target search algorithm for rustlib path

With this the concerns expressed in #83800 should be addressed.
This commit is contained in:
Simonas Kazlauskas 2021-05-10 19:15:19 +03:00
parent 2fb1dee14b
commit b7c5599d22
5 changed files with 83 additions and 66 deletions

View file

@ -1576,7 +1576,7 @@ fn add_rpath_args(
let target_triple = sess.opts.target_triple.triple();
let mut get_install_prefix_lib_path = || {
let install_prefix = option_env!("CFG_PREFIX").expect("CFG_PREFIX");
let tlib = filesearch::relative_target_lib_path(&sess.sysroot, target_triple);
let tlib = rustc_target::target_rustlib_path(&sess.sysroot, target_triple).join("lib");
let mut path = PathBuf::from(install_prefix);
path.push(&tlib);