ORC JIT Weekly #8: Basic OrcV2 C Bindings, MachO and COFF improvements.

Hi All,

I’ve added a very basic set of C bindings for OrcV2 in 633ea07200e, with an example in llvm/example/OrcV2Examples/BasicOrcV2CBindings. Development of the C APIs is being tracked by http://llvm.org/PR31103 – if you’re interested in C APIs for OrcV2 please get involved. I would especially appreciate feedback and patches from C API users: I don’t have a use case for the C APIs myself, so I’m just guessing as to what you need/want most from these APIs.

Other notes from this week:

The JITEventListeners support patch in https://reviews.llvm.org/D75838 will be (re)committed along with some example code as soon as I work out the kinks in the object buffer ownership – Hopefully Monday or Tuesday this week.

LLJIT now enables exception handling for MachO by default (7266a8bfeb8).

RuntimeDyldCOFF will now build stubs for dllimports (337e131ca7de).

JITLink now correctly scopes MachO linker-private symbols (b64afadf306, 9c9eb60b4b), and reads the ‘weak’ flag from the correct nlist field (c700e0317c2).

Stackmaps and DWARF can now be used in the same file without triggering an assertion (3f981cdde90f).

– Lang.

Hi,

I've added a very basic set of C bindings for OrcV2 in 633ea07200e, with an
example in llvm/example/OrcV2Examples/BasicOrcV2CBindings. Development of
the C APIs is being tracked by Design an ORC C-API / ExecutionEngine replacement · Issue #30451 · llvm/llvm-project · GitHub -- if you're
interested in C APIs for OrcV2 please get involved. I would especially
appreciate feedback and patches from C API users: I don't have a use case
for the C APIs myself, so I'm just guessing as to what you need/want most
from these APIs.

Nice! I think the best I can do to validate the new API is to port
postgres to it - unless you have a different wish?

Other notes from this week:

The JITEventListeners support patch in ⚙ D75838 [ORC] Enable JITEventListeners in the RTDyldObjectLinkingLayer. will
be (re)committed along with some example code as soon as I work out the
kinks in the object buffer ownership -- Hopefully Monday or Tuesday this
week.

Cool! I'll verify that I can get a perf profile with the perf listener
using it.

Greetings,

Andres Freund

Hi Andres,

Nice! I think the best I can do to validate the new API is to port
postgres to it - unless you have a different wish?

That sounds great to me!

Cool! I’ll verify that I can get a perf profile with the perf listener
using it.

If you’re registering event listeners via the C API that will be a nice first step: We’ll need to add new functions to the bare-bones C API to register and deregister event listeners.

– Lang.

Hi All,

The JITEventListeners support patch in https://reviews.llvm.org/D75838 will be (re)committed along with some example code as soon as I work out the kinks in the object buffer ownership – Hopefully Monday or Tuesday this week.

Testing on Linux also threw up some thread safety issues related to this that I need to track down, so the new ETA for D75838 is later this week.

– Lang.

Hi All,

The JITEventListener support (https://reviews.llvm.org/D75838) has been re-enabled with fixes in 39253a50f0f.

Andres – Let me know if/when you want to test this out and add C API for it.

Regards,
Lang.