Detailed design
When -Zsplit-metadata is passed to rustc, it will put the metadata normally inside a rlib or dylib in a separate rmeta file. The rlib/dylib will contain the SVH to prevent accidentally mixing the rmeta and rlib/dylib of different compilations.
Advantages
This would make the increase in size of #56987 easily fixable by deleting the rlib files, while keeping the rmeta files. Those are not necessary anyway, because rustc_driver.so already contains the code.
This will decrease staticlib, dylib and cdylib compilation time, because there is no need to copy all object files to a new archive to remove the rust.metadata.bin file from the rlib.
|
if f.ends_with(RLIB_BYTECODE_EXTENSION) || f == METADATA_FILENAME { |
|
archive.remove_file(&f); |
|
continue |
Disadvantages
Rustc and cargo get a bit more complex.
Detailed design
When
-Zsplit-metadatais passed to rustc, it will put the metadata normally inside arlibordylibin a separatermetafile. Therlib/dylibwill contain the SVH to prevent accidentally mixing thermetaandrlib/dylibof different compilations.Advantages
This would make the increase in size of #56987 easily fixable by deleting the
rlibfiles, while keeping thermetafiles. Those are not necessary anyway, becauserustc_driver.soalready contains the code.This will decrease
staticlib,dylibandcdylibcompilation time, because there is no need to copy all object files to a new archive to remove therust.metadata.binfile from therlib.rust/src/librustc_codegen_llvm/back/link.rs
Lines 1340 to 1342 in 6d9640b
Disadvantages
Rustc and cargo get a bit more complex.