Displaying 7 results from an estimated 7 matches for "localcxxruntimeoverrides".
2018 Jun 25
2
runStaticConstructorsDestructors() causes crash on exit
Many thanks for the sample code, Alex. In the end I did it the same way
OrcMCJITReplacement does it. Constructors and destructors are called and,
thanks to LocalCXXRuntimeOverrides, the program does not crash on exit! But
it does seem like there should be a simpler way; the learning curve is
steep...
Geoff
On Thu, 21 Jun 2018 at 12:28, Alex Denisov <1101.debian at gmail.com> wrote:
> Now I see, thanks.
>
> There is no need to do it exactly the same way as Or...
2018 Jun 14
3
runStaticConstructorsDestructors() causes crash on exit
Greetings, LLVM wizards.
I am using clang to compile a C++ module, and an ExecutionEngine (MCJIT) to
execute a function it defines. That works (or pretends to). However, if I
call the module's constructors first:
exec_engine->runStaticConstructorsDestructors(false);
exec_engine->runFunctionAsMain(function, argvec, NULL);
execution still works, but my program crashes when it exits, in
2018 Jun 21
2
runStaticConstructorsDestructors() causes crash on exit
...Orc APIs in this case: there you can
> use custom symbol resolver and redirect atexit functions to your own
> function(s).
> > That function would record atexit handlers, which you can call manually
> after running your program.
> > Orc APIs even provide a class for that: orc::LocalCXXRuntimeOverrides.
> >
> > I think this is the right place to ask such questions.
> > Otherwise, feel free to ping me on #llvm (AlexDenisov) if you need some
> hints on how to JIT native code using Orc APIs.
> >
> > I hope it helps.
> >
> > Cheers,
> > Alex.
> &g...
2018 Jun 19
2
runStaticConstructorsDestructors() causes crash on exit
...itching to Orc APIs in this case: there you can use
> custom symbol resolver and redirect atexit functions to your own
> function(s).
> That function would record atexit handlers, which you can call manually
> after running your program.
> Orc APIs even provide a class for that: orc::LocalCXXRuntimeOverrides.
>
> I think this is the right place to ask such questions.
> Otherwise, feel free to ping me on #llvm (AlexDenisov) if you need some
> hints on how to JIT native code using Orc APIs.
>
> I hope it helps.
>
> Cheers,
> Alex.
>
> > On 14. Jun 2018, at 12:44, Geoff...
2017 Nov 23
2
JIT and atexit crash
Maybe the easiest workaround would be overriding symbol resolution for
the function name and redirect it to your own version in static code
(and hope it has no bad side effect on your use case).
I think when running 3rd party code, the only way to definitely avoid
this kind of trouble is to never deallocate any code or data sections.
Doug Binks mentioned that too in his cppcast about Runtime
2017 Nov 23
1
JIT and atexit crash
Hi,
Not sure whether this matches your use case, but the Orc-based JIT used
in LLI appears to be using `llvm::orc::LocalCXXRuntimeOverrides`
(http://llvm.org/doxygen/classllvm_1_1orc_1_1LocalCXXRuntimeOverrides.html)
to override `__cxa_atexit`:
https://github.com/llvm-mirror/llvm/blob/release_50/tools/lli/OrcLazyJIT.h#L74
https://github.com/llvm-mirror/llvm/blob/release_50/tools/lli/lli.cpp#L631
Best,
Matt
On 11/23/2017 19:49, St...
2019 Mar 15
2
Static constructors with ORC JIT?
Thank you Alex,
I went and implemented a solution along those lines. It works well.
It may be worth mentioning static constructors in the Kaleidoscope tutorial.
Cheers,
Daniele
________________________________________
From: Alex Denisov [1101.debian at gmail.com]
Sent: 15 March 2019 08:07
To: Daniele Vettorel
Cc: llvm-dev at lists.llvm.org
Subject: Re: [llvm-dev] Static constructors with ORC