File tree 1 file changed +12
-1
lines changed
src/cargo/core/compiler/build_context
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -463,11 +463,22 @@ impl TargetInfo {
463
463
should_replace_hyphens : true ,
464
464
} )
465
465
} else {
466
+ // Because DWARF Package (dwp) files are produced after the
467
+ // fact by another tool, there is nothing in the binary that
468
+ // provides a means to locate them. By convention, debuggers
469
+ // take the binary filename and append ".dwp" (including to
470
+ // binaries that already have an extension such as shared libs)
471
+ // to find the dwp.
466
472
ret. push ( FileType {
467
- suffix : format ! ( "{}.dwp" , suffix) ,
473
+ // It is important to preserve the existing suffix for
474
+ // e.g. shared libraries, where the dwp for libfoo.so is
475
+ // expected to be at libfoo.so.dwp.
476
+ suffix : format ! ( "{suffix}.dwp" ) ,
468
477
prefix : prefix. clone ( ) ,
469
478
flavor : FileFlavor :: DebugInfo ,
470
479
crate_type : Some ( crate_type. clone ( ) ) ,
480
+ // Likewise, the dwp needs to match the primary artifact's
481
+ // hyphenation exactly.
471
482
should_replace_hyphens : crate_type != CrateType :: Bin ,
472
483
} )
473
484
}
You can’t perform that action at this time.
0 commit comments