Skip to content

If Mir doesn't produce regular binaries than how can we use libraries written in other languages? #210

Answered by vnmakarov
rempas asked this question in Q&A
Discussion options

You must be logged in to vote

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…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@rempas
Comment options

Answer selected by rempas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants