Moving to ORCv2 - Where are my global constructors and destructors? + More information

Sorry for the spam, but I made some progress with my issue and wanted to share what I found out.

I tried the following line before adding my module to the LLJIT:

“this->mainModule->getFunction("_GLOBAL__sub_I_VectorBIOS.cpp")->isDiscardableIfUnused();” This actually returned true

So I tried the following line:

“this->mainModule->getFunction("_GLOBAL__sub_I_VectorBIOS.cpp")->setLinkage(llvm::GlobalValue::ExternalLinkage);”

Now I was able to find the function and execute the global constructor. For a workaround this works for me.

However, running LLJITs ‘runConstructors’ does still not work, they are still empty.

Sorry for the spam, but I made some progress with my issue and wanted to share what I found out.

I tried the following line before adding my module to the LLJIT:

“this->mainModule->getFunction("_GLOBAL__sub_I_VectorBIOS.cpp")->isDiscardableIfUnused();” This actually returned true

So I tried the following line:

“this->mainModule->getFunction("_GLOBAL__sub_I_VectorBIOS.cpp")->setLinkage(llvm::GlobalValue::ExternalLinkage);”

Now I was able to find the function and execute the global constructor. For a workaround this works for me.

However, running LLJITs ‘runConstructors’ does still not work, they are still empty.