3 ms·
> I wish didn't end up being engrained so deep in the toolchain For what it's worth, rustc does support dynamic linking, both for system dependencies and crat
by roblabla 6y ago
> I wish didn't end up being engrained so deep in the toolchain
For what it's worth, rustc does support dynamic linking, both for system dependencies and crates. You can compile a crate with the type `dylib` to produce a dynamic rust library, that can then be linked against when producing a final binary by passing ` -C prefer-dynamic`.
I don't think it's possible to make this work with cargo currently, but there are a couple open issues about it (albeit without much activity).
And of course, rust not having a stable ABI means the exact same rust compiler (and LLVM version, I suppose) would need to be used when compiling the dynamic libraries and final binary.