Check for main in current module before codegen of entry wrapper
This commit is contained in:
parent
2ecffb6fc4
commit
575836ebe3
1 changed files with 5 additions and 0 deletions
|
@ -17,6 +17,11 @@ pub fn maybe_create_entry_wrapper(tcx: TyCtxt<'_>, module: &mut Module<impl Back
|
|||
None => return,
|
||||
};
|
||||
|
||||
let instance = Instance::mono(tcx, main_def_id);
|
||||
if module.get_name(&*tcx.symbol_name(instance).name.as_str()).is_none() {
|
||||
return;
|
||||
}
|
||||
|
||||
create_entry_fn(tcx, module, main_def_id, use_start_lang_item);
|
||||
|
||||
fn create_entry_fn(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue