pub out_filename: PathBuf,
pub is_like_osx: bool,
pub has_rpath: bool,
+ pub linker_is_gnu: bool,
pub get_install_prefix_lib_path: &'a mut FnMut() -> PathBuf,
}
let libs = config.used_crates.clone();
let libs = libs.into_iter().filter_map(|(_, l)| l).collect::<Vec<_>>();
let rpaths = get_rpaths(config, &libs[..]);
- flags.push_all(&rpaths_to_flags(&rpaths[..]));
+ flags.extend_from_slice(&rpaths_to_flags(&rpaths[..]));
+
+ // Use DT_RUNPATH instead of DT_RPATH if available
+ if config.linker_is_gnu {
+ flags.push("-Wl,--enable-new-dtags".to_string());
+ }
+
flags
}
log_rpaths("fallback", &fallback_rpaths[..]);
let mut rpaths = rel_rpaths;
- rpaths.push_all(&fallback_rpaths[..]);
+ rpaths.extend_from_slice(&fallback_rpaths[..]);
// Remove duplicates
let rpaths = minimize_rpaths(&rpaths[..]);
used_crates: Vec::new(),
has_rpath: true,
is_like_osx: true,
+ linker_is_gnu: false,
out_filename: PathBuf::from("bin/rustc"),
get_install_prefix_lib_path: &mut || panic!(),
};
get_install_prefix_lib_path: &mut || panic!(),
has_rpath: true,
is_like_osx: false,
+ linker_is_gnu: true,
};
let res = get_rpath_relative_to_output(config,
Path::new("lib/libstd.so"));