Struct rustc_back::target::TargetOptions
[−]
[src]
pub struct TargetOptions { pub is_builtin: bool, pub linker: String, pub pre_link_args: LinkArgs, pub pre_link_objects_exe: Vec<String>, pub pre_link_objects_dll: Vec<String>, pub late_link_args: LinkArgs, pub post_link_objects: Vec<String>, pub post_link_args: LinkArgs, pub link_env: Vec<(String, String)>, pub asm_args: Vec<String>, pub cpu: String, pub features: String, pub dynamic_linking: bool, pub only_cdylib: bool, pub executables: bool, pub relocation_model: String, pub code_model: String, pub tls_model: String, pub disable_redzone: bool, pub eliminate_frame_pointer: bool, pub function_sections: bool, pub dll_prefix: String, pub dll_suffix: String, pub exe_suffix: String, pub staticlib_prefix: String, pub staticlib_suffix: String, pub target_family: Option<String>, pub is_like_openbsd: bool, pub is_like_osx: bool, pub is_like_solaris: bool, pub is_like_windows: bool, pub is_like_msvc: bool, pub is_like_android: bool, pub is_like_emscripten: bool, pub linker_is_gnu: bool, pub allows_weak_linkage: bool, pub has_rpath: bool, pub no_default_libraries: bool, pub position_independent_executables: bool, pub relro_level: RelroLevel, pub archive_format: String, pub allow_asm: bool, pub custom_unwind_resume: bool, pub exe_allocation_crate: Option<String>, pub has_elf_tls: bool, pub obj_is_bitcode: bool, pub no_integrated_as: bool, pub min_atomic_width: Option<u64>, pub max_atomic_width: Option<u64>, pub panic_strategy: PanicStrategy, pub abi_blacklist: Vec<Abi>, pub crt_static_allows_dylibs: bool, pub crt_static_default: bool, pub crt_static_respected: bool, pub stack_probes: bool, pub min_global_align: Option<u64>, pub default_codegen_units: Option<u64>, pub trap_unreachable: bool, pub requires_lto: bool, pub singlethread: bool, pub no_builtins: bool, pub i128_lowering: bool, }
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
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: bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Whether the target is built-in or loaded from a custom target specification.
linker: String
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Linker to invoke. Defaults to "cc".
pre_link_args: LinkArgs
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Linker arguments that are unconditionally passed before any user-defined libraries.
pre_link_objects_exe: Vec<String>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Objects to link before all others, always found within the sysroot folder.
pre_link_objects_dll: Vec<String>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
late_link_args: LinkArgs
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Linker 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>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Objects to link after all others, always found within the sysroot folder.
post_link_args: LinkArgs
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Linker arguments that are unconditionally passed after any user-defined libraries.
link_env: Vec<(String, String)>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Environment variables to be set before invoking the linker.
asm_args: Vec<String>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Extra arguments to pass to the external assembler (when used)
cpu: String
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Default CPU to pass to LLVM. Corresponds to llc -mcpu=$cpu
. Defaults
to "generic".
features: String
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Default 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: bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Whether dynamic linking is available on this target. Defaults to false.
only_cdylib: bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
If dynamic linking is available, whether only cdylibs are supported.
executables: bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Whether executables are available on this target. iOS, for example, only allows static libraries. Defaults to false.
relocation_model: String
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Relocation model to use in object file. Corresponds to llc -relocation-model=$relocation_model
. Defaults to "pic".
code_model: String
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Code model to use. Corresponds to llc -code-model=$code_model
. Defaults to "default".
tls_model: String
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
TLS 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: bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Do not emit code that uses the "red zone", if the ABI has one. Defaults to false.
eliminate_frame_pointer: bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Eliminate frame pointers from stack frames if possible. Defaults to true.
function_sections: bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Emit each function in its own section. Defaults to true.
dll_prefix: String
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
String to prepend to the name of every dynamic library. Defaults to "lib".
dll_suffix: String
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
String to append to the name of every dynamic library. Defaults to ".so".
exe_suffix: String
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
String to append to the name of every executable.
staticlib_prefix: String
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
String to prepend to the name of every static library. Defaults to "lib".
staticlib_suffix: String
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
String to append to the name of every static library. Defaults to ".a".
target_family: Option<String>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
OS family to use for conditional compilation. Valid options: "unix", "windows".
is_like_openbsd: bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Whether the target toolchain is like OpenBSD's. Only useful for compiling against OpenBSD, for configuring abi when returning a struct.
is_like_osx: bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Whether 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: bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Whether 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: bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Whether 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: bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
is_like_android: bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Whether the target toolchain is like Android's. Only useful for compiling against Android. Defaults to false.
is_like_emscripten: bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Whether the target toolchain is like Emscripten's. Only useful for compiling with Emscripten toolchain. Defaults to false.
linker_is_gnu: bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Whether the linker support GNU-like arguments such as -O. Defaults to false.
allows_weak_linkage: bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
The 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: bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Whether the linker support rpaths or not. Defaults to false.
no_default_libraries: bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Whether to disable linking to the default libraries, typically corresponds
to -nodefaultlibs
. Defaults to true.
position_independent_executables: bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Dynamically 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.
relro_level: RelroLevel
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Either 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: String
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Format 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: bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Is asm!() allowed? Defaults to true.
custom_unwind_resume: bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Whether 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.
exe_allocation_crate: Option<String>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
If necessary, a different crate to link exe allocators by default
has_elf_tls: bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Flag indicating whether ELF TLS (e.g. #[thread_local]) is available for this target.
obj_is_bitcode: bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
no_integrated_as: bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
min_atomic_width: Option<u64>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Don't use this field; instead use the .min_atomic_width()
method.
max_atomic_width: Option<u64>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Don't use this field; instead use the .max_atomic_width()
method.
panic_strategy: PanicStrategy
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Panic strategy: "unwind" or "abort"
abi_blacklist: Vec<Abi>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
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: bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Whether or not linking dylibs to a static CRT is allowed.
crt_static_default: bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Whether or not the CRT is statically linked by default.
crt_static_respected: bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Whether or not crt-static is respected by the compiler (or is a no-op).
stack_probes: bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Whether or not stack probes (__rust_probestack) are enabled
min_global_align: Option<u64>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
The minimum alignment for global symbols.
default_codegen_units: Option<u64>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Default number of codegen units to use in debug mode
trap_unreachable: bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Whether to generate trap instructions in places where optimization would otherwise produce control flow that falls through into unrelated memory.
requires_lto: bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
This target requires everything to be compiled with LTO to emit a final executable, aka there is no native linker for this target.
singlethread: bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
This target has no support for threads.
no_builtins: bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Whether library functions call lowering/optimization is disabled in LLVM for this target unconditionally.
i128_lowering: bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Whether to lower 128-bit operations to compiler_builtins calls. Use if your backend only supports 64-bit and smaller math.
Trait Implementations
impl PartialEq for TargetOptions
[src]
fn eq(&self, __arg_0: &TargetOptions) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &TargetOptions) -> bool
[src]
This method tests for !=
.
impl Clone for TargetOptions
[src]
fn clone(&self) -> TargetOptions
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for TargetOptions
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Default for TargetOptions
[src]
fn default() -> TargetOptions
[src]
Create a set of "sane defaults" for any target. This is still incomplete, and if used for compilation, will certainly not work.