Target option to require explicit cpu
Some targets have many different CPUs and no generic CPU that can be used as a default. For these targets, the user needs to explicitly specify a CPU through `-C target-cpu=`. Add an option for targets and an error message if no CPU is set. This affects the proposed amdgpu and avr targets.
This commit is contained in:
parent
bf6f8a4d32
commit
53238c3db6
7 changed files with 41 additions and 0 deletions
|
@ -616,6 +616,11 @@ pub fn codegen_crate<B: ExtraBackendMethods>(
|
|||
return ongoing_codegen;
|
||||
}
|
||||
|
||||
if tcx.sess.target.need_explicit_cpu && tcx.sess.opts.cg.target_cpu.is_none() {
|
||||
// The target has no default cpu, but none is set explicitly
|
||||
tcx.dcx().emit_fatal(errors::CpuRequired);
|
||||
}
|
||||
|
||||
let cgu_name_builder = &mut CodegenUnitNameBuilder::new(tcx);
|
||||
|
||||
// Run the monomorphization collector and partition the collected items into
|
||||
|
|
|
@ -491,6 +491,10 @@ pub(crate) struct CheckInstalledVisualStudio;
|
|||
#[diag(codegen_ssa_insufficient_vs_code_product)]
|
||||
pub(crate) struct InsufficientVSCodeProduct;
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(codegen_ssa_cpu_required)]
|
||||
pub(crate) struct CpuRequired;
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(codegen_ssa_processing_dymutil_failed)]
|
||||
#[note]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue