Shared libraries
Shared libraries
Posted Nov 25, 2025 12:02 UTC (Tue) by farnz (subscriber, #17727)In reply to: Shared libraries by ballombe
Parent article: APT Rust requirement raises questions
The problem is more than just parametric polymorphism; it's things like defined constants, semantic meaning of functions and more.
Polymorphism is absolutely fine as long as you are aware that this means that the polymorphic parts of your library live in the caller's binary, not in your binary. Same with defined constants in a header, struct layout etc.
The thing that you need is something that tells you when you've modified something that will be in the caller's binary, not your binary, so that you can undo that breakage. Ideally, you'd also have a way to "shim" your new library, so that old binaries can still link against the new library, and go via the shim that fixes things up so that they continue to work without a rebuild.
But this is a really hard tool to develop; there's a lot hiding in those two sentences. Even just doing the "modified something that will cause breakage" for static linking is hard; and dynamic linking ups the difficulty a notch.
