[llvm-dev] LLVM 10 ORC2 issue with symbol resolution

Dibyendu Majumdar via llvm-dev llvm-dev at lists.llvm.org
Mon Apr 13 12:13:36 PDT 2020


Hi Lang,

On Mon, 13 Apr 2020 at 19:12, Lang Hames <lhames at gmail.com> wrote:
>
>> I updated my project to LLVM 10.0 today and I am getting JIT symbol resolution errors.
>> I could not find any example or updated tutorial or documentation that describes the new api - as all documentation seems out of date.
>
>
> The doxygen comments should be up-to-date, as should http://llvm.org/docs/ORCv2.html. You can find up-to-date example code for LLJIT in llvm/examples/LLJITExamples (LLVM 10) or llvm/examples/OrcV2Examples (master). If you come across any documentation in master that appears to be out of date please let me know and I will fix it.
>

Sadly http://llvm.org/docs/ORCv2.html is out of date. For example:

auto &JD = ES.getMainJITDylib();

This api no longer exists.

I did look at OrcV2Examples but did not see any that were trying to
set up external symbols. Did I miss something?

> The BuildingAJIT tutorial series is known to be out of date. I'm hoping to have that fixed by LLVM 11 but there is some feature work that I need to complete first.
>
> Can you share the specific errors that you're getting back? I would recommend replacing
>
> cantFail(callToFailingFunc(...));
>
> with
>
> logAllUnhandledErrors(callToFailingFunc(...), errs(), "callToFailingFunc(...) failed:");
>

Okay thank you - I will do that and report back.

> On Mon, Apr 13, 2020 at 10:06 AM Dibyendu Majumdar <mobile at majumdar.org.uk> wrote:
>>
>> Hi,
>>
>> I updated my project to LLVM 10.0 today and I am getting JIT symbol
>> resolution errors.
>> I could not find any example or updated tutorial or documentation that
>> describes the new api - as all documentation seems out of date.
>>
>> I paste below some code snippets that show what I am doing:
>>
>> /* global syms is a array mapping names to function addresses */
>>
>> ES->createJITDylib("<main>");
>> MainJD = ES->getJITDylibByName("<main>");
>> MainJD->addGenerator(
>>     cantFail(llvm::orc::DynamicLibrarySearchGenerator::GetForCurrentProcess(
>>         DL->getGlobalPrefix())));
>> auto &JD = *MainJD;
>> llvm::orc::MangleAndInterner mangle(*ES, *this->DL);
>> llvm::orc::SymbolMap Symbols;
>> for (int i = 0; global_syms[i].name != nullptr; i++) {
>>   Symbols.insert({mangle(global_syms[i].name),
>>
>> llvm::JITEvaluatedSymbol(llvm::pointerToJITTargetAddress(global_syms[i].address),
>>
>> llvm::JITSymbolFlags(llvm::JITSymbolFlags::FlagNames::Absolute))});
>> }
>> llvm::cantFail(JD.define(llvm::orc::absoluteSymbols(Symbols)), "Failed
>> to install extern symbols");
>>
>> FYI - my previous post on similar issue.
>> Basically I haven't been able to get ORC v2 working - tried in 8, 9 and now 10.
>>
>> http://llvm.1065342.n5.nabble.com/llvm-dev-ORC-v2-question-tp130489p130601.html
>>
>> Thanks and Regards
>> Dibyendu


More information about the llvm-dev mailing list