HowToUseLLJIT crashes in debug build

Using llvm 9, visual studio, HowToUseLLJIT.cpp

It works fine in a release build. In a debug build It aborts due to an assert failure on Core.cpp (383) because the lhs flags are (Exported | Callable) and the rhs flags are (Callable).

What mods should be made to fix this issue?

Side note: The comments at the top reference HowToUseJIT.cpp rather than HotToUseLLJIT.cpp

Thanks,
Rob Conde

Using llvm 9, visual studio, HowToUseLLJIT.cpp

It works fine in a release build. In a debug build It aborts due to
an assert failure on Core.cpp (383) because the lhs flags are
(Exported | Callable) and the rhs flags are (Callable).

What mods should be made to fix this issue?

Side note: The comments at the top reference HowToUseJIT.cpp rather
than HotToUseLLJIT.cpp

Linux here. HowtoUseLLJIT works for me on LLVM 9 built with GCC 9.2, in
release and debug mode.

But HowToUseJIT fails in both modes as EngineBuilder::create() returns
a nullptr which is not checked for in the example code.

And LLJITWithObjectCache crashes as well because the symbol lookup
seems to fail, leading to the function pointer being NULL.

git master has the same issues. Maybe I'm compiling LLVM in the wrong
way. build config is pretty much default:
cmake -DCMAKE_BUILD_TYPE=Release/Debug -DLLVM_BUILD_LLVM_DYLIB=ON ..

There's an old bug report:
https://bugs.llvm.org/show_bug.cgi?id=38261

The proposed fix for HowToUseJIT does not seem to work anymore.

Best regards,
Frank

Odd. I went to try it on godbolt, but for some reason it can’t find “llvm/IR/Attributes.inc”. In any case I created https://bugs.llvm.org/show_bug.cgi?id=44060. I can try to configure a linux vm at some point to see if I can repo there - doesn’t seem like it should be platform specific :shrug:

Rob