@@ -143,6 +143,7 @@ fn emit_cgu(
143143 debug : Option < DebugContext > ,
144144 unwind_context : UnwindContext ,
145145 global_asm_object_file : Option < PathBuf > ,
146+ producer : & str ,
146147) -> Result < ModuleCodegenResult , String > {
147148 let mut product = module. finish ( ) ;
148149
@@ -152,8 +153,14 @@ fn emit_cgu(
152153
153154 unwind_context. emit ( & mut product) ;
154155
155- let module_regular =
156- emit_module ( output_filenames, prof, product. object , ModuleKind :: Regular , name. clone ( ) ) ?;
156+ let module_regular = emit_module (
157+ output_filenames,
158+ prof,
159+ product. object ,
160+ ModuleKind :: Regular ,
161+ name. clone ( ) ,
162+ producer,
163+ ) ?;
157164
158165 Ok ( ModuleCodegenResult {
159166 module_regular,
@@ -174,6 +181,7 @@ fn emit_module(
174181 mut object : cranelift_object:: object:: write:: Object < ' _ > ,
175182 kind : ModuleKind ,
176183 name : String ,
184+ producer_str : & str ,
177185) -> Result < CompiledModule , String > {
178186 if object. format ( ) == cranelift_object:: object:: BinaryFormat :: Elf {
179187 let comment_section = object. add_section (
@@ -182,7 +190,7 @@ fn emit_module(
182190 cranelift_object:: object:: SectionKind :: OtherString ,
183191 ) ;
184192 let mut producer = vec ! [ 0 ] ;
185- producer. extend ( crate :: debuginfo :: producer ( ) . as_bytes ( ) ) ;
193+ producer. extend ( producer_str . as_bytes ( ) ) ;
186194 producer. push ( 0 ) ;
187195 object. set_section_data ( comment_section, producer, 1 ) ;
188196 }
@@ -321,6 +329,8 @@ fn module_codegen(
321329 ( cgu_name, cx, module, codegened_functions)
322330 } ) ;
323331
332+ let producer = crate :: debuginfo:: producer ( tcx. sess ) ;
333+
324334 OngoingModuleCodegen :: Async ( std:: thread:: spawn ( move || {
325335 cx. profiler . clone ( ) . generic_activity_with_arg ( "compile functions" , & * cgu_name) . run ( || {
326336 cranelift_codegen:: timing:: set_thread_profiler ( Box :: new ( super :: MeasuremeProfiler (
@@ -348,6 +358,7 @@ fn module_codegen(
348358 cx. debug_context ,
349359 cx. unwind_context ,
350360 global_asm_object_file,
361+ & producer,
351362 )
352363 } ) ;
353364 std:: mem:: drop ( token) ;
@@ -453,6 +464,7 @@ pub(crate) fn run_aot(
453464 product. object ,
454465 ModuleKind :: Allocator ,
455466 "allocator_shim" . to_owned ( ) ,
467+ & crate :: debuginfo:: producer ( tcx. sess ) ,
456468 ) {
457469 Ok ( allocator_module) => Some ( allocator_module) ,
458470 Err ( err) => tcx. dcx ( ) . fatal ( err) ,
0 commit comments