Rollup merge of #116793 - WaffleLapkin:target_rules_the_backend, r=cjgillot
Allow targets to override default codegen backend Implements https://github.com/rust-lang/compiler-team/issues/670.
This commit is contained in:
commit
86af4d25a5
8 changed files with 117 additions and 59 deletions
|
@ -13,7 +13,7 @@ use rustc_session::config::{
|
|||
use rustc_session::lint::Level;
|
||||
use rustc_session::search_paths::SearchPath;
|
||||
use rustc_session::utils::{CanonicalizedPath, NativeLib, NativeLibKind};
|
||||
use rustc_session::{build_session, getopts, CompilerIO, EarlyDiagCtxt, Session};
|
||||
use rustc_session::{build_session, filesearch, getopts, CompilerIO, EarlyDiagCtxt, Session};
|
||||
use rustc_span::edition::{Edition, DEFAULT_EDITION};
|
||||
use rustc_span::symbol::sym;
|
||||
use rustc_span::{FileName, SourceFileHashAlgorithm};
|
||||
|
@ -37,6 +37,12 @@ fn mk_session(matches: getopts::Matches) -> (Session, Cfg) {
|
|||
output_file: None,
|
||||
temps_dir,
|
||||
};
|
||||
|
||||
let sysroot = filesearch::materialize_sysroot(sessopts.maybe_sysroot.clone());
|
||||
|
||||
let target_cfg =
|
||||
rustc_session::config::build_target_config(&early_dcx, &sessopts, None, &sysroot);
|
||||
|
||||
let sess = build_session(
|
||||
early_dcx,
|
||||
sessopts,
|
||||
|
@ -46,7 +52,8 @@ fn mk_session(matches: getopts::Matches) -> (Session, Cfg) {
|
|||
vec![],
|
||||
Default::default(),
|
||||
None,
|
||||
None,
|
||||
target_cfg,
|
||||
sysroot,
|
||||
"",
|
||||
None,
|
||||
Arc::default(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue