pub struct Invocation<'a> {
pub inputs: &'a [Item],
pub output: Option<&'a Path>,
pub mode: LinkMode,
pub search: &'a [PathBuf],
pub passthrough: &'a [String],
pub no_startfiles: bool,
pub no_defaultlibs: bool,
pub no_builtins_lib: bool,
pub export_dynamic: bool,
pub strip: bool,
}Expand description
What the driver knows that the line needs, beyond the target and the sysroot.
A struct because most of it is empty in the common case, and because a function with nine positional parameters of which seven are usually a default is a function somebody calls wrong.
Fields§
§inputs: &'a [Item]The objects and libraries, in the order they were written.
output: Option<&'a Path>-o. Empty means the linker’s own default, which is what a caller testing a line wants.
mode: LinkModeHow the program is linked, which decides the start file and four of the flags.
search: &'a [PathBuf]-L, in the order given. The user’s own, and they come before ours, because somebody who
passed -L meant it to win.
passthrough: &'a [String]-Wl, and -Xlinker, passed through untouched and last, so that anything the user said
wins over anything decided here.
no_startfiles: bool-nostartfiles, which leaves crt1.o, crti.o and crtn.o off.
no_defaultlibs: bool-nodefaultlibs, which leaves the libc and our runtime off.
no_builtins_lib: bool-fno-builtins-lib, which leaves our own runtime off and keeps the libc.
It means something narrower here than it does on a native link. There it leaves ours off so
that the machine’s libgcc answers for the wide arithmetic instead, and there is no libgcc
in a generated sysroot, so here it leaves those names undefined. Which is what somebody
passing it with a -l of their own is asking for, and the link says so by name if they are
not.
export_dynamic: bool-rdynamic, which puts every symbol in the dynamic table so a program can look itself up.
strip: bool-s, which drops the symbol table.
Trait Implementations§
Source§impl<'a> Clone for Invocation<'a>
impl<'a> Clone for Invocation<'a>
Source§fn clone(&self) -> Invocation<'a>
fn clone(&self) -> Invocation<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more