Open llvmbot opened 3 years ago
there is a difference between orc-lazy and the other two kinds(orc-mcjit and mcjit) on handling C++ code:
I tried to write a simple jit to simulate orc-lazy's behavior and fix the unresolved symbol issue but without any luck, addGenerator
to impoort symbols from current process didn't work. Lack of throughly understanding of LLVM, I can't fix this on my own.
Hope this info is helpful for your later investigation.
Extended Description
$ cat main.cpp
Compile with 'no-use-cxa-atexit' $ clang++ -S -emit-llvm main.cpp -stdlib=libstdc++ -fno-use-cxa-atexit
the 'main.ll' load fine with lli 'orc-mcjit' and 'mcjit' $ lli --jit-kind=orc-mcjit ./main.ll hi c++ from jit: ./main.ll
$lli --jit-kind=mcjit ./main.ll hi c++ from jit: ./main.ll
while with orc-lazy, I get undefined symbol
$lli --jit-kind=orc-lazy ./main.ll JIT session error: Symbols not found: [ atexit ] JIT session error: Failed to materialize symbols: { (0x23e0c50, { __orc_lcl.cxx_global_var_init.0, _GLOBALsub_I_main.cpp }) }
The issue can be found on both clang10 and clang11.