Hacker News new | ask | show | jobs
by empath75 2946 days ago
rust doesn't use dynamic linking, which contributes a lot to that size.
3 comments

Wont a crate compiled with 'crate_type = "dylib"' be dynamically linked if you specify '-C prefer-dynamic' when compiling your program?

https://doc.rust-lang.org/reference/linkage.html

This is pedantic, but rust does link dynamically, but only to libc.
It can, but for practical reasons, generally does not. For Rust code anyway; often anything bound via FFI is dynamically linked.