[PATCH] D133452: [ORC] Fix auto-claim of weak defs in ObjectLinkingLayer

Lang Hames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 10 20:45:07 PDT 2022


lhames added a comment.

In D133452#3781181 <https://reviews.llvm.org/D133452#3781181>, @Hahnfeld wrote:

> @lhames I'm running `lli` with the LLVM IR emitted by Clang for something like
>
>   int main() {
>     try {
>       throw 1;
>     } catch (...) { }
>     return 0;
>   }
>
>
>
>> 4dc110a4b83c625502092b127ca0e9eb13824297 <https://reviews.llvm.org/rG4dc110a4b83c625502092b127ca0e9eb13824297> caused us to claim responsibility for weak symbols that survived dead stripping. To trigger the issue that you're seeing I guess that we need to have a symbol that's (a) inserted late in the compiler pipeline, (b) unreferenced in the file that defines it, and (c) used elsewhere. Does that match what you're seeing?
>
> Yes, I've mentioned that commit in my previous comment. I argue that the change in there never worked, and nobody noticed because it's seemingly not needed for x86.

I think I botched the commit message for that commit and that might be contributing to the confusion: Prior to that commit any weak symbol that was //referenced in the graph//, but //wasn't// in the responsibility set was turned into an external symbol (not dead-stripped, as the commit message says). That would result in a missing definition error within the graph containing the definition. That was definitely a bug, and the original commit fixed that issue.

This looks different: The symbol doesn't appear to be referenced in the graph (or if it is then this seems like a dead-stripping bug), but does appear to be referenced somewhere else (otherwise why are we getting a missing symbol error?).

Can you share the IR that you're feeding in? I'd like to try to reproduce this and understand what's going on.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D133452/new/

https://reviews.llvm.org/D133452



More information about the llvm-commits mailing list