This is an archive of the discontinued LLVM Phabricator instance.

[Kaleidoscope] Fix Kaleidoscope JIT symbol resolution error on Windows
ClosedPublic

Authored by justice_adams on Jul 29 2021, 9:13 AM.

Details

Reviewers
lhames
bkramer
Summary

Currently, when a user builds and runs the Kaleidoscope tutorial on Windows they will run into the following error when attempting to execute basic statements through the JIT

Assertion failed: (KV.second.getFlags() & ~WeakFlags) == (I->second & ~WeakFlags) && "Resolving symbol with incorrect flags", file llvm\lib\ExecutionEngine\Orc\Core.cpp, line 2674

This patch fixes the issue by claiming responsibility for COFF symbols when the user is running on Windows. This is exactly how LLJIT does it, so I mimicked it here.
https://reviews.llvm.org/source/llvm-github/browse/main/llvm/lib/ExecutionEngine/Orc/LLJIT.cpp$669

Diff Detail

Event Timeline

justice_adams requested review of this revision.Jul 29 2021, 9:13 AM
justice_adams created this revision.
lhames accepted this revision.Aug 14 2021, 6:32 PM

LGTM. Thanks Justice!

This revision is now accepted and ready to land.Aug 14 2021, 6:32 PM

Hi @lhames , thanks for the review. Could I have you commit this for me? I do not have commit access

@lhames Ping to commit this if you're able :)

lhames closed this revision.Sep 16 2021, 11:15 PM

Sorry for the very belated update on this: It looks like the fix was committed in da83b70a6fe for https://reviews.llvm.org/D108348 (which was actually submitted after this was accepted, my apologies for the mix up!).