pub struct LinkOptions {Show 17 fields
pub use_ld: Option<String>,
pub search: Vec<PathBuf>,
pub passthrough: Vec<String>,
pub prefixes: Vec<PathBuf>,
pub sysroot: Option<PathBuf>,
pub cache: Option<PathBuf>,
pub is_static: bool,
pub shared: bool,
pub pie: Option<bool>,
pub no_stdlib: bool,
pub no_startfiles: bool,
pub no_defaultlibs: bool,
pub export_dynamic: bool,
pub strip: bool,
pub no_builtins_lib: bool,
pub pinned: Option<TargetTuple>,
pub profile: bool,
}Expand description
What the command line said about linking.
Kept apart from Options because none of it reaches the compilation. A flag here changes what
the linker is told and changes nothing about the object files handed to it, which is why -lm
on a -c line is a note rather than an error.
Fields§
§use_ld: Option<String>-fuse-ld=<name>, which names a linker rather than a path to one.
search: Vec<PathBuf>-L<dir>, in order, because the linker takes the first library it finds.
passthrough: Vec<String>-Wl,<arg> and -Xlinker <arg>, in order, passed through untouched.
prefixes: Vec<PathBuf>-B<prefix>, which is where to look for the linker before looking on the path.
sysroot: Option<PathBuf>--sysroot=<dir>, which prefixes the directories this looks in.
cache: Option<PathBuf>Where the generated sysroots are, which is crate::cache::dir on a real command line.
None is a caller that was not given one, which outside a test is nothing, and then there
is no cross link line and a foreign target is refused the way it was before there was one.
It is a field rather than a call inside this module because a link line that read the
environment could only be tested on a machine whose environment said the right thing.
is_static: bool-static.
-shared.
pie: Option<bool>-pie or -no-pie, and the platform’s default when neither was written.
no_stdlib: bool-nostdlib, which is -nostartfiles and -nodefaultlibs together.
no_startfiles: bool-nostartfiles.
no_defaultlibs: bool-nodefaultlibs.
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.
no_builtins_lib: bool-fno-builtins-lib, which leaves our own runtime off the line so that the machine’s
libgcc answers for everything instead.
pinned: Option<TargetTuple>The whole ten field target when --target= spelled one, which is where a pinned libc
release is.
None is a command line that named no target at all, and then there is nothing pinned and
this machine is the target. A Triple has room for an architecture, an OS and an
environment and nowhere to put a release, so the release arrives here instead of there, and
cross_sysroot reads it for both of the things it decides: whether this is a cross link
and which directory under the cache it is against.
profile: bool-pg, which changes the link as well as the code.
The counts a profiled program keeps have to be started before main runs and written out
after it returns, and what does both is a start file of its own. So a build that compiles
with the flag and links without it produces a program that calls the hook on every function
and never writes a profile.
Trait Implementations§
Source§impl Clone for LinkOptions
impl Clone for LinkOptions
Source§fn clone(&self) -> LinkOptions
fn clone(&self) -> LinkOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LinkOptions
impl Debug for LinkOptions
Source§impl Default for LinkOptions
impl Default for LinkOptions
Source§fn default() -> LinkOptions
fn default() -> LinkOptions
impl Eq for LinkOptions
Source§impl PartialEq for LinkOptions
impl PartialEq for LinkOptions
impl StructuralPartialEq for LinkOptions
Auto Trait Implementations§
impl Freeze for LinkOptions
impl RefUnwindSafe for LinkOptions
impl Send for LinkOptions
impl Sync for LinkOptions
impl Unpin for LinkOptions
impl UnsafeUnpin for LinkOptions
impl UnwindSafe for LinkOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.