From 88d10687b003c97749306a64fc80d7fc89a6d959 Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Fri, 3 May 2024 11:05:31 +0000 Subject: [PATCH] Remove special case in maybe_create_entry_wrapper --- src/driver/jit.rs | 15 ++++++++------- src/main_shim.rs | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/driver/jit.rs b/src/driver/jit.rs index 929fa92596d..6f8be03065f 100644 --- a/src/driver/jit.rs +++ b/src/driver/jit.rs @@ -83,13 +83,6 @@ fn create_jit_module( ); crate::allocator::codegen(tcx, &mut jit_module, &mut cx.unwind_context); - crate::main_shim::maybe_create_entry_wrapper( - tcx, - &mut jit_module, - &mut cx.unwind_context, - true, - true, - ); (jit_module, cx) } @@ -153,6 +146,14 @@ pub(crate) fn run_jit(tcx: TyCtxt<'_>, backend_config: BackendConfig) -> ! { tcx.dcx().fatal("Inline asm is not supported in JIT mode"); } + crate::main_shim::maybe_create_entry_wrapper( + tcx, + &mut jit_module, + &mut cx.unwind_context, + true, + true, + ); + tcx.dcx().abort_if_errors(); jit_module.finalize_definitions().unwrap(); diff --git a/src/main_shim.rs b/src/main_shim.rs index 1f20ec42ddb..f9a729618a5 100644 --- a/src/main_shim.rs +++ b/src/main_shim.rs @@ -29,7 +29,7 @@ pub(crate) fn maybe_create_entry_wrapper( if main_def_id.is_local() { let instance = Instance::mono(tcx, main_def_id).polymorphize(tcx); - if !is_jit && module.get_name(tcx.symbol_name(instance).name).is_none() { + if module.get_name(tcx.symbol_name(instance).name).is_none() { return; } } else if !is_primary_cgu {