Auto merge of #95685 - oxidecomputer:restore-static-dwarf, r=pnkfelix
Revert "Work around invalid DWARF bugs for fat LTO"
Since September, the toolchain has not been generating reliable DWARF
information for static variables when LTO is on. This has affected
projects in the embedded space where the use of LTO is typical. In our
case, it has kept us from bumping past the 2021-09-22 nightly toolchain
lest our debugger break. This has been a pretty dramatic regression for
people using debuggers and static variables. See #90357 for more info
and a repro case.
This commit is a mechanical revert of
d5de680e20
from PR #89041, which caused
the issue. (Note on that PR that the commit's author has requested it be
reverted.)
I have locally verified that this fixes #90357 by restoring the
functionality of both the repro case I posted on that bug, and debugger
behavior on real programs. There do not appear to be test cases for this
in the toolchain; if I've missed them, point me at 'em and I'll update
them.
This commit is contained in:
commit
e6c43cf8b9
5 changed files with 95 additions and 27 deletions
|
@ -1715,7 +1715,7 @@ LLVMRustGetBitcodeSliceFromObjectData(const char *data,
|
|||
// Rewrite all `DICompileUnit` pointers to the `DICompileUnit` specified. See
|
||||
// the comment in `back/lto.rs` for why this exists.
|
||||
extern "C" void
|
||||
LLVMRustLTOGetDICompileUnit(LLVMModuleRef Mod,
|
||||
LLVMRustThinLTOGetDICompileUnit(LLVMModuleRef Mod,
|
||||
DICompileUnit **A,
|
||||
DICompileUnit **B) {
|
||||
Module *M = unwrap(Mod);
|
||||
|
@ -1733,7 +1733,7 @@ LLVMRustLTOGetDICompileUnit(LLVMModuleRef Mod,
|
|||
// Rewrite all `DICompileUnit` pointers to the `DICompileUnit` specified. See
|
||||
// the comment in `back/lto.rs` for why this exists.
|
||||
extern "C" void
|
||||
LLVMRustLTOPatchDICompileUnit(LLVMModuleRef Mod, DICompileUnit *Unit) {
|
||||
LLVMRustThinLTOPatchDICompileUnit(LLVMModuleRef Mod, DICompileUnit *Unit) {
|
||||
Module *M = unwrap(Mod);
|
||||
|
||||
// If the original source module didn't have a `DICompileUnit` then try to
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue