<div dir="ltr">Hi Frank,<div><br></div><div>It looks like this was fixed already in r354598. The solution was to resolve symbols by calling findMangledSymbol (which searches the process symbols via RTDyldMemoryManager::getSymbolAddressInProcess) instead of ObjLayer.findSymbol (which only searches JIT'd code).</div><div><br></div><div>Cheers,</div><div>Lang.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, May 6, 2019 at 6:56 PM Lang Hames <<a href="mailto:lhames@gmail.com">lhames@gmail.com</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"><div dir="ltr">I see the problem: The KaleidoscopeJIT in this example isn't searching process symbols. This leads to a "symbol not found" failure when we try to look up math functions, but due to the way legacy ORC lookup works this manifests as a "failure to materialize symbols" error when we try to materialize a function that uses these symbols, rather than a plain "symbol not found" error.<div><br></div><div>I should be able to fix this up tomorrow, and the issue will go away entirely once the tutorials are moved on to concurrent ORC.</div><div><br></div><div>-- Lang.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Mar 26, 2019 at 1:37 PM Frank Winter via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</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,<br>
<br>
I still can't get IR functions to JIT compile with the ORC JIT when they <br>
contain a call to the standard math library. Attached is a minimal exploit.<br>
<br>
The program uses the KaleidoscopeJIT.h that ships with LLVM 8 (except <br>
that I had to expose the Datalayout). It reads from the filesystem an IR <br>
file (filename "func_works.ll" or "func_cos_fails.ll) and asks the ORC <br>
JIT first for the symbol "func_ir" and then for the address.<br>
<br>
In case the file "func_works.ll" was read the program succeeds with:<br>
<br>
symbol found!<br>
address found!<br>
<br>
In case the file "func_cos_fails.ll" was read the program fails with:<br>
<br>
symbol found!<br>
Failure value returned from cantFail wrapped call<br>
UNREACHABLE executed at <br>
install/llvm-8.0-x86-debug/include/llvm/Support/Error.h:732!<br>
Stack dump:<br>
<br>
This was tested on an x86 Linux Ubuntu system.<br>
<br>
Does anyone see what's going on or is it time to file a bug report?<br>
<br>
<br>
Regards,<br>
<br>
Frank<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>
</blockquote></div>