[llvm-dev] Inclusion of the ORC runtime in compiler-rt.

Lang Hames via llvm-dev llvm-dev at lists.llvm.org
Mon Apr 12 12:25:57 PDT 2021

Hi All,

I'd like to add the ORC runtime library (preview available at
https://github.com/lhames/llvm-project/tree/orc-runtime-preview) to


ORC, like MCJIT, can link JIT'd code either into the current process
("in-process" mode) or into a remote executor process ("cross-process"
mode). Some JIT features require support code in the executor process, but
the existing ORC libraries are only linked into the JIT process. This has
made cross-process mode support for those features (which include static
initializers, thread local variables, exception handling, and others)
awkward or impractical to implement. The ORC runtime library aims to
provide the necessary support code in a form that is loadable by the JIT
itself, which should allow these features to work uniformly in both modes.

My prototype branch of the ORC runtime (available at
https://github.com/lhames/llvm-project/tree/orc-runtime-preview) has
advanced to the point where it can provide uniform support for static
initializers, destructors, exceptions, thread locals, and language
registration for Objective C and Swift code. This support is all
MachO/Darwin only so far, but should be easily adaptable for ELF/Linux/BSD


The proof of concept implementation has been very successful, so I would
like to move future development to the LLVM main branch so that others can
benefit from this.

Before I start posting patches, though:

Does anyone see any problems with including this in compiler-rt?

Does anyone think that there is a more reasonable home for the ORC runtime
within the llvm-project? I considered LLVM itself, or a new top-level
project, but neither seemed as natural a fit as compiler-rt.

Finally, if everyone is happy for it to be included in principle, are there
any volunteers to review ORC runtime patches?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210412/af1c743b/attachment.html>

More information about the llvm-dev mailing list