Function rustc_codegen_ssa::back::link::link_staticlib[][src]

fn link_staticlib<'a, B: ArchiveBuilder<'a>>(
    sess: &'a Session,
    codegen_results: &CodegenResults,
    out_filename: &Path,
    tempdir: &MaybeTempDir
) -> Result<(), ErrorReported>
Expand description

Create a static archive.

This is essentially the same thing as an rlib, but it also involves adding all of the upstream crates’ objects into the archive. This will slurp in all of the native libraries of upstream dependencies as well.

Additionally, there’s no way for us to link dynamic libraries, so we warn about all dynamic library dependencies that they’re not linked in.

There’s no need to include metadata in a static archive, so ensure to not link in the metadata object file (and also don’t prepare the archive with a metadata file).