[−][src]Struct rustc_target::spec::TargetOptions  
Optional aspects of a target specification.
This has an implementation of Default, see each field for what the default is. In general,
these try to take "minimal defaults" that don't assume anything about the runtime they run in.
Fields
is_builtin: boolWhether the target is built-in or loaded from a custom target specification.
linker: Option<String>Linker to invoke
lld_flavor: LldFlavorLLD flavor
pre_link_args: LinkArgsLinker arguments that are passed before any user-defined libraries.
pre_link_args_crt: LinkArgspre_link_objects_exe: Vec<String>Objects to link before all others, always found within the sysroot folder.
pre_link_objects_exe_crt: Vec<String>pre_link_objects_dll: Vec<String>late_link_args: LinkArgsLinker arguments that are unconditionally passed after any user-defined but before post_link_objects. Standard platform libraries that should be always be linked to, usually go here.
post_link_objects: Vec<String>Objects to link after all others, always found within the sysroot folder.
post_link_objects_crt: Vec<String>post_link_args: LinkArgsLinker arguments that are unconditionally passed after any user-defined libraries.
link_env: Vec<(String, String)>Environment variables to be set before invoking the linker.
asm_args: Vec<String>Extra arguments to pass to the external assembler (when used)
cpu: StringDefault CPU to pass to LLVM. Corresponds to llc -mcpu=$cpu. Defaults
to "generic".
features: StringDefault target features to pass to LLVM. These features will always be
passed, and cannot be disabled even via -C. Corresponds to llc -mattr=$features.
dynamic_linking: boolWhether dynamic linking is available on this target. Defaults to false.
only_cdylib: boolIf dynamic linking is available, whether only cdylibs are supported.
executables: boolWhether executables are available on this target. iOS, for example, only allows static libraries. Defaults to false.
relocation_model: StringRelocation model to use in object file. Corresponds to llc -relocation-model=$relocation_model. Defaults to "pic".
code_model: Option<String>Code model to use. Corresponds to llc -code-model=$code_model.
tls_model: StringTLS model to use. Options are "global-dynamic" (default), "local-dynamic", "initial-exec" and "local-exec". This is similar to the -ftls-model option in GCC/Clang.
disable_redzone: boolDo not emit code that uses the "red zone", if the ABI has one. Defaults to false.
eliminate_frame_pointer: boolEliminate frame pointers from stack frames if possible. Defaults to true.
function_sections: boolEmit each function in its own section. Defaults to true.
dll_prefix: StringString to prepend to the name of every dynamic library. Defaults to "lib".
dll_suffix: StringString to append to the name of every dynamic library. Defaults to ".so".
exe_suffix: StringString to append to the name of every executable.
staticlib_prefix: StringString to prepend to the name of every static library. Defaults to "lib".
staticlib_suffix: StringString to append to the name of every static library. Defaults to ".a".
target_family: Option<String>OS family to use for conditional compilation. Valid options: "unix", "windows".
abi_return_struct_as_int: boolWhether the target toolchain's ABI supports returning small structs as an integer.
is_like_osx: boolWhether the target toolchain is like macOS's. Only useful for compiling against iOS/macOS,
in particular running dsymutil and some other stuff like -dead_strip. Defaults to false.
is_like_solaris: boolWhether the target toolchain is like Solaris's. Only useful for compiling against Illumos/Solaris, as they have a different set of linker flags. Defaults to false.
is_like_windows: boolWhether the target toolchain is like Windows'. Only useful for compiling against Windows, only really used for figuring out how to find libraries, since Windows uses its own library naming convention. Defaults to false.
is_like_msvc: boolis_like_android: boolWhether the target toolchain is like Android's. Only useful for compiling against Android. Defaults to false.
is_like_emscripten: boolWhether the target toolchain is like Emscripten's. Only useful for compiling with Emscripten toolchain. Defaults to false.
is_like_fuchsia: boolWhether the target toolchain is like Fuchsia's.
linker_is_gnu: boolWhether the linker support GNU-like arguments such as -O. Defaults to false.
allows_weak_linkage: boolThe MinGW toolchain has a known issue that prevents it from correctly handling COFF object files with more than 215 sections. Since each weak symbol needs its own COMDAT section, weak linkage implies a large number sections that easily exceeds the given limit for larger codebases. Consequently we want a way to disallow weak linkage on some platforms.
has_rpath: boolWhether the linker support rpaths or not. Defaults to false.
no_default_libraries: boolWhether to disable linking to the default libraries, typically corresponds
to -nodefaultlibs. Defaults to true.
position_independent_executables: boolDynamically linked executables can be compiled as position independent if the default relocation model of position independent code is not changed. This is a requirement to take advantage of ASLR, as otherwise the functions in the executable are not randomized and can be used during an exploit of a vulnerability in any code.
needs_plt: boolDetermines if the target always requires using the PLT for indirect
library calls or not. This controls the default value of the -Z plt flag.
relro_level: RelroLevelEither partial, full, or off. Full RELRO makes the dynamic linker resolve all symbols at startup and marks the GOT read-only before starting the program, preventing overwriting the GOT.
archive_format: StringFormat that archives should be emitted in. This affects whether we use LLVM to assemble an archive or fall back to the system linker, and currently only "gnu" is used to fall into LLVM. Unknown strings cause the system linker to be used.
allow_asm: boolIs asm!() allowed? Defaults to true.
custom_unwind_resume: boolWhether the target uses a custom unwind resumption routine.
By default LLVM lowers resume instructions into calls to _Unwind_Resume
defined in libgcc. If this option is enabled, the target must provide
eh_unwind_resume lang item.
has_elf_tls: boolFlag indicating whether ELF TLS (e.g., #[thread_local]) is available for this target.
obj_is_bitcode: boolno_integrated_as: boolmin_atomic_width: Option<u64>Don't use this field; instead use the .min_atomic_width() method.
max_atomic_width: Option<u64>Don't use this field; instead use the .max_atomic_width() method.
atomic_cas: boolWhether the target supports atomic CAS operations natively
panic_strategy: PanicStrategyPanic strategy: "unwind" or "abort"
abi_blacklist: Vec<Abi>A blacklist of ABIs unsupported by the current target. Note that generic ABIs are considered to be supported on all platforms and cannot be blacklisted.
crt_static_allows_dylibs: boolWhether or not linking dylibs to a static CRT is allowed.
crt_static_default: boolWhether or not the CRT is statically linked by default.
crt_static_respected: boolWhether or not crt-static is respected by the compiler (or is a no-op).
stack_probes: boolWhether or not stack probes (__rust_probestack) are enabled
min_global_align: Option<u64>The minimum alignment for global symbols.
default_codegen_units: Option<u64>Default number of codegen units to use in debug mode
trap_unreachable: boolWhether to generate trap instructions in places where optimization would otherwise produce control flow that falls through into unrelated memory.
requires_lto: boolThis target requires everything to be compiled with LTO to emit a final executable, aka there is no native linker for this target.
singlethread: boolThis target has no support for threads.
no_builtins: boolWhether library functions call lowering/optimization is disabled in LLVM for this target unconditionally.
i128_lowering: boolWhether to lower 128-bit operations to compiler_builtins calls. Use if your backend only supports 64-bit and smaller math.
codegen_backend: StringThe codegen backend to use for this target, typically "llvm"
The default visibility for symbols in this target should be "hidden" rather than "default"
embed_bitcode: boolWhether or not bitcode is embedded in object files
emit_debug_gdb_scripts: boolWhether a .debug_gdb_scripts section will be added to the output object file
requires_uwtable: boolWhether or not to unconditionally uwtable attributes on functions,
typically because the platform needs to unwind for things like stack
unwinders.
simd_types_indirect: boolWhether or not SIMD types are passed by reference in the Rust ABI,
typically required if a target can be compiled with a mixed set of
target features. This is true by default, and false for targets like
wasm32 where the whole program either has simd or not.
override_export_symbols: Option<Vec<String>>If set, have the linker export exactly these symbols, instead of using the usual logic to figure this out from the crate itself.
merge_functions: MergeFunctionsDetermines how or whether the MergeFunctions LLVM pass should run for this target. Either "disabled", "trampolines", or "aliases". The MergeFunctions pass is generally useful, but some targets may need to opt out. The default is "aliases".
Workaround for: https://github.com/rust-lang/rust/issues/57356
target_mcount: StringUse platform dependent mcount function
Trait Implementations
impl PartialEq<TargetOptions> for TargetOptions[src]
fn eq(&self, other: &TargetOptions) -> bool[src]
fn ne(&self, other: &TargetOptions) -> bool[src]
impl Clone for TargetOptions[src]
fn clone(&self) -> TargetOptions[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl Default for TargetOptions[src]
fn default() -> TargetOptions[src]
Creates a set of "sane defaults" for any target. This is still incomplete, and if used for compilation, will certainly not work.
impl Debug for TargetOptions[src]
Auto Trait Implementations
impl Send for TargetOptions
impl Sync for TargetOptions
Blanket Implementations
impl<T> ToOwned for T where
    T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T, U> Into<U> for T where
    U: From<T>, [src]
U: From<T>,
impl<T> From<T> for T[src]
impl<T, U> TryFrom<U> for T where
    U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> BorrowMut<T> for T where
    T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Borrow<T> for T where
    T: ?Sized, [src]
T: ?Sized,
impl<T> Any for T where
    T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<E> SpecializationError for E[src]
default fn not_found<S, T>(
    trait_name: &'static str, 
    method_name: &'static str
) -> E where
    T: ?Sized, [src]
trait_name: &'static str,
method_name: &'static str
) -> E where
T: ?Sized,
impl<T> Erased for T[src]
impl<T> Send for T where
    T: ?Sized, [src]
T: ?Sized,
impl<T> Sync for T where
    T: ?Sized, [src]
T: ?Sized,