Struct rustc_back::target::TargetOptions
[−]
[src]
pub struct TargetOptions { pub is_builtin: bool, pub linker: String, pub ar: String, pub pre_link_args: Vec<String>, pub pre_link_objects_exe: Vec<String>, pub pre_link_objects_dll: Vec<String>, pub late_link_args: Vec<String>, pub post_link_objects: Vec<String>, pub post_link_args: Vec<String>, pub cpu: String, pub features: String, pub dynamic_linking: bool, pub executables: bool, pub relocation_model: String, pub code_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_osx: bool, pub is_like_solaris: bool, pub is_like_windows: bool, pub is_like_msvc: bool, pub is_like_android: bool, pub linker_is_gnu: bool, pub has_rpath: bool, pub no_compiler_rt: bool, pub no_default_libraries: bool, pub position_independent_executables: bool, pub archive_format: String, pub allow_asm: bool, pub custom_unwind_resume: bool, pub lib_allocation_crate: String, pub exe_allocation_crate: String, pub has_elf_tls: bool, pub obj_is_bitcode: bool, pub max_atomic_width: u64, }
rustc_private
)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
rustc_private
)Whether the target is built-in or loaded from a custom target specification.
linker: String
rustc_private
)Linker to invoke. Defaults to "cc".
ar: String
rustc_private
)Archive utility to use when managing archives. Defaults to "ar".
pre_link_args: Vec<String>
rustc_private
)Linker arguments that are unconditionally passed before any user-defined libraries.
pre_link_objects_exe: Vec<String>
rustc_private
)Objects to link before all others, always found within the sysroot folder.
pre_link_objects_dll: Vec<String>
rustc_private
)late_link_args: Vec<String>
rustc_private
)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>
rustc_private
)Objects to link after all others, always found within the sysroot folder.
post_link_args: Vec<String>
rustc_private
)Linker arguments that are unconditionally passed after any user-defined libraries.
cpu: String
rustc_private
)Default CPU to pass to LLVM. Corresponds to llc -mcpu=$cpu
. Defaults
to "generic".
features: String
rustc_private
)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
rustc_private
)Whether dynamic linking is available on this target. Defaults to false.
executables: bool
rustc_private
)Whether executables are available on this target. iOS, for example, only allows static libraries. Defaults to false.
relocation_model: String
rustc_private
)Relocation model to use in object file. Corresponds to llc -relocation-model=$relocation_model
. Defaults to "pic".
code_model: String
rustc_private
)Code model to use. Corresponds to llc -code-model=$code_model
. Defaults to "default".
disable_redzone: bool
rustc_private
)Do not emit code that uses the "red zone", if the ABI has one. Defaults to false.
eliminate_frame_pointer: bool
rustc_private
)Eliminate frame pointers from stack frames if possible. Defaults to true.
function_sections: bool
rustc_private
)Emit each function in its own section. Defaults to true.
dll_prefix: String
rustc_private
)String to prepend to the name of every dynamic library. Defaults to "lib".
dll_suffix: String
rustc_private
)String to append to the name of every dynamic library. Defaults to ".so".
exe_suffix: String
rustc_private
)String to append to the name of every executable.
staticlib_prefix: String
rustc_private
)String to prepend to the name of every static library. Defaults to "lib".
staticlib_suffix: String
rustc_private
)String to append to the name of every static library. Defaults to ".a".
target_family: Option<String>
rustc_private
)OS family to use for conditional compilation. Valid options: "unix", "windows".
is_like_osx: bool
rustc_private
)Whether the target toolchain is like OSX's. Only useful for compiling against iOS/OS X, in
particular running dsymutil and some other stuff like -dead_strip
. Defaults to false.
is_like_solaris: bool
rustc_private
)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
rustc_private
)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
rustc_private
)is_like_android: bool
rustc_private
)Whether the target toolchain is like Android's. Only useful for compiling against Android. Defaults to false.
linker_is_gnu: bool
rustc_private
)Whether the linker support GNU-like arguments such as -O. Defaults to false.
has_rpath: bool
rustc_private
)Whether the linker support rpaths or not. Defaults to false.
no_compiler_rt: bool
rustc_private
)Whether to disable linking to compiler-rt. Defaults to false, as LLVM will emit references to the functions that compiler-rt provides.
no_default_libraries: bool
rustc_private
)Whether to disable linking to the default libraries, typically corresponds
to -nodefaultlibs
. Defaults to true.
position_independent_executables: bool
rustc_private
)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.
archive_format: String
rustc_private
)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
rustc_private
)Is asm!() allowed? Defaults to true.
custom_unwind_resume: bool
rustc_private
)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.
lib_allocation_crate: String
rustc_private
)Default crate for allocation symbols to link against
exe_allocation_crate: String
rustc_private
)has_elf_tls: bool
rustc_private
)Flag indicating whether ELF TLS (e.g. #[thread_local]) is available for this target.
obj_is_bitcode: bool
rustc_private
)max_atomic_width: u64
rustc_private
)Maximum integer size in bits that this target can perform atomic operations on.
Trait Implementations
impl Default for TargetOptions
[src]
fn default() -> TargetOptions
rustc_private
)Create a set of "sane defaults" for any target. This is still incomplete, and if used for compilation, will certainly not work.
Derived Implementations
impl Debug for TargetOptions
[src]
impl Clone for TargetOptions
[src]
fn clone(&self) -> TargetOptions
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more