I'm trying to do some research on dynamic linking in Rust without caring about ABI stability. The reason is that I'm building for an embedded Linux target (ramips running OpenWrt), and since we build the entire image at once, ABI mismatches between Rust versions don't matter. However, what does matter is the binary size.
The stdlib takes up about 300-400kB (I think), and there's one dependency shared between all binaries that also weighs in at about 400kB. For 4-8 binaries, this would amount to a saving of up to 6MB or so, which is a huge fraction of the 16MB flash I'm targeting.
However, dynamically linking everything would be unmanageable with OpenWrt's build system. So I need to be able to pick and choose what gets statically compiled and what doesn't.
It's hard to search for, because obviously everyone's mostly interested in ABI stability as a pathway to dynamic linking. But I care about dynamic linking, and not about ABI. Does anyone know of things that people have written about this admittedly niche topic, or experiments for it? It is quite hard to search for, possibly because I don't know the right terms.
Even things that are just hacky proofs-of-concept (not judging!) can be shoehorned into my existing build system, but I have found nothing whatsoever that could even be a starting point.