[llvm] [llvm-dwp] turn duplicate dwo id into warning, continue to gen dwp (PR #121193)

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 30 13:29:33 PST 2024


dwblaikie wrote:

Yeah, pretty much every duplicate DWO ID issue I've tracked down inside google were ultimately benign as far as the DWARF structure is concerned - the same file compiled/linked in twice, and the linker discards one but the dwp actions don't know how to do that (if you're using `dwp -e` you probably wouldn't hit these cases, since the redundant objects would be discarded by the linker)

Some cases might confuse a consumer - I think I saw some cases where /nearly/ empty files ended up with duplicate DWO IDs (totally empty files shouldn't produce a CU so there wouldn't be any duplicate/collission issues. Imagine some code like this: https://godbolt.org/z/qxf1x9bW9 - if there were two files with the same file name (in different directories, or compiled twice with different `-D` in each compilation)  but different contents in `init()` they'd still get the same DWO ID, despite the fact that they're really distinct units, and could share the DWO contents just fine (interpreted with different addresses, etc, provided by the skeleton unit) - I'm guessing current DWARF consumers don't handle this, and just assume it's a bug/mistake/duplicate skeleton unit if two have the same DWO ID. (this example would only work if the objects were force-linked (specified directly on the command line), not on-demand linked (as they would be if they were part of a static archive))

https://github.com/llvm/llvm-project/pull/121193


More information about the llvm-commits mailing list