[llvm-dev] LLVM 10 LLJIT runConstructors()
Haoran Xu via llvm-dev
llvm-dev at lists.llvm.org
Fri Oct 16 04:09:01 PDT 2020
I have been struggling with making LLJIT runConstructors() working. I saw this
tried to replicate its logic:
> LLJIT LJ;
> // Add Modules.
> if (auto Err = LJ.runConstructors())
> ... ; // report error.
> But it doesn't seem to work. The global constructors in llvm.global_ctor
doesn't seem to run (I added a printf in the constructor and it doesn't
seem to get executed).
However, the following code seems to work:
> CtorDtorRunner RR(J->getMainJITDylib());
But I can't understand what's wrong with my previous approach by calling
LLJIT's runConstructor() method.
Would anyone kindly help on what part I'm missing? Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev