rustc_codegen_ssa::back::link

Function linker_with_args

source
fn linker_with_args(
    path: &Path,
    flavor: LinkerFlavor,
    sess: &Session,
    archive_builder_builder: &dyn ArchiveBuilderBuilder,
    crate_type: CrateType,
    tmpdir: &Path,
    out_filename: &Path,
    codegen_results: &CodegenResults,
    self_contained_components: LinkSelfContainedComponents,
) -> Result<Command, ErrorGuaranteed>
Expand description

Produce the linker command line containing linker path and arguments.

When comments in the function say “order-(in)dependent” they mean order-dependence between options and libraries/object files. For example --whole-archive (order-dependent) applies to specific libraries passed after it, and -o (output file, order-independent) applies to the linking process as a whole. Order-independent options may still override each other in order-dependent fashion, e.g --foo=yes --foo=no may be equivalent to --foo=no.