Auto merge of #81641 - bjorn3:find_codegen_backend, r=davidtwco

Find codegen backends in more locations

* Search in the sysroot passed using `--sysroot` in addition to the default sysroot.
* Search for `librustc_codegen_$name.so` in addition to `librustc_codegen_$name-$release.so`.

This combined would allow putting `librustc_codegen_cranelift.so` in the right location of a sysroot passed using `--sysroot`.
This commit is contained in:
bors 2021-04-06 07:16:19 +00:00
commit 354cc751b7
2 changed files with 19 additions and 10 deletions

View file

@ -795,7 +795,7 @@ pub fn version(binary: &str, matches: &getopts::Matches) {
println!("host: {}", config::host_triple());
println!("release: {}", unw(util::release_str()));
if cfg!(feature = "llvm") {
get_builtin_codegen_backend("llvm")().print_version();
get_builtin_codegen_backend(&None, "llvm")().print_version();
}
}
}
@ -1089,7 +1089,7 @@ pub fn handle_options(args: &[String]) -> Option<getopts::Matches> {
if cg_flags.iter().any(|x| *x == "passes=list") {
if cfg!(feature = "llvm") {
get_builtin_codegen_backend("llvm")().print_passes();
get_builtin_codegen_backend(&None, "llvm")().print_passes();
}
return None;
}