[Lldb-commits] [PATCH] D54747: Discard debuginfo for object files empty after GC

Nico Weber via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri May 17 09:05:06 PDT 2019

thakis added a comment.

For posterity, https://bugs.chromium.org/p/chromium/issues/detail?id=960881#c31 has the explanation for what exactly was happening in the Chromium/Android build. It's a bit different from rnk's example since no cross-TU imports are happening. It likely explains why rnk couldn't find an example that doesn't use thinlto though: To get the bug, you need to require debug info in a TU but all actual code of the TU needs to be stripped. In regular builds this can't happen, but in thinlto builds it can happen in several cases:

- rnk's example: A function is inlined into a different TU for inlining, but the definition (+ debug info) is in a different, now-empty TU.

- my example: An inline function is in two TUs. The thin link step marks one of them as weak_odr and the others as available_externally, which causes the debug info to go into only the TU where the function is weak_odr. If this TU happens to contain no actual code, it will now be dead-stripped, even though the other TUs relied on it to provide debug info. This doesn't require any cross-TU function importing.




More information about the lldb-commits mailing list