Struct rustc_back::target::TargetOptions
[−]
[src]
pub struct TargetOptions {
pub linker: String,
pub pre_link_args: Vec<String>,
pub post_link_args: Vec<String>,
pub pre_link_objects: Vec<String>,
pub post_link_objects: Vec<String>,
pub cpu: String,
pub features: String,
pub dynamic_linking: bool,
pub executables: bool,
pub morestack: 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 is_like_osx: bool,
pub is_like_windows: bool,
pub is_like_android: bool,
pub linker_is_gnu: bool,
pub has_rpath: bool,
pub no_compiler_rt: bool,
pub position_independent_executables: bool,
}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
linker | Unstable Linker to invoke. Defaults to "cc". |
pre_link_args | Unstable Linker arguments that are unconditionally passed before any user-defined libraries. |
post_link_args | Unstable Linker arguments that are unconditionally passed after any user-defined libraries. |
pre_link_objects | Unstable Objects to link before and after all others, always found within the sysroot folder. |
post_link_objects | Unstable |
cpu | Unstable Default CPU to pass to LLVM. Corresponds to |
features | Unstable Default target features to pass to LLVM. These features will always be
passed, and cannot be disabled even via |
dynamic_linking | Unstable Whether dynamic linking is available on this target. Defaults to false. |
executables | Unstable Whether executables are available on this target. iOS, for example, only allows static libraries. Defaults to false. |
morestack | Unstable Whether LLVM's segmented stack prelude is supported by whatever runtime is available. Will emit stack checks and calls to __morestack. Defaults to false. |
relocation_model | Unstable Relocation model to use in object file. Corresponds to |
code_model | Unstable Code model to use. Corresponds to |
disable_redzone | Unstable Do not emit code that uses the "red zone", if the ABI has one. Defaults to false. |
eliminate_frame_pointer | Unstable Eliminate frame pointers from stack frames if possible. Defaults to true. |
function_sections | Unstable Emit each function in its own section. Defaults to true. |
dll_prefix | Unstable String to prepend to the name of every dynamic library. Defaults to "lib". |
dll_suffix | Unstable String to append to the name of every dynamic library. Defaults to ".so". |
exe_suffix | Unstable String to append to the name of every executable. |
staticlib_prefix | Unstable String to prepend to the name of every static library. Defaults to "lib". |
staticlib_suffix | Unstable String to append to the name of every static library. Defaults to ".a". |
is_like_osx | Unstable 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 |
is_like_windows | Unstable 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_android | Unstable Whether the target toolchain is like Android's. Only useful for compiling against Android. Defaults to false. |
linker_is_gnu | Unstable Whether the linker support GNU-like arguments such as -O. Defaults to false. |
has_rpath | Unstable Whether the linker support rpaths or not. Defaults to false. |
no_compiler_rt | Unstable Whether to disable linking to compiler-rt. Defaults to false, as LLVM will emit references to the functions that compiler-rt provides. |
position_independent_executables | Unstable 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. |