Stream: cranelift

Topic: generate binary


view this post on Zulip Juan Bono (Sep 02 2023 at 22:15):

Hi! I want to create an executable binary with my generated code. Is there any tutorial or documentation on how to do it? Any pointer is appreciated :)

view this post on Zulip Afonso Bordado (Sep 03 2023 at 13:54):

:wave: Hey,

We have a crate (cranelift-object) that allows you to take a bunch of functions and emit them into a object file. From there you should be able to feed that into a linker to get a proper executable.

Unfortunately we don't have much documentation for this, but you can see how it is used in clif-util which is an internal development tool.

clif-util doesen't do the linking, but you can look at this example for how to do that.

view this post on Zulip Juan Bono (Sep 03 2023 at 15:29):

Thank you @Afonso Bordado ! These examples help a lot :D


Last updated: Dec 23 2024 at 12:05 UTC