]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #92024 - pcwalton:per-codegen-unit-names, r=davidtwco
authorMatthias Krüger <matthias.krueger@famsik.de>
Sat, 18 Dec 2021 13:49:41 +0000 (14:49 +0100)
committerGitHub <noreply@github.com>
Sat, 18 Dec 2021 13:49:41 +0000 (14:49 +0100)
rustc_codegen_llvm: Give each codegen unit a unique DWARF name on all platforms, not just Apple ones.

To avoid breaking split DWARF, we need to ensure that each codegen unit has a
unique `DW_AT_name`. This is because there's a remote chance that different
codegen units for the same module will have entirely identical DWARF entries
for the purpose of the DWO ID, which would violate Appendix F ("Split Dwarf
Object Files") of the DWARF 5 specification. LLVM uses the algorithm specified
in section 7.32 "Type Signature Computation" to compute the DWO ID, which does
not include any fields that would distinguish compilation units. So we must
embed the codegen unit name into the `DW_AT_name`.

Closes #88521.

1  2 
compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs