search for: dynamiclibrarysearchgenerator

Displaying 20 results from an estimated 24 matches for "dynamiclibrarysearchgenerator".

2019 Aug 27
2
Orc JIT vs. STL
...gt; Hi Geoff, > I tried it, but I can't able to reproduce it. > > Test Program: > #include <fstream> > int main() > { > std::ifstream stream1, stream2; > stream1.swap(stream2); > return 0; > } > > I didn't get undefined symbols error. I used > DynamicLibrarySearchGenerator::GetForCurrentProcess API to make symbols > from STL visible to ORC JIT. > > On Tue, 27 Aug 2019 at 20:36, Geoff Levner <glevner at gmail.com> wrote: > >> On Tue, Aug 27, 2019 at 4:56 PM Praveen Velliengiri >> <praveenvelliengiri at gmail.com> wrote: >> &gt...
2020 Jul 28
2
ORC JIT Weekly #18 -- TargetProcessControl updates for library loading / searching.
Hi All, This was a quiet week -- the only significant ORC change was to the new TargetProcessControl API [1], which acquired the ability to load libraries and search for symbols in the target process in [2]. A new TargetProcessControl based definition generator is included to take advantage of this, and the LLJITWithTargetProcessControl example has been updated to include it. Regards, Lang. [1]
2019 Sep 18
2
(How) Can I add C standard libraries to JIT?
Hi Yafei, As david told, you can make the symbols of your host process visible to the JIT'd code through DynamicLibrarySearchGenerator::getForCurrentProcess. On Thu, 19 Sep 2019 at 00:46, David Blaikie via llvm-dev < llvm-dev at lists.llvm.org> wrote: > +Lang Hames <lhames at gmail.com> , JITer of JITs. > > I believe there's some kind of resolver you can add that finds symbols in > the current proces...
2019 Sep 19
3
"corrupted size vs. prev_size" when calling ExecutionSession::lookup()
...eBuilder::detectHost(); auto DL = JTMB->getDefaultDataLayoutForTarget(); llvm::orc::IRCompileLayer CompileLayer(ES, ObjectLayer, llvm::orc::ConcurrentIRCompiler(std::move(*JTMB))); llvm::orc::MangleAndInterner Mangle(ES, *DL); ES.getMainJITDylib().setGenerator( llvm::cantFail(llvm::orc::DynamicLibrarySearchGenerator::GetForCurrentProcess(*DL))); // ... large part to generate IR code . if (llvm::verifyModule(*AST::getModule(), &llvm::errs())) { return 0; } else { std::cout << "Verified success\n"; } // run the generated IR code llvm::cantFail(CompileLayer.add(ES.getMainJ...
2019 Aug 13
4
ORC v2 question
Hi Lang, On Tue, 13 Aug 2019 at 22:03, Lang Hames <lhames at gmail.com> wrote: > When you say your code is not getting optimized, do you mean that IR optimizations are not being applied, or that codegen optimizations are not being applied? > > What do you see if you dump the modules before/after running the pass manager on them, like this: > > dbgs() << "Before
2020 Apr 13
4
LLVM 10 ORC2 issue with symbol resolution
...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(l...
2019 Sep 12
2
Questions after completed Kaleidoscope Chapter 1
...> > > > > JIT session error > > > > When I first run the JIT, the message “JIT session error: Symbols not > found: { __security_check_cookie, __security_cookie }” was printed into the > console. > > > > Origin > > Is that message coming from "DynamicLibrarySearchGenerator”? > > > > > > > > Redirect > > Can I somehow redirect this message to a string or something, or silence > it? I want to keep my console output clean. > > > > > > > > Generator function > > > > Why does the generator function looks...
2020 Apr 13
2
LLVM 10 ORC2 issue with symbol resolution
...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({ma...
2019 Sep 12
2
Questions after completed Kaleidoscope Chapter 1
...e - that worked again. What is that instance used for? 1. JIT session error When I first run the JIT, the message "JIT session error: Symbols not found: { __security_check_cookie, __security_cookie }" was printed into the console. * Origin Is that message coming from "DynamicLibrarySearchGenerator"? * Redirect Can I somehow redirect this message to a string or something, or silence it? I want to keep my console output clean. 1. Generator function Why does the generator function looks like this: "SymbolNameSet(JITDylib &Parent, const SymbolNameSet &Names)&qu...
2019 Aug 14
3
ORC v2 question
Hi Lang, On Tue, 13 Aug 2019 at 23:26, Lang Hames <lhames at gmail.com> wrote: >> I also get this message: >> JIT session error: Symbols not found: { raise_error } > > > Ahh -- I see the problem. The DynamicLibrarySearchGenerator is using the getAddressOfSymbol method, which (under the hood) is basically issuing an appropriate dlsym lookup, and that does not find explicitly added symbols. To find explicitly added symbols you need to call DynamicLibrary::SearchForAddressOfSymbol instead, but unfortunately that method's b...
2020 Oct 05
2
LLJIT: __{math}_finite symbols not resolved ?
...ite at GLIBC_2.15 ) but maybe it needs some help on that regard ? Thanks for your quick answer, Jean-Michaël On Mon, Oct 5, 2020 at 7:53 PM Lang Hames <lhames at gmail.com> wrote: > Hi Jean-Michaël, > > How are you trying to provide those symbols to the JIT? Are you using a > DynamicLibrarySearchGenerator to reflect process symbols (or this specific > library's symbols) into the JIT? > > I haven't looked at ELF symbol indirection before -- I'll need to read up > on that before I can provide a sensible answer. It's quite likely that > RuntimeDyld doesn't support it...
2020 Oct 05
2
LLJIT: __{math}_finite symbols not resolved ?
Hello, when building code with -Ofast -ffinite-math-only -ffast-math, clang generates calls to "finite" variants of math functions. This has been the source of a fair amount of issues in a "normal", non-JIT pipeline, which seem to have been fixed over time - a simple fix being recompiling the target app against the new glibc. - https://bugs.llvm.org/show_bug.cgi?id=44842 -
2019 Jun 27
2
Questions about moving from MCJIT to Orc JIT
...t like an entity that generate the address for that symbol), Example: compiler are materializers. So to add symbols to your own JIT you can define them in JITDylib. For example, Suppose you want to add "your host process (on which JIT runs) symbols to the JIT". You can do JD.setGenerator(DynamicLibrarySearchGenerator::GetForCurrentProcess(DL.getGlobalPrefix())) Under hood, ORC normally search for your host symbols in the defGenerator if it can't find symbols anywhere else. You can look at core.cpp at line 1163 to see how it works! I highly recommended you to watch "Updating ORC for Concurrency"...
2019 Aug 27
2
Orc JIT vs. STL
On Tue, Aug 27, 2019 at 4:56 PM Praveen Velliengiri <praveenvelliengiri at gmail.com> wrote: > > HI > Did you run the static constructor and destructor? How did you make your process symbols visible to ORC jit? Yes. It's the constructor that generates the undefined symbol error. We use DynamicLibrary::LoadLibraryPermanently(nullptr) to add process symbols. > Could you
2019 Sep 25
4
Questions after playing around with KaleidoscopeJIT (With source files)
....getMainJITDylib().define Each way worked fine. But I felt that way 2.) was the most annoying way, because I had to provide many other addresses. So what way is the best? Or can I 'freely' choose? Is it possible to have multiple GeneratorFunctions? I would like to use the 'default' DynamicLibrarySearchGenerator plus my own lookup function. Would it also be possible to replace the uses of "?planschiValue@@3HB" directly with the actuall value of "plaschiValue"? Because it is a constant? 2.) Loading multiple modules I created "CM_Orc", which has a function "int helloOrc()&...
2020 Oct 05
2
LLJIT: __{math}_finite symbols not resolved ?
...quick answer, >> >> Jean-Michaël >> >> >> On Mon, Oct 5, 2020 at 7:53 PM Lang Hames <lhames at gmail.com> wrote: >> >>> Hi Jean-Michaël, >>> >>> How are you trying to provide those symbols to the JIT? Are you using a >>> DynamicLibrarySearchGenerator to reflect process symbols (or this specific >>> library's symbols) into the JIT? >>> >>> I haven't looked at ELF symbol indirection before -- I'll need to read >>> up on that before I can provide a sensible answer. It's quite likely that >>...
2019 Nov 12
3
ORC API C Standard/System Libraries
Hi all, First of all, I want to say that I really appreciate all the work that's gone into LLVM, clang and the ORC API. I would be very unlikely to be doing my current project if they weren't available. I'm using the ORC API to JIT some C code (soon to be C++) on Windows. (I was on LLVM 8.0.0 but it didn't handle the 'allocator' attribute so I upgraded to LLVM 9.0.0.)
2019 Sep 18
2
(How) Can I add C standard libraries to JIT?
When I declare some functions in my IR code which belongs to the C standard library(printf for example), the JIT will report that symbol cannot found. So is there any way I can add these libraries to my JIT? P.S. When I using lli, the printf will work, I guess lli is a JIT(right?) and it somehow knows where to find the symbol printf -------------- next part -------------- An HTML attachment was
2020 Apr 13
2
LLVM 10 ORC2 issue with symbol resolution
...rray 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].nam...
2019 Jun 27
2
Questions about moving from MCJIT to Orc JIT
Hi Bjoern, CC'ing Lang hames For questions, 1. In short yes, you can replace the memory manager, default one provided is section memory manager. 2. If you mean by " address of already compiled code", yes you can do that. Like this JITDylib.define(absoluteSymbols, ( Your_own_symbol , JITTargetAddress(Address of function))), now ORC can resolve all the references to Your_own_symbol