@@ -143,6 +143,7 @@ fn emit_cgu(
143
143
debug : Option < DebugContext > ,
144
144
unwind_context : UnwindContext ,
145
145
global_asm_object_file : Option < PathBuf > ,
146
+ producer : & str ,
146
147
) -> Result < ModuleCodegenResult , String > {
147
148
let mut product = module. finish ( ) ;
148
149
@@ -152,8 +153,14 @@ fn emit_cgu(
152
153
153
154
unwind_context. emit ( & mut product) ;
154
155
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
+ ) ?;
157
164
158
165
Ok ( ModuleCodegenResult {
159
166
module_regular,
@@ -174,6 +181,7 @@ fn emit_module(
174
181
mut object : cranelift_object:: object:: write:: Object < ' _ > ,
175
182
kind : ModuleKind ,
176
183
name : String ,
184
+ producer_str : & str ,
177
185
) -> Result < CompiledModule , String > {
178
186
if object. format ( ) == cranelift_object:: object:: BinaryFormat :: Elf {
179
187
let comment_section = object. add_section (
@@ -182,7 +190,7 @@ fn emit_module(
182
190
cranelift_object:: object:: SectionKind :: OtherString ,
183
191
) ;
184
192
let mut producer = vec ! [ 0 ] ;
185
- producer. extend ( crate :: debuginfo :: producer ( ) . as_bytes ( ) ) ;
193
+ producer. extend ( producer_str . as_bytes ( ) ) ;
186
194
producer. push ( 0 ) ;
187
195
object. set_section_data ( comment_section, producer, 1 ) ;
188
196
}
@@ -321,6 +329,8 @@ fn module_codegen(
321
329
( cgu_name, cx, module, codegened_functions)
322
330
} ) ;
323
331
332
+ let producer = crate :: debuginfo:: producer ( tcx. sess ) ;
333
+
324
334
OngoingModuleCodegen :: Async ( std:: thread:: spawn ( move || {
325
335
cx. profiler . clone ( ) . generic_activity_with_arg ( "compile functions" , & * cgu_name) . run ( || {
326
336
cranelift_codegen:: timing:: set_thread_profiler ( Box :: new ( super :: MeasuremeProfiler (
@@ -348,6 +358,7 @@ fn module_codegen(
348
358
cx. debug_context ,
349
359
cx. unwind_context ,
350
360
global_asm_object_file,
361
+ & producer,
351
362
)
352
363
} ) ;
353
364
std:: mem:: drop ( token) ;
@@ -453,6 +464,7 @@ pub(crate) fn run_aot(
453
464
product. object ,
454
465
ModuleKind :: Allocator ,
455
466
"allocator_shim" . to_owned ( ) ,
467
+ & crate :: debuginfo:: producer ( tcx. sess ) ,
456
468
) {
457
469
Ok ( allocator_module) => Some ( allocator_module) ,
458
470
Err ( err) => tcx. dcx ( ) . fatal ( err) ,
0 commit comments