<div dir="ltr"><div dir="ltr">Hi Dibyendu,<div><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">I had a look - to be honest I am not sure where the error is being<br>reported from. It looks like this:<br>JIT session error: Symbols not found: [ luaV_tointeger_, luaG_runerror ]<br>I don't think it is from any logging I am doing.</blockquote></div><div><br></div><div>Errors in ORC may trigger cascading failures. E.g. if two different modules M1 and M2 both reference a function "foo" which cannot be resolved, then you have three errors: A failure to resolve "foo", A failure to materialize the symbols in M1, and a failure to materialize the symbols in M2. When such a cascade occurs ORC will usually report the original error(s) via ExecutionSession::reportError (which logs them to stderr by default) and return a derived error (e.g. failure-to-materialize) to callers. I believe you're seeing the logged error, and you will see a failure-to-materialize error if you log the result that reaches cantFail in your example above.</div><div><br></div><div>-- Lang.</div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Apr 13, 2020 at 1:18 PM Dibyendu Majumdar <<a href="mailto:mobile@majumdar.org.uk">mobile@majumdar.org.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Hi Lang,<br>
<br>
<br>
> > Can you share the specific errors that you're getting back? I would recommend replacing<br>
> ><br>
> > cantFail(callToFailingFunc(...));<br>
> ><br>
> > with<br>
> ><br>
> > logAllUnhandledErrors(callToFailingFunc(...), errs(), "callToFailingFunc(...) failed:");<br>
> ><br>
><br>
> Okay thank you - I will do that and report back.<br>
<br>
<br>
I had a look - to be honest I am not sure where the error is being<br>
reported from. It looks like this:<br>
<br>
JIT session error: Symbols not found: [ luaV_tointeger_, luaG_runerror ]<br>
<br>
I don't think it is from any logging I am doing.<br>
<br>
><br>
> > On Mon, Apr 13, 2020 at 10:06 AM Dibyendu Majumdar <<a href="mailto:mobile@majumdar.org.uk" target="_blank">mobile@majumdar.org.uk</a>> wrote:<br>
> >><br>
> >> Hi,<br>
> >><br>
> >> I updated my project to LLVM 10.0 today and I am getting JIT symbol<br>
> >> resolution errors.<br>
> >> I could not find any example or updated tutorial or documentation that<br>
> >> describes the new api - as all documentation seems out of date.<br>
> >><br>
> >> I paste below some code snippets that show what I am doing:<br>
> >><br>
> >> /* global syms is a array mapping names to function addresses */<br>
> >><br>
> >> ES->createJITDylib("<main>");<br>
> >> MainJD = ES->getJITDylibByName("<main>");<br>
> >> MainJD->addGenerator(<br>
> >>     cantFail(llvm::orc::DynamicLibrarySearchGenerator::GetForCurrentProcess(<br>
> >>         DL->getGlobalPrefix())));<br>
> >> auto &JD = *MainJD;<br>
> >> llvm::orc::MangleAndInterner mangle(*ES, *this->DL);<br>
> >> llvm::orc::SymbolMap Symbols;<br>
> >> for (int i = 0; global_syms[i].name != nullptr; i++) {<br>
> >>   Symbols.insert({mangle(global_syms[i].name),<br>
> >><br>
> >> llvm::JITEvaluatedSymbol(llvm::pointerToJITTargetAddress(global_syms[i].address),<br>
> >><br>
> >> llvm::JITSymbolFlags(llvm::JITSymbolFlags::FlagNames::Absolute))});<br>
> >> }<br>
> >> llvm::cantFail(JD.define(llvm::orc::absoluteSymbols(Symbols)), "Failed<br>
> >> to install extern symbols");<br>
> >><br>
> >> FYI - my previous post on similar issue.<br>
> >> Basically I haven't been able to get ORC v2 working - tried in 8, 9 and now 10.<br>
> >><br>
> >> <a href="http://llvm.1065342.n5.nabble.com/llvm-dev-ORC-v2-question-tp130489p130601.html" rel="noreferrer" target="_blank">http://llvm.1065342.n5.nabble.com/llvm-dev-ORC-v2-question-tp130489p130601.html</a><br>
> >><br>
> >> Thanks and Regards<br>
> >> Dibyendu<br>
</blockquote></div>