-
So Mir produces a ".bmir" files that is a memory binary (if I remember how you said it in the previous post). So how can I combine it with an object file or a library (".so", ".a")? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
bmir is a binary mir representation. It is basically another form of MIR file representation beside MIR textual file representation. Binary form is more compact and much more faster to read than the textual form. To get machine code you still need to generate it from MIR independently how you get it, e.g from reading binary or textual mir files or creating MIR in memory by MIR API (using funcs MIR_new_module, MIR_new_func, MIR_new_insn, etc). To call external functions (e.g. from .so or .a library or code which uses libmir.a) from MIR code, your need to provide If you use external functions implemented on a language different from C, you also need to transform C call ABI (describing how args are passed) used by MIR to call ABI used by the implementation language. |
Beta Was this translation helpful? Give feedback.
bmir is a binary mir representation. It is basically another form of MIR file representation beside MIR textual file representation. Binary form is more compact and much more faster to read than the textual form.
To get machine code you still need to generate it from MIR independently how you get it, e.g from reading binary or textual mir files or creating MIR in memory by MIR API (using funcs MIR_new_module, MIR_new_func, MIR_new_insn, etc).
To call external functions (e.g. from .so or .a library or code which uses libmir.a) from MIR code, your need to provide
import_resolver
function to MIR_link function call. When MIR_link links MIR code and see external (imported) functions/data refer…