The schedule for this work slipped a little, but I’ve got good news:
First, I’m happy to announce that MachO platform support has landed in . This allows ORC users to load and use MachO support from the ORC runtime with the following idiom:
if (auto P = MachOPlatform::Create(ES, ObjLayer, EPC, PlatformJD,
ES is the ExecutionSession,
ObjLayer is an ObjectLinkingLayer,
EPC is an ExecutorProcessControl instance,
PlatformJD is the JITDylib that the MachO platform symbols should be loaded into, and
OrcRuntimePath is the path on disk of the ORC runtime archive.
Once the MachOPlatform instance has been created and attached to the execution session MachO programs should Just Work under ORC*,* including features like static initializers, static destructors, exceptions, native thread-local-variables, and language runtime support (e.g. for Objective-C and Swift)*. This support should be independent of the program representation added (e.g. object file, LLVM IR, or higher-level module representation), which will enable object-caching schemes to work even in the presence of these features. The support should also work equally for both in-process and out-of-process JITs, making it easier for users to execute JIT’d code in separate processes.
As JITLink ELF support continues to grow, and with the fundamental infrastructure in place, we’re in good shape if anyone wants to start work on a corresponding ELFPlatform.
Speaking of JITLink ELF support, there’s good news on that front too: I’ve added a generic ELFLinkGraphBuilder in  and . This should make it much easier to contribute new ELF backends for JITLink. Generic section/symbol parsing is now handled for you, and you should only need to implement relocation parsing/application for new architectures when bringing up a new ELF backend.
The first new backend that uses the generic ELFLinkGraphBuilder is already up for review at https://reviews.llvm.org/D105429 – Thanks very much to StephenFan for working on that!
Finally, thanks very much to Valentin Churavy for recent improvements to the ORC C APIs in https://reviews.llvm.org/D104672 and https://reviews.llvm.org/D104799. Valentin’s additions enable lazy compilation via the new ORC C bindings, including lazy partitioning of modules. He has provided example code in llvm/examples/OrcV2Examples/OrcV2CBindingsLazy/, and llvm/examples/OrcV2Examples/OrcV2CBindingsVeryLazy/. These APIs are experimental for now (and likely to see some churn as the ORC runtime and related features settle in) but restore some key functionality that was lost when the ORCv1 C bindings were removed.
- This initial commit omitted TLV and language runtime support to try to keep the size down (it was already quite large), but I expect support for those features to land this week.