Zulip Chat Archive

Stream: lean4

Topic: Reducing binary size


Number Eighteen (Jul 05 2024 at 19:24):

My hello_world binary with no imports compiles at around 5MB in Linux; is there a way to reduce the size of the binary by some build flags or other method?

Henrik Böving (Jul 05 2024 at 19:29):

First thing you can do is strip it, that can usually cut some slack out. Apart from that there is not too much. The runtime is statically linked into the binary as to avoid a dependency on shared objects and that is causing most of the size you are seeing.

Number Eighteen (Jul 05 2024 at 19:59):

Thank you.


Last updated: May 02 2025 at 03:31 UTC