Rollup merge of #86025 - bjorn3:no_rpath_cfg_prefix, r=jackh726
Remove the install prefix from the rpath set when using -Crpath It was broken anyway for rustup installs and nobody seems to have noticed. Fixes https://github.com/rust-lang/rust/issues/82392
This commit is contained in:
commit
fa38fad5a2
4 changed files with 6 additions and 38 deletions
|
@ -1715,24 +1715,14 @@ fn add_rpath_args(
|
|||
) {
|
||||
// FIXME (#2397): At some point we want to rpath our guesses as to
|
||||
// where extern libraries might live, based on the
|
||||
// addl_lib_search_paths
|
||||
// add_lib_search_paths
|
||||
if sess.opts.cg.rpath {
|
||||
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 = rustc_target::target_rustlib_path(&sess.sysroot, target_triple).join("lib");
|
||||
let mut path = PathBuf::from(install_prefix);
|
||||
path.push(&tlib);
|
||||
|
||||
path
|
||||
};
|
||||
let mut rpath_config = RPathConfig {
|
||||
used_crates: &codegen_results.crate_info.used_crates_dynamic,
|
||||
out_filename: out_filename.to_path_buf(),
|
||||
has_rpath: sess.target.has_rpath,
|
||||
is_like_osx: sess.target.is_like_osx,
|
||||
linker_is_gnu: sess.target.linker_is_gnu,
|
||||
get_install_prefix_lib_path: &mut get_install_prefix_lib_path,
|
||||
};
|
||||
cmd.args(&rpath::get_rpath_flags(&mut rpath_config));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue