morganstanley / hobbes

A language and an embedded JIT compiler
http://hobbes.readthedocs.io/
Apache License 2.0
1.16k stars 105 forks source link

export symbols from "hi" so that .so modules it loads can bind to its compiler #364

Closed kthielen closed 4 years ago

kthielen commented 4 years ago

I tested this manually (defining a symbol in "hi" and leaving it extern in a .so that is loaded by "hi" to observe the late binding back into "hi").

This is important for complex .so modules where we want to dynamically compile functions out of the "hi" host compiler.

kthielen commented 4 years ago

I have a use-case where I want to dynamically load an .so module in "hi" to add a couple of special constraint types and unqualifier implementations (which recursively compile expressions). This won't work correctly unless -rdynamic is used to link "hi" (exporting its symbols to modules it loads).

smunix commented 4 years ago

yes, it's nice to have this. Let's merge it