Re:So you want to write a package manager (2016)
by throwaway8941 on Saturday September 07, 2019 @09:37AM
(#20903684)
If I understand you correctly, this is what Rust/Cargo currently do. You can have multiple versions of the same library in transitive dependencies, and it will link them all into the same binary using a name mangling scheme similar to what you describe.
https://stackoverflow.com/questions/51714866/