Changing what goes inside a Rust rlib
rust-lang/rust · 4 merged pull requests, 1 open
- Problem
- rustc decided which rlib archive members were Rust object files from their names, which a bundled native library can imitate, and link-only data such as bundled native library filenames was stored with the early crate metadata.
- How far down
- The compiler backend and the metadata format: the archive writer and reader, the LTO paths of the LLVM and GCC backends, native library handling, and object file sections on different platforms.
- What I changed or decided
- Added a lib.rmeta-link archive member that only the linking code reads, deleted the filename heuristic, moved native library filenames into the member, and added a cache so each member is decoded once per link. Review reshaped most of the first design.