pub struct Invocation<'a> {Show 16 fields
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,
pub crt: Crt,
pub reactor: bool,
pub gcc: Option<&'a Path>,
pub libgcc: Option<&'a Path>,
}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.
crt: Crt-fms-runtime-lib=, which is /MT or /MD. Only a line for the MSVC environment reads it.
reactor: bool-mexec-model=reactor, which makes a WASI module a reactor: crt1-reactor.o and the entry
_initialize in place of crt1-command.o and _start. Nothing on any other target.
gcc: Option<&'a Path>gcc’s runtime directory for a mingw-w64 target, when the tree the line is against has one.
That is a tree somebody named rather than one this compiler fetched, laid out the way MSYS2
lays out /ucrt64, with gcc’s own files under lib/gcc/<arch>-w64-mingw32/<version>. Its
crtbegin.o goes after the start file and its crtend.o at the very end, the places gcc
puts them, and the directory is searched after the tree’s lib so that a -lgcc finds the
one beside them. LinkLine::mingw leaves both files off a fetched tree, which has no gcc
in it, and nothing on any other target reads this. tamnd/rucc#2573.
libgcc: Option<&'a Path>gcc’s libgcc.a for the target, which goes on after ours.
For what we have not written, which on a mingw-w64 target is the decimal floating point
arithmetic, __bid_adddd3 and the rest of it. After ours so that ours answers for anything
both have, and only what is still undefined by then is taken from it. The driver finds it in
the named tree’s gcc directory or in a mingw-w64 gcc installed on this machine, and when
there is neither a program using _Decimal64 fails to link by those names. tamnd/rucc#2145.