[PATCH] D18683: Fix bug with duplicate struct types in Linker

Sarmad Abdullah via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 16 15:24:03 PDT 2020


sarmadka added a comment.

In D18683#418482 <https://reviews.llvm.org/D18683#418482>, @rafael wrote:

> The direction we are trying to move to is that types are non recursive
>  and always structurally merged.
>
> Cheers,
> Rafael


Why so? It's clearly not working correctly, so why not include the name of the type when determining whether the types are actually the same? I'm currently facing this issue and the conclusion I have now is that Linker is simply not usable for me at all and I have to find another way. Here is the error I'm getting when trying to execute (using LLJIT) a module produced by linking a set of modules:

**Stored value type does not match pointer operand type!**

Here is the original code before linking using Linker::linkModules:

  %11 = call %Gtk_AppWindow* @gtk_application_window_new(%Gtk_App* %10)
  store %Gtk_AppWindow* %11, %Gtk_AppWindow** @window

and here is how it is after the link:

  %11 = call %Gtk_ButtonBox* @gtk_application_window_new(%2* %10)
  store %Gtk_ButtonBox* %11, %4** @window

That is because the types have the same structure so the linker is incorrectly merging them despite having different names. The same exact set of modules passed directly to LLJIT executes correctly.


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

https://reviews.llvm.org/D18683





More information about the llvm-commits mailing list