<div dir="ltr"><div dir="ltr">Hi Emmanuel,<div><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">JIT session error: Symbols not found: { ??3@YAXPEAX_K@Z }</blockquote><div><br></div><div>This is the important bit. You're right that the rest of the error message is likely fallout due to this error.</div><div><br></div><div>Are you using clang++ to compile that snippet? If so, can you send the clang version and invocation that you're using?</div><div><br></div><div>Cheers,</div><div>Lang.</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Apr 8, 2019 at 12:11 PM Emmanuel Thivierge 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"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi,<div><br></div><div>I have been trying to use the new ORC jit to execute a c function using c++ that was compiled to llvm bytecode (clang++.exe -c -g -emit-llvm -std=c++2a -o CxxJit.bc CxxJit.cpp).</div><div>I guess the first thing I need to say is that I am on windows, this could explain why I have those issues.</div><div><br></div><div>The file to jit is this:</div><div><div>#include "CxxJit.h"</div><div>#include <stdio.h></div><div>#include <vector></div><div><br></div><div>extern "C"</div><div>{</div><div>  void doWork()</div><div>  {</div><div>    std::vector<int32_t> vec(10000);</div><div>    printf("doWork() = %d \n", 12);</div><div>  }</div><div>}</div></div><div><br></div><div>Now If I only have the printf everything works but when I try to create a std::vector It fails to lookup the symbol. In the error stream I have one symbol not found and a bunch of symbol that failed to materialize.</div><div><div>JIT session error: Symbols not found: { ??3@YAXPEAX_K@Z }</div><div>Failed to materialize symbols: { ??0?$vector@HV?$allocator@H@std@@@std@@QEAA@_KAEBV?$allocator@H@1@@Z, doWork, ?_Myfirst@?$vector@HV?$allocator@H@std@@@std@@AEAAAEAPEAHXZ, ??$forward@AEBV?$allocator@H@std@@@std@@YAAEBV?$allocator@H@0@AEBV10@@Z, ?_Get_second@?$_Compressed_pair@V?$allocator@H@std@@V?$_Vector_val@U?$_Simple_types@H@std@@@2@$00@std@@QEAAAEAV?$_Vector_val@U?$_Simple_types@H@std@@@2@XZ, ?_Tidy@?$vector@HV?$allocator@H@std@@@std@@AEAAXXZ, ?_Orphan_all@_Container_base0@std@@QEAAXXZ, ??1?$vector@HV?$allocator@H@std@@@std@@QEAA@XZ, ??$?0AEBV?$allocator@H@std@@$$V@?$_Compressed_pair@V?$allocator@H@std@@V?$_Vector_val@U?$_Simple_types@H@std@@@2@$00@std@@QEAA@U_One_then_variadic_args_t@1@AEBV?$allocator@H@1@@Z, ?_Release@_Fake_proxy_ptr_impl@std@@QEAAXXZ, ??0?$allocator@H@std@@QEAA@XZ, ?_Getal@?$vector@HV?$allocator@H@std@@@std@@AEAAAEAV?$allocator@H@2@XZ, ??$_Allocate@$0BA@U_Default_allocate_traits@std@@$0A@@std@@YAPEAX_K@Z, ?_Allocate@_Default_allocate_traits@std@@SAPEAX_K@Z, ??_C@_0BD@OLBABOEK@vector?$DMT?$DO?5too?5long?$AA@, ??1?$_Tidy_guard@V?$vector@HV?$allocator@H@std@@@std@@@std@@QEAA@XZ, ?_Destroy@?$vector@HV?$allocator@H@std@@@std@@AEAAXPEAH0@Z, ?_Getal@?$vector@HV?$allocator@H@std@@@std@@AEBAAEBV?$allocator@H@2@XZ, main, ??$_Construct_n_copies_of_ty@U_Value_init_tag@std@@@?$vector@HV?$allocator@H@std@@@std@@AEAAX_KAEBU_Value_init_tag@1@@Z, ??0_Fake_proxy_ptr_impl@std@@QEAA@AEBU_Fake_allocator@1@AEBU_Container_base0@1@@Z, ?_Buy_nonzero@?$vector@HV?$allocator@H@std@@@std@@AEAAX_K@Z, ?_Orphan_all@?$vector@HV?$allocator@H@std@@@std@@AEAAXXZ, ??$_Allocate_manually_vector_aligned@U_Default_allocate_traits@std@@@std@@YAPEAX_K@Z, ?_Mylast@?$vector@HV?$allocator@H@std@@@std@@AEAAAEAPEAHXZ, ?max_size@?$vector@HV?$allocator@H@std@@@std@@QEBA_KXZ, ??$_Zero_range@PEAH@std@@YAPEAHQEAH0@Z, ?max_size@?$_Default_allocator_traits@V?$allocator@H@std@@@std@@SA_KAEBV?$allocator@H@2@@Z, ?_Adjust_manually_vector_aligned@std@@YAXAEAPEAXAEA_K@Z, ?deallocate@?$allocator@H@std@@QEAAXQEAH_K@Z, ?max@?$numeric_limits@_J@std@@SA_JXZ, ??$_Uninitialized_value_construct_n@PEAH_KV?$allocator@H@std@@@std@@YAPEAHPEAH_KAEAV?$allocator@H@0@@Z, ??$_Destroy_range@V?$allocator@H@std@@@std@@YAXPEAH0AEAV?$allocator@H@0@@Z, ?_Get_data@?$vector@HV?$allocator@H@std@@@std@@AEAAAEAV?$_Vector_val@U?$_Simple_types@H@std@@@2@XZ, ?_Get_first@?$_Compressed_pair@V?$allocator@H@std@@V?$_Vector_val@U?$_Simple_types@H@std@@@2@$00@std@@QEAAAEAV?$allocator@H@2@XZ, ??$_Min_value@_K@std@@YAAEB_KAEB_K0@Z, ??$_Get_size_of_n@$03@std@@YA_K_K@Z, ?_Ufill@?$vector@HV?$allocator@H@std@@@std@@AEAAPEAHPEAH_KU_Value_init_tag@2@@Z, ??$_Uninitialized_value_construct_n1@PEAH_KV?$allocator@H@std@@@std@@YAPEAHPEAH_KAEAV?$allocator@H@0@U?$integral_constant@_N$00@0@@Z, ??0?$_Vector_val@U?$_Simple_types@H@std@@@std@@QEAA@XZ, ?_Buy_raw@?$vector@HV?$allocator@H@std@@@std@@AEAAX_K@Z, ?allocate@?$allocator@H@std@@QEAAPEAH_K@Z, ?_Get_first@?$_Compressed_pair@V?$allocator@H@std@@V?$_Vector_val@U?$_Simple_types@H@std@@@2@$00@std@@QEBAAEBV?$allocator@H@2@XZ, ??$_Deallocate@$0BA@$0A@@std@@YAXPEAX_K@Z, ?_Xlength@?$vector@HV?$allocator@H@std@@@std@@CAXXZ }</div></div><div><br></div><div>You can see the code that I am using here:</div><div><a href="https://gist.github.com/monamimani/1d8c5287eeaf83d5a6f619699d0c52c4" target="_blank">https://gist.github.com/monamimani/1d8c5287eeaf83d5a6f619699d0c52c4</a><br></div><div><br></div><div>There is a bunch of reason I can imagine why this would happen:</div><div>- The symbol are not there, I recently discover this llvm::sys::DynamicLibrary::LoadLibraryPermanently(nullptr); but it doesn't change anything.,</div><div>- I am using this helper class <a href="http://llvm.org/doxygen/classllvm_1_1orc_1_1LLJIT.html" target="_blank">http://llvm.org/doxygen/classllvm_1_1orc_1_1LLJIT.html</a>, maybe the setup is not complet. I tried to compare with the example <a href="https://llvm.org/docs/tutorial/BuildingAJIT1.html" target="_blank">https://llvm.org/docs/tutorial/BuildingAJIT1.html</a>, maybe I missed something.</div>- The other thing I am considering is that llvm::orc::RTDyldObjectLinkingLayer is not working on windows and I would need to use llvm::orc::LegacyRTDyldObjectLinkingLayer ( because of the bool ExportedSymbolsOnly parameter in the findSymbol function.<br><br>Does anybody have a hint about what I might try to fix this?<br><br>Thanks a lot.<br>Emmanuel</div></div></div></div></div></div></div></div>
_______________________________________________<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>