<div dir="ltr"><div dir="ltr">Hi Frank,<div><br></div><div>That error message/location indicates that the JIT was able to "find" the 'cosf' symbol, but not able to get an address for it. That kind of result is usually restricted to JIT'd code: when the JIT find's a not-yet-compiled definition, tries to compile it to get a final address, and fails. It sounds like you are using a libm function though, and I would expect that to either not be found at all, or to be found and trivially have an address.<br></div><div><br></div><div>Are you able to provide some more context? Is the code line you shared from LLVM, or your own ORC-based JIT? Do you have a test case that you can share?</div><div><br></div><div>Cheers,</div><div>Lang.</div><div> </div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Mar 22, 2019 at 1:43 PM Frank Winter via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">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>
for my application (uses Builder and MCJIT) I am making the transition <br>
LLVM 6.0 -> 8.0.<br>
<br>
It runs fine for self-contained functions, but whenever a jit-ed <br>
function contains calls to the math library (e.g. @cosf) it seems to <br>
have problems getting the address after successfully finding the symbol:<br>
<br>
Failure value returned from cantFail wrapped call<br>
UNREACHABLE executed at <br>
~/toolchain/install/llvm-8.0-x86-debug/include/llvm/Support/Error.h:732!<br>
<br>
if (auto Sym = CompileLayer.findSymbol(MangledNameStream.str(),true))<br>
     {<br>
       void* fptr = (void *)cantFail(Sym.getAddress());<br>
<br>
The last statement fails with the above message.<br>
<br>
<br>
Has anything related to using MCJIT with math library functions changed <br>
since LLVM 6.0?<br>
<br>
<br>
Best,<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>