when i have an embedded board with say 64mb storage,a few rust executable will fill them up fast. problem is that rust does not give me option to do dynamic link to its stdlib.
After you do `cargo build --release`, you will notice you hello world EXE is much smaller than a typical rust binary. Like 10~20KB small. On Windows it runs just fine. On Linux, I has to change the exe's RPATH to look for the standard library in the current directory:
patchelf --set-rpath '$ORIGIN' ./exe_name
Anyways, it is possible. The rustc compiler itself is shipped in this way.
as far as i know,this is not officially supported.rust links to its stdlib statically by design. when you have to share this stdlib with a few dynamically linked rust crates it's hard to do in practice.
tried all size reduction tricks,still the size is much large,like 15x large than c,c++. even the stdlib is a 3x larger than to libstdc++