[llvm-dev] MCJIT, can't use with math functions

Lang Hames via llvm-dev llvm-dev at lists.llvm.org
Fri Mar 29 14:37:01 PDT 2019


Hi Frank,

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.

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?

Cheers,
Lang.


On Fri, Mar 22, 2019 at 1:43 PM Frank Winter via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Hi,
>
> for my application (uses Builder and MCJIT) I am making the transition
> LLVM 6.0 -> 8.0.
>
> It runs fine for self-contained functions, but whenever a jit-ed
> function contains calls to the math library (e.g. @cosf) it seems to
> have problems getting the address after successfully finding the symbol:
>
> Failure value returned from cantFail wrapped call
> UNREACHABLE executed at
> ~/toolchain/install/llvm-8.0-x86-debug/include/llvm/Support/Error.h:732!
>
> if (auto Sym = CompileLayer.findSymbol(MangledNameStream.str(),true))
>      {
>        void* fptr = (void *)cantFail(Sym.getAddress());
>
> The last statement fails with the above message.
>
>
> Has anything related to using MCJIT with math library functions changed
> since LLVM 6.0?
>
>
> Best,
>
> Frank
>
>
>
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190329/dab58156/attachment.html>


More information about the llvm-dev mailing list