pub struct Invocation<'a> {
pub inputs: &'a [Item],
pub output: Option<&'a Path>,
pub mode: LinkMode,
pub search: &'a [PathBuf],
pub no_startfiles: bool,
pub no_defaultlibs: bool,
pub no_builtins_lib: bool,
pub builtins: Option<&'a Path>,
pub export_dynamic: bool,
pub strip: bool,
pub gui: bool,
pub unicode: 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.
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.
builtins: Option<&'a Path>Our own runtime archive for this target, if it is on the machine.
A path from the caller rather than a name this crate joins onto the sysroot, because it is
the compiler’s own output for the target and not the platform’s, and a fetched sysroot will
never hold it. The driver is what looks for it, in the -B prefixes and then beside the
compiler, and None is what it says when there is none: the line goes without it and
whatever wanted a wide divide is undefined. See crate::link::BUILTINS.
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.
gui: bool-mwindows, which makes a Windows program a GUI one: the windows subsystem, so no console
is opened for it, and GDI and the common dialogs on the line the way gcc puts them there.
Nothing on any other target.
unicode: bool-municode, which starts a Windows program at wmain or wWinMain through crt2u.o
instead of crt2.o. Nothing for a DLL or on any other target.