rustc_target: Rename some target options to avoid tautology
`target.target_endian` -> `target.endian` `target.target_c_int_width` -> `target.c_int_width` `target.target_os` -> `target.os` `target.target_env` -> `target.env` `target.target_vendor` -> `target.vendor` `target.target_family` -> `target.os_family` `target.target_mcount` -> `target.mcount`
This commit is contained in:
parent
bf66988aa1
commit
dc004d4809
114 changed files with 218 additions and 243 deletions
|
@ -90,7 +90,7 @@ fn set_instrument_function(cx: &CodegenCx<'ll, '_>, llfn: &'ll Value) {
|
||||||
|
|
||||||
// The function name varies on platforms.
|
// The function name varies on platforms.
|
||||||
// See test/CodeGen/mcount.c in clang.
|
// See test/CodeGen/mcount.c in clang.
|
||||||
let mcount_name = CString::new(cx.sess().target.target_mcount.as_str().as_bytes()).unwrap();
|
let mcount_name = CString::new(cx.sess().target.mcount.as_str().as_bytes()).unwrap();
|
||||||
|
|
||||||
llvm::AddFunctionAttrStringValue(
|
llvm::AddFunctionAttrStringValue(
|
||||||
llfn,
|
llfn,
|
||||||
|
|
|
@ -176,7 +176,7 @@ pub fn get_fn(cx: &CodegenCx<'ll, 'tcx>, instance: Instance<'tcx>) -> &'ll Value
|
||||||
// should use dllimport for functions.
|
// should use dllimport for functions.
|
||||||
if cx.use_dll_storage_attrs
|
if cx.use_dll_storage_attrs
|
||||||
&& tcx.is_dllimport_foreign_item(instance_def_id)
|
&& tcx.is_dllimport_foreign_item(instance_def_id)
|
||||||
&& tcx.sess.target.target_env != "gnu"
|
&& tcx.sess.target.env != "gnu"
|
||||||
{
|
{
|
||||||
unsafe {
|
unsafe {
|
||||||
llvm::LLVMSetDLLStorageClass(llfn, llvm::DLLStorageClass::DllImport);
|
llvm::LLVMSetDLLStorageClass(llfn, llvm::DLLStorageClass::DllImport);
|
||||||
|
|
|
@ -91,7 +91,7 @@ unsafe fn configure_llvm(sess: &Session) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if sess.target.target_os == "emscripten" && sess.panic_strategy() == PanicStrategy::Unwind {
|
if sess.target.os == "emscripten" && sess.panic_strategy() == PanicStrategy::Unwind {
|
||||||
add("-enable-emscripten-cxx-exceptions", false);
|
add("-enable-emscripten-cxx-exceptions", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ fn emit_direct_ptr_va_arg(
|
||||||
let next = bx.inbounds_gep(addr, &[full_direct_size]);
|
let next = bx.inbounds_gep(addr, &[full_direct_size]);
|
||||||
bx.store(next, va_list_addr, bx.tcx().data_layout.pointer_align.abi);
|
bx.store(next, va_list_addr, bx.tcx().data_layout.pointer_align.abi);
|
||||||
|
|
||||||
if size.bytes() < slot_size.bytes() && &*bx.tcx().sess.target.target_endian == "big" {
|
if size.bytes() < slot_size.bytes() && &*bx.tcx().sess.target.endian == "big" {
|
||||||
let adjusted_size = bx.cx().const_i32((slot_size.bytes() - size.bytes()) as i32);
|
let adjusted_size = bx.cx().const_i32((slot_size.bytes() - size.bytes()) as i32);
|
||||||
let adjusted = bx.inbounds_gep(addr, &[adjusted_size]);
|
let adjusted = bx.inbounds_gep(addr, &[adjusted_size]);
|
||||||
(bx.bitcast(adjusted, bx.cx().type_ptr_to(llty)), addr_align)
|
(bx.bitcast(adjusted, bx.cx().type_ptr_to(llty)), addr_align)
|
||||||
|
@ -105,7 +105,7 @@ fn emit_aapcs_va_arg(
|
||||||
let mut end = bx.build_sibling_block("va_arg.end");
|
let mut end = bx.build_sibling_block("va_arg.end");
|
||||||
let zero = bx.const_i32(0);
|
let zero = bx.const_i32(0);
|
||||||
let offset_align = Align::from_bytes(4).unwrap();
|
let offset_align = Align::from_bytes(4).unwrap();
|
||||||
assert!(&*bx.tcx().sess.target.target_endian == "little");
|
assert!(&*bx.tcx().sess.target.endian == "little");
|
||||||
|
|
||||||
let gr_type = target_ty.is_any_ptr() || target_ty.is_integral();
|
let gr_type = target_ty.is_any_ptr() || target_ty.is_integral();
|
||||||
let (reg_off, reg_top_index, slot_size) = if gr_type {
|
let (reg_off, reg_top_index, slot_size) = if gr_type {
|
||||||
|
|
|
@ -163,7 +163,7 @@ fn get_linker(
|
||||||
// MSVC needs to link with the Store versions of the runtime libraries (vcruntime, msvcrt, etc).
|
// MSVC needs to link with the Store versions of the runtime libraries (vcruntime, msvcrt, etc).
|
||||||
let t = &sess.target;
|
let t = &sess.target;
|
||||||
if (flavor == LinkerFlavor::Msvc || flavor == LinkerFlavor::Lld(LldFlavor::Link))
|
if (flavor == LinkerFlavor::Msvc || flavor == LinkerFlavor::Lld(LldFlavor::Link))
|
||||||
&& t.target_vendor == "uwp"
|
&& t.vendor == "uwp"
|
||||||
{
|
{
|
||||||
if let Some(ref tool) = msvc_tool {
|
if let Some(ref tool) = msvc_tool {
|
||||||
let original_path = tool.path();
|
let original_path = tool.path();
|
||||||
|
@ -1236,7 +1236,7 @@ fn crt_objects_fallback(sess: &Session, crate_type: CrateType) -> bool {
|
||||||
Some(CrtObjectsFallback::Musl) => sess.crt_static(Some(crate_type)),
|
Some(CrtObjectsFallback::Musl) => sess.crt_static(Some(crate_type)),
|
||||||
Some(CrtObjectsFallback::Mingw) => {
|
Some(CrtObjectsFallback::Mingw) => {
|
||||||
sess.host == sess.target
|
sess.host == sess.target
|
||||||
&& sess.target.target_vendor != "uwp"
|
&& sess.target.vendor != "uwp"
|
||||||
&& detect_self_contained_mingw(&sess)
|
&& detect_self_contained_mingw(&sess)
|
||||||
}
|
}
|
||||||
// FIXME: Figure out cases in which WASM needs to link with a native toolchain.
|
// FIXME: Figure out cases in which WASM needs to link with a native toolchain.
|
||||||
|
@ -1510,7 +1510,7 @@ fn linker_with_args<'a, B: ArchiveBuilder<'a>>(
|
||||||
let base_cmd = get_linker(sess, path, flavor, crt_objects_fallback);
|
let base_cmd = get_linker(sess, path, flavor, crt_objects_fallback);
|
||||||
// FIXME: Move `/LIBPATH` addition for uwp targets from the linker construction
|
// FIXME: Move `/LIBPATH` addition for uwp targets from the linker construction
|
||||||
// to the linker args construction.
|
// to the linker args construction.
|
||||||
assert!(base_cmd.get_args().is_empty() || sess.target.target_vendor == "uwp");
|
assert!(base_cmd.get_args().is_empty() || sess.target.vendor == "uwp");
|
||||||
let cmd = &mut *codegen_results.linker_info.to_linker(base_cmd, &sess, flavor, target_cpu);
|
let cmd = &mut *codegen_results.linker_info.to_linker(base_cmd, &sess, flavor, target_cpu);
|
||||||
let link_output_kind = link_output_kind(sess, crate_type);
|
let link_output_kind = link_output_kind(sess, crate_type);
|
||||||
|
|
||||||
|
@ -2078,9 +2078,9 @@ fn are_upstream_rust_objects_already_included(sess: &Session) -> bool {
|
||||||
|
|
||||||
fn add_apple_sdk(cmd: &mut dyn Linker, sess: &Session, flavor: LinkerFlavor) {
|
fn add_apple_sdk(cmd: &mut dyn Linker, sess: &Session, flavor: LinkerFlavor) {
|
||||||
let arch = &sess.target.arch;
|
let arch = &sess.target.arch;
|
||||||
let os = &sess.target.target_os;
|
let os = &sess.target.os;
|
||||||
let llvm_target = &sess.target.llvm_target;
|
let llvm_target = &sess.target.llvm_target;
|
||||||
if sess.target.target_vendor != "apple"
|
if sess.target.vendor != "apple"
|
||||||
|| !matches!(os.as_str(), "ios" | "tvos")
|
|| !matches!(os.as_str(), "ios" | "tvos")
|
||||||
|| flavor != LinkerFlavor::Gcc
|
|| flavor != LinkerFlavor::Gcc
|
||||||
{
|
{
|
||||||
|
|
|
@ -320,7 +320,7 @@ impl<'a> Linker for GccLinker<'a> {
|
||||||
// any `#[link]` attributes in the `libc` crate, see #72782 for details.
|
// any `#[link]` attributes in the `libc` crate, see #72782 for details.
|
||||||
// FIXME: Switch to using `#[link]` attributes in the `libc` crate
|
// FIXME: Switch to using `#[link]` attributes in the `libc` crate
|
||||||
// similarly to other targets.
|
// similarly to other targets.
|
||||||
if self.sess.target.target_os == "vxworks"
|
if self.sess.target.os == "vxworks"
|
||||||
&& matches!(
|
&& matches!(
|
||||||
output_kind,
|
output_kind,
|
||||||
LinkOutputKind::StaticNoPicExe
|
LinkOutputKind::StaticNoPicExe
|
||||||
|
|
|
@ -51,11 +51,11 @@ pub trait DerivedTypeMethods<'tcx>: BaseTypeMethods<'tcx> + MiscMethods<'tcx> {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn type_int(&self) -> Self::Type {
|
fn type_int(&self) -> Self::Type {
|
||||||
match &self.sess().target.target_c_int_width[..] {
|
match &self.sess().target.c_int_width[..] {
|
||||||
"16" => self.type_i16(),
|
"16" => self.type_i16(),
|
||||||
"32" => self.type_i32(),
|
"32" => self.type_i32(),
|
||||||
"64" => self.type_i64(),
|
"64" => self.type_i64(),
|
||||||
width => bug!("Unsupported target_c_int_width: {}", width),
|
width => bug!("Unsupported c_int_width: {}", width),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2601,15 +2601,14 @@ where
|
||||||
};
|
};
|
||||||
|
|
||||||
let target = &cx.tcx().sess.target;
|
let target = &cx.tcx().sess.target;
|
||||||
let target_env_gnu_like = matches!(&target.target_env[..], "gnu" | "musl");
|
let target_env_gnu_like = matches!(&target.env[..], "gnu" | "musl");
|
||||||
let win_x64_gnu =
|
let win_x64_gnu = target.os == "windows" && target.arch == "x86_64" && target.env == "gnu";
|
||||||
target.target_os == "windows" && target.arch == "x86_64" && target.target_env == "gnu";
|
|
||||||
let linux_s390x_gnu_like =
|
let linux_s390x_gnu_like =
|
||||||
target.target_os == "linux" && target.arch == "s390x" && target_env_gnu_like;
|
target.os == "linux" && target.arch == "s390x" && target_env_gnu_like;
|
||||||
let linux_sparc64_gnu_like =
|
let linux_sparc64_gnu_like =
|
||||||
target.target_os == "linux" && target.arch == "sparc64" && target_env_gnu_like;
|
target.os == "linux" && target.arch == "sparc64" && target_env_gnu_like;
|
||||||
let linux_powerpc_gnu_like =
|
let linux_powerpc_gnu_like =
|
||||||
target.target_os == "linux" && target.arch == "powerpc" && target_env_gnu_like;
|
target.os == "linux" && target.arch == "powerpc" && target_env_gnu_like;
|
||||||
let rust_abi = matches!(sig.abi, RustIntrinsic | PlatformIntrinsic | Rust | RustCall);
|
let rust_abi = matches!(sig.abi, RustIntrinsic | PlatformIntrinsic | Rust | RustCall);
|
||||||
|
|
||||||
// Handle safe Rust thin and fat pointers.
|
// Handle safe Rust thin and fat pointers.
|
||||||
|
|
|
@ -735,12 +735,12 @@ pub const fn default_lib_output() -> CrateType {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn default_configuration(sess: &Session) -> CrateConfig {
|
pub fn default_configuration(sess: &Session) -> CrateConfig {
|
||||||
let end = &sess.target.target_endian;
|
let end = &sess.target.endian;
|
||||||
let arch = &sess.target.arch;
|
let arch = &sess.target.arch;
|
||||||
let wordsz = sess.target.pointer_width.to_string();
|
let wordsz = sess.target.pointer_width.to_string();
|
||||||
let os = &sess.target.target_os;
|
let os = &sess.target.os;
|
||||||
let env = &sess.target.target_env;
|
let env = &sess.target.env;
|
||||||
let vendor = &sess.target.target_vendor;
|
let vendor = &sess.target.vendor;
|
||||||
let min_atomic_width = sess.target.min_atomic_width();
|
let min_atomic_width = sess.target.min_atomic_width();
|
||||||
let max_atomic_width = sess.target.max_atomic_width();
|
let max_atomic_width = sess.target.max_atomic_width();
|
||||||
let atomic_cas = sess.target.atomic_cas;
|
let atomic_cas = sess.target.atomic_cas;
|
||||||
|
@ -752,7 +752,7 @@ pub fn default_configuration(sess: &Session) -> CrateConfig {
|
||||||
ret.reserve(6); // the minimum number of insertions
|
ret.reserve(6); // the minimum number of insertions
|
||||||
// Target bindings.
|
// Target bindings.
|
||||||
ret.insert((sym::target_os, Some(Symbol::intern(os))));
|
ret.insert((sym::target_os, Some(Symbol::intern(os))));
|
||||||
if let Some(ref fam) = sess.target.target_family {
|
if let Some(ref fam) = sess.target.os_family {
|
||||||
ret.insert((sym::target_family, Some(Symbol::intern(fam))));
|
ret.insert((sym::target_family, Some(Symbol::intern(fam))));
|
||||||
if fam == "windows" {
|
if fam == "windows" {
|
||||||
ret.insert((sym::windows, None));
|
ret.insert((sym::windows, None));
|
||||||
|
|
|
@ -584,7 +584,7 @@ impl<'a, Ty> FnAbi<'a, Ty> {
|
||||||
"nvptx64" => nvptx64::compute_abi_info(self),
|
"nvptx64" => nvptx64::compute_abi_info(self),
|
||||||
"hexagon" => hexagon::compute_abi_info(self),
|
"hexagon" => hexagon::compute_abi_info(self),
|
||||||
"riscv32" | "riscv64" => riscv::compute_abi_info(cx, self),
|
"riscv32" | "riscv64" => riscv::compute_abi_info(cx, self),
|
||||||
"wasm32" if cx.target_spec().target_os != "emscripten" => {
|
"wasm32" if cx.target_spec().os != "emscripten" => {
|
||||||
wasm32_bindgen_compat::compute_abi_info(self)
|
wasm32_bindgen_compat::compute_abi_info(self)
|
||||||
}
|
}
|
||||||
"wasm32" | "asmjs" => wasm32::compute_abi_info(cx, self),
|
"wasm32" | "asmjs" => wasm32::compute_abi_info(cx, self),
|
||||||
|
|
|
@ -119,7 +119,7 @@ where
|
||||||
Ty: TyAndLayoutMethods<'a, C> + Copy,
|
Ty: TyAndLayoutMethods<'a, C> + Copy,
|
||||||
C: LayoutOf<Ty = Ty, TyAndLayout = TyAndLayout<'a, Ty>> + HasDataLayout + HasTargetSpec,
|
C: LayoutOf<Ty = Ty, TyAndLayout = TyAndLayout<'a, Ty>> + HasDataLayout + HasTargetSpec,
|
||||||
{
|
{
|
||||||
let abi = if cx.target_spec().target_env == "musl" {
|
let abi = if cx.target_spec().env == "musl" {
|
||||||
ELFv2
|
ELFv2
|
||||||
} else {
|
} else {
|
||||||
match cx.data_layout().endian {
|
match cx.data_layout().endian {
|
||||||
|
|
|
@ -156,11 +156,11 @@ impl TargetDataLayout {
|
||||||
Endian::Little => "little",
|
Endian::Little => "little",
|
||||||
Endian::Big => "big",
|
Endian::Big => "big",
|
||||||
};
|
};
|
||||||
if endian_str != target.target_endian {
|
if endian_str != target.endian {
|
||||||
return Err(format!(
|
return Err(format!(
|
||||||
"inconsistent target specification: \"data-layout\" claims \
|
"inconsistent target specification: \"data-layout\" claims \
|
||||||
architecture is {}-endian, while \"target-endian\" is `{}`",
|
architecture is {}-endian, while \"target-endian\" is `{}`",
|
||||||
endian_str, target.target_endian
|
endian_str, target.endian
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,6 @@ pub fn target() -> Target {
|
||||||
pointer_width: 64,
|
pointer_width: 64,
|
||||||
data_layout: "e-m:o-i64:64-i128:128-n32:64-S128".to_string(),
|
data_layout: "e-m:o-i64:64-i128:128-n32:64-S128".to_string(),
|
||||||
arch: arch.to_string(),
|
arch: arch.to_string(),
|
||||||
options: TargetOptions { target_mcount: "\u{1}mcount".to_string(), ..base },
|
options: TargetOptions { mcount: "\u{1}mcount".to_string(), ..base },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ pub fn target() -> Target {
|
||||||
arch: "aarch64".to_string(),
|
arch: "aarch64".to_string(),
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
unsupported_abis: super::arm_base::unsupported_abis(),
|
unsupported_abis: super::arm_base::unsupported_abis(),
|
||||||
target_mcount: "\u{1}_mcount".to_string(),
|
mcount: "\u{1}_mcount".to_string(),
|
||||||
..base
|
..base
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ pub fn target() -> Target {
|
||||||
arch: "aarch64".to_string(),
|
arch: "aarch64".to_string(),
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
unsupported_abis: super::arm_base::unsupported_abis(),
|
unsupported_abis: super::arm_base::unsupported_abis(),
|
||||||
target_mcount: "\u{1}_mcount".to_string(),
|
mcount: "\u{1}_mcount".to_string(),
|
||||||
..base
|
..base
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,6 @@ pub fn target() -> Target {
|
||||||
pointer_width: 64,
|
pointer_width: 64,
|
||||||
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".to_string(),
|
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".to_string(),
|
||||||
arch: "aarch64".to_string(),
|
arch: "aarch64".to_string(),
|
||||||
options: TargetOptions { target_mcount: "__mcount".to_string(), ..base },
|
options: TargetOptions { mcount: "__mcount".to_string(), ..base },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ use super::{LinkerFlavor, LldFlavor, PanicStrategy, RelocModel, Target, TargetOp
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
let opts = TargetOptions {
|
let opts = TargetOptions {
|
||||||
target_vendor: String::new(),
|
vendor: String::new(),
|
||||||
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
|
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
|
||||||
linker: Some("rust-lld".to_owned()),
|
linker: Some("rust-lld".to_owned()),
|
||||||
features: "+strict-align,+neon,+fp-armv8".to_string(),
|
features: "+strict-align,+neon,+fp-armv8".to_string(),
|
||||||
|
|
|
@ -10,7 +10,7 @@ use super::{LinkerFlavor, LldFlavor, PanicStrategy, RelocModel, Target, TargetOp
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
let opts = TargetOptions {
|
let opts = TargetOptions {
|
||||||
target_vendor: String::new(),
|
vendor: String::new(),
|
||||||
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
|
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
|
||||||
linker: Some("rust-lld".to_owned()),
|
linker: Some("rust-lld".to_owned()),
|
||||||
features: "+strict-align,-neon,-fp-armv8".to_string(),
|
features: "+strict-align,-neon,-fp-armv8".to_string(),
|
||||||
|
|
|
@ -2,7 +2,7 @@ use crate::spec::{LinkerFlavor, TargetOptions};
|
||||||
|
|
||||||
pub fn opts() -> TargetOptions {
|
pub fn opts() -> TargetOptions {
|
||||||
let mut base = super::linux_base::opts();
|
let mut base = super::linux_base::opts();
|
||||||
base.target_os = "android".to_string();
|
base.os = "android".to_string();
|
||||||
// Many of the symbols defined in compiler-rt are also defined in libgcc.
|
// Many of the symbols defined in compiler-rt are also defined in libgcc.
|
||||||
// Android's linker doesn't like that by default.
|
// Android's linker doesn't like that by default.
|
||||||
base.pre_link_args
|
base.pre_link_args
|
||||||
|
|
|
@ -17,13 +17,13 @@ pub fn opts(os: &str) -> TargetOptions {
|
||||||
let version = macos_deployment_target();
|
let version = macos_deployment_target();
|
||||||
|
|
||||||
TargetOptions {
|
TargetOptions {
|
||||||
target_os: os.to_string(),
|
os: os.to_string(),
|
||||||
target_vendor: "apple".to_string(),
|
vendor: "apple".to_string(),
|
||||||
// macOS has -dead_strip, which doesn't rely on function_sections
|
// macOS has -dead_strip, which doesn't rely on function_sections
|
||||||
function_sections: false,
|
function_sections: false,
|
||||||
dynamic_linking: true,
|
dynamic_linking: true,
|
||||||
executables: true,
|
executables: true,
|
||||||
target_family: Some("unix".to_string()),
|
os_family: Some("unix".to_string()),
|
||||||
is_like_osx: true,
|
is_like_osx: true,
|
||||||
dwarf_version: Some(2),
|
dwarf_version: Some(2),
|
||||||
has_rpath: true,
|
has_rpath: true,
|
||||||
|
|
|
@ -12,7 +12,7 @@ pub fn target() -> Target {
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
features: "+strict-align,+v6".to_string(),
|
features: "+strict-align,+v6".to_string(),
|
||||||
unsupported_abis: super::arm_base::unsupported_abis(),
|
unsupported_abis: super::arm_base::unsupported_abis(),
|
||||||
target_mcount: "\u{1}__gnu_mcount_nc".to_string(),
|
mcount: "\u{1}__gnu_mcount_nc".to_string(),
|
||||||
..base
|
..base
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ pub fn target() -> Target {
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
features: "+strict-align,+v6,+vfp2,-d32".to_string(),
|
features: "+strict-align,+v6,+vfp2,-d32".to_string(),
|
||||||
unsupported_abis: super::arm_base::unsupported_abis(),
|
unsupported_abis: super::arm_base::unsupported_abis(),
|
||||||
target_mcount: "\u{1}__gnu_mcount_nc".to_string(),
|
mcount: "\u{1}__gnu_mcount_nc".to_string(),
|
||||||
..base
|
..base
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ pub fn target() -> Target {
|
||||||
arch: "arm".to_string(),
|
arch: "arm".to_string(),
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
unsupported_abis: super::arm_base::unsupported_abis(),
|
unsupported_abis: super::arm_base::unsupported_abis(),
|
||||||
target_mcount: "\u{1}mcount".to_string(),
|
mcount: "\u{1}mcount".to_string(),
|
||||||
..base
|
..base
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ pub fn target() -> Target {
|
||||||
arch: "arm".to_string(),
|
arch: "arm".to_string(),
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
unsupported_abis: super::arm_base::unsupported_abis(),
|
unsupported_abis: super::arm_base::unsupported_abis(),
|
||||||
target_mcount: "\u{1}mcount".to_string(),
|
mcount: "\u{1}mcount".to_string(),
|
||||||
..base
|
..base
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,8 +11,8 @@ pub fn target() -> Target {
|
||||||
arch: "arm".to_string(),
|
arch: "arm".to_string(),
|
||||||
|
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
target_endian: "big".to_string(),
|
endian: "big".to_string(),
|
||||||
target_vendor: String::new(),
|
vendor: String::new(),
|
||||||
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
|
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
|
||||||
executables: true,
|
executables: true,
|
||||||
linker: Some("rust-lld".to_owned()),
|
linker: Some("rust-lld".to_owned()),
|
||||||
|
|
|
@ -11,8 +11,8 @@ pub fn target() -> Target {
|
||||||
arch: "arm".to_string(),
|
arch: "arm".to_string(),
|
||||||
|
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
target_endian: "big".to_string(),
|
endian: "big".to_string(),
|
||||||
target_vendor: String::new(),
|
vendor: String::new(),
|
||||||
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
|
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
|
||||||
executables: true,
|
executables: true,
|
||||||
linker: Some("rust-lld".to_owned()),
|
linker: Some("rust-lld".to_owned()),
|
||||||
|
|
|
@ -13,7 +13,7 @@ pub fn target() -> Target {
|
||||||
// Atomic operations provided by compiler-builtins
|
// Atomic operations provided by compiler-builtins
|
||||||
max_atomic_width: Some(32),
|
max_atomic_width: Some(32),
|
||||||
unsupported_abis: super::arm_base::unsupported_abis(),
|
unsupported_abis: super::arm_base::unsupported_abis(),
|
||||||
target_mcount: "\u{1}__gnu_mcount_nc".to_string(),
|
mcount: "\u{1}__gnu_mcount_nc".to_string(),
|
||||||
has_thumb_interworking: true,
|
has_thumb_interworking: true,
|
||||||
..base
|
..base
|
||||||
},
|
},
|
||||||
|
|
|
@ -13,7 +13,7 @@ pub fn target() -> Target {
|
||||||
// Atomic operations provided by compiler-builtins
|
// Atomic operations provided by compiler-builtins
|
||||||
max_atomic_width: Some(32),
|
max_atomic_width: Some(32),
|
||||||
unsupported_abis: super::arm_base::unsupported_abis(),
|
unsupported_abis: super::arm_base::unsupported_abis(),
|
||||||
target_mcount: "\u{1}__gnu_mcount_nc".to_string(),
|
mcount: "\u{1}__gnu_mcount_nc".to_string(),
|
||||||
has_thumb_interworking: true,
|
has_thumb_interworking: true,
|
||||||
..base
|
..base
|
||||||
},
|
},
|
||||||
|
|
|
@ -16,7 +16,7 @@ pub fn target() -> Target {
|
||||||
// Atomic operations provided by compiler-builtins
|
// Atomic operations provided by compiler-builtins
|
||||||
max_atomic_width: Some(32),
|
max_atomic_width: Some(32),
|
||||||
unsupported_abis: super::arm_base::unsupported_abis(),
|
unsupported_abis: super::arm_base::unsupported_abis(),
|
||||||
target_mcount: "\u{1}mcount".to_string(),
|
mcount: "\u{1}mcount".to_string(),
|
||||||
has_thumb_interworking: true,
|
has_thumb_interworking: true,
|
||||||
..base
|
..base
|
||||||
},
|
},
|
||||||
|
|
|
@ -9,11 +9,11 @@ pub fn target() -> Target {
|
||||||
arch: "arm".to_string(),
|
arch: "arm".to_string(),
|
||||||
|
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
target_env: "gnueabihf".to_string(),
|
env: "gnueabihf".to_string(),
|
||||||
features: "+v6,+vfp2,-d32".to_string(),
|
features: "+v6,+vfp2,-d32".to_string(),
|
||||||
max_atomic_width: Some(64),
|
max_atomic_width: Some(64),
|
||||||
unsupported_abis: super::arm_base::unsupported_abis(),
|
unsupported_abis: super::arm_base::unsupported_abis(),
|
||||||
target_mcount: "\u{1}__gnu_mcount_nc".to_string(),
|
mcount: "\u{1}__gnu_mcount_nc".to_string(),
|
||||||
..base
|
..base
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,10 +10,10 @@ pub fn target() -> Target {
|
||||||
arch: "arm".to_string(),
|
arch: "arm".to_string(),
|
||||||
|
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
target_env: "eabihf".to_string(),
|
env: "eabihf".to_string(),
|
||||||
features: "+v6,+vfp2,-d32".to_string(),
|
features: "+v6,+vfp2,-d32".to_string(),
|
||||||
unsupported_abis: super::arm_base::unsupported_abis(),
|
unsupported_abis: super::arm_base::unsupported_abis(),
|
||||||
target_mcount: "__mcount".to_string(),
|
mcount: "__mcount".to_string(),
|
||||||
..base
|
..base
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,6 @@ pub fn target() -> Target {
|
||||||
pointer_width: 32,
|
pointer_width: 32,
|
||||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
|
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
|
||||||
arch: "arm".to_string(),
|
arch: "arm".to_string(),
|
||||||
options: TargetOptions { target_mcount: "\u{1}mcount".to_string(), ..base },
|
options: TargetOptions { mcount: "\u{1}mcount".to_string(), ..base },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,11 +9,11 @@ pub fn target() -> Target {
|
||||||
arch: "arm".to_string(),
|
arch: "arm".to_string(),
|
||||||
|
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
target_env: "gnueabihf".to_string(),
|
env: "gnueabihf".to_string(),
|
||||||
features: "+v7,+vfp3,-d32,+thumb2,-neon".to_string(),
|
features: "+v7,+vfp3,-d32,+thumb2,-neon".to_string(),
|
||||||
max_atomic_width: Some(64),
|
max_atomic_width: Some(64),
|
||||||
unsupported_abis: super::arm_base::unsupported_abis(),
|
unsupported_abis: super::arm_base::unsupported_abis(),
|
||||||
target_mcount: "\u{1}__gnu_mcount_nc".to_string(),
|
mcount: "\u{1}__gnu_mcount_nc".to_string(),
|
||||||
..base
|
..base
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ pub fn target() -> Target {
|
||||||
cpu: "generic".to_string(),
|
cpu: "generic".to_string(),
|
||||||
max_atomic_width: Some(64),
|
max_atomic_width: Some(64),
|
||||||
unsupported_abis: super::arm_base::unsupported_abis(),
|
unsupported_abis: super::arm_base::unsupported_abis(),
|
||||||
target_mcount: "\u{1}__gnu_mcount_nc".to_string(),
|
mcount: "\u{1}__gnu_mcount_nc".to_string(),
|
||||||
..base
|
..base
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ pub fn target() -> Target {
|
||||||
cpu: "generic".to_string(),
|
cpu: "generic".to_string(),
|
||||||
max_atomic_width: Some(64),
|
max_atomic_width: Some(64),
|
||||||
unsupported_abis: super::arm_base::unsupported_abis(),
|
unsupported_abis: super::arm_base::unsupported_abis(),
|
||||||
target_mcount: "\u{1}__gnu_mcount_nc".to_string(),
|
mcount: "\u{1}__gnu_mcount_nc".to_string(),
|
||||||
..base
|
..base
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ pub fn target() -> Target {
|
||||||
cpu: "generic".to_string(),
|
cpu: "generic".to_string(),
|
||||||
max_atomic_width: Some(64),
|
max_atomic_width: Some(64),
|
||||||
unsupported_abis: super::arm_base::unsupported_abis(),
|
unsupported_abis: super::arm_base::unsupported_abis(),
|
||||||
target_mcount: "\u{1}mcount".to_string(),
|
mcount: "\u{1}mcount".to_string(),
|
||||||
..base
|
..base
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ pub fn target() -> Target {
|
||||||
cpu: "generic".to_string(),
|
cpu: "generic".to_string(),
|
||||||
max_atomic_width: Some(64),
|
max_atomic_width: Some(64),
|
||||||
unsupported_abis: super::arm_base::unsupported_abis(),
|
unsupported_abis: super::arm_base::unsupported_abis(),
|
||||||
target_mcount: "\u{1}mcount".to_string(),
|
mcount: "\u{1}mcount".to_string(),
|
||||||
..base
|
..base
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,12 +9,12 @@ pub fn target() -> Target {
|
||||||
arch: "arm".to_string(),
|
arch: "arm".to_string(),
|
||||||
|
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
target_env: "eabihf".to_string(),
|
env: "eabihf".to_string(),
|
||||||
features: "+v7,+vfp3,-d32,+thumb2,-neon".to_string(),
|
features: "+v7,+vfp3,-d32,+thumb2,-neon".to_string(),
|
||||||
cpu: "generic".to_string(),
|
cpu: "generic".to_string(),
|
||||||
max_atomic_width: Some(64),
|
max_atomic_width: Some(64),
|
||||||
unsupported_abis: super::arm_base::unsupported_abis(),
|
unsupported_abis: super::arm_base::unsupported_abis(),
|
||||||
target_mcount: "__mcount".to_string(),
|
mcount: "__mcount".to_string(),
|
||||||
..base
|
..base
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
// bare-metal binaries (the `gcc` linker has the advantage that it knows where C
|
// bare-metal binaries (the `gcc` linker has the advantage that it knows where C
|
||||||
// libraries and crt*.o are but it's not much of an advantage here); LLD is also
|
// libraries and crt*.o are but it's not much of an advantage here); LLD is also
|
||||||
// faster
|
// faster
|
||||||
// - `target_os` set to `none`. rationale: matches `thumb` targets
|
// - `os` set to `none`. rationale: matches `thumb` targets
|
||||||
// - `target_{env,vendor}` set to an empty string. rationale: matches `thumb`
|
// - `target_{env,vendor}` set to an empty string. rationale: matches `thumb`
|
||||||
// targets
|
// targets
|
||||||
// - `panic_strategy` set to `abort`. rationale: matches `thumb` targets
|
// - `panic_strategy` set to `abort`. rationale: matches `thumb` targets
|
||||||
|
@ -21,7 +21,7 @@ use super::{LinkerFlavor, LldFlavor, PanicStrategy, RelocModel, Target, TargetOp
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
let opts = TargetOptions {
|
let opts = TargetOptions {
|
||||||
target_vendor: String::new(),
|
vendor: String::new(),
|
||||||
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
|
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
|
||||||
linker: Some("rust-lld".to_owned()),
|
linker: Some("rust-lld".to_owned()),
|
||||||
features: "+v7,+thumb2,+soft-float,-neon,+strict-align".to_string(),
|
features: "+v7,+thumb2,+soft-float,-neon,+strict-align".to_string(),
|
||||||
|
|
|
@ -9,7 +9,7 @@ use super::{LinkerFlavor, LldFlavor, PanicStrategy, RelocModel, Target, TargetOp
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
let opts = TargetOptions {
|
let opts = TargetOptions {
|
||||||
target_vendor: String::new(),
|
vendor: String::new(),
|
||||||
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
|
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
|
||||||
linker: Some("rust-lld".to_owned()),
|
linker: Some("rust-lld".to_owned()),
|
||||||
features: "+v7,+vfp3,-d32,+thumb2,-neon,+strict-align".to_string(),
|
features: "+v7,+vfp3,-d32,+thumb2,-neon,+strict-align".to_string(),
|
||||||
|
|
|
@ -11,7 +11,7 @@ pub fn target() -> Target {
|
||||||
arch: "arm".to_string(),
|
arch: "arm".to_string(),
|
||||||
|
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
target_vendor: String::new(),
|
vendor: String::new(),
|
||||||
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
|
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
|
||||||
executables: true,
|
executables: true,
|
||||||
linker: Some("rust-lld".to_owned()),
|
linker: Some("rust-lld".to_owned()),
|
||||||
|
|
|
@ -11,7 +11,7 @@ pub fn target() -> Target {
|
||||||
arch: "arm".to_string(),
|
arch: "arm".to_string(),
|
||||||
|
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
target_vendor: String::new(),
|
vendor: String::new(),
|
||||||
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
|
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
|
||||||
executables: true,
|
executables: true,
|
||||||
linker: Some("rust-lld".to_owned()),
|
linker: Some("rust-lld".to_owned()),
|
||||||
|
|
|
@ -10,8 +10,8 @@ pub fn target(target_cpu: String) -> Target {
|
||||||
llvm_target: "avr-unknown-unknown".to_string(),
|
llvm_target: "avr-unknown-unknown".to_string(),
|
||||||
pointer_width: 16,
|
pointer_width: 16,
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
target_c_int_width: "16".to_string(),
|
c_int_width: "16".to_string(),
|
||||||
target_os: "unknown".to_string(),
|
os: "unknown".to_string(),
|
||||||
cpu: target_cpu.clone(),
|
cpu: target_cpu.clone(),
|
||||||
exe_suffix: ".elf".to_string(),
|
exe_suffix: ".elf".to_string(),
|
||||||
|
|
||||||
|
|
|
@ -12,9 +12,9 @@ pub fn opts() -> TargetOptions {
|
||||||
);
|
);
|
||||||
|
|
||||||
TargetOptions {
|
TargetOptions {
|
||||||
target_os: "cloudabi".to_string(),
|
os: "cloudabi".to_string(),
|
||||||
executables: true,
|
executables: true,
|
||||||
target_family: None,
|
os_family: None,
|
||||||
linker_is_gnu: true,
|
linker_is_gnu: true,
|
||||||
pre_link_args: args,
|
pre_link_args: args,
|
||||||
position_independent_executables: true,
|
position_independent_executables: true,
|
||||||
|
|
|
@ -16,10 +16,10 @@ pub fn opts() -> TargetOptions {
|
||||||
);
|
);
|
||||||
|
|
||||||
TargetOptions {
|
TargetOptions {
|
||||||
target_os: "dragonfly".to_string(),
|
os: "dragonfly".to_string(),
|
||||||
dynamic_linking: true,
|
dynamic_linking: true,
|
||||||
executables: true,
|
executables: true,
|
||||||
target_family: Some("unix".to_string()),
|
os_family: Some("unix".to_string()),
|
||||||
linker_is_gnu: true,
|
linker_is_gnu: true,
|
||||||
has_rpath: true,
|
has_rpath: true,
|
||||||
pre_link_args: args,
|
pre_link_args: args,
|
||||||
|
|
|
@ -16,10 +16,10 @@ pub fn opts() -> TargetOptions {
|
||||||
);
|
);
|
||||||
|
|
||||||
TargetOptions {
|
TargetOptions {
|
||||||
target_os: "freebsd".to_string(),
|
os: "freebsd".to_string(),
|
||||||
dynamic_linking: true,
|
dynamic_linking: true,
|
||||||
executables: true,
|
executables: true,
|
||||||
target_family: Some("unix".to_string()),
|
os_family: Some("unix".to_string()),
|
||||||
linker_is_gnu: true,
|
linker_is_gnu: true,
|
||||||
has_rpath: true,
|
has_rpath: true,
|
||||||
pre_link_args: args,
|
pre_link_args: args,
|
||||||
|
|
|
@ -20,14 +20,14 @@ pub fn opts() -> TargetOptions {
|
||||||
);
|
);
|
||||||
|
|
||||||
TargetOptions {
|
TargetOptions {
|
||||||
target_os: "fuchsia".to_string(),
|
os: "fuchsia".to_string(),
|
||||||
target_vendor: String::new(),
|
vendor: String::new(),
|
||||||
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
|
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
|
||||||
linker: Some("rust-lld".to_owned()),
|
linker: Some("rust-lld".to_owned()),
|
||||||
lld_flavor: LldFlavor::Ld,
|
lld_flavor: LldFlavor::Ld,
|
||||||
dynamic_linking: true,
|
dynamic_linking: true,
|
||||||
executables: true,
|
executables: true,
|
||||||
target_family: Some("unix".to_string()),
|
os_family: Some("unix".to_string()),
|
||||||
is_like_fuchsia: true,
|
is_like_fuchsia: true,
|
||||||
linker_is_gnu: true,
|
linker_is_gnu: true,
|
||||||
has_rpath: false,
|
has_rpath: false,
|
||||||
|
|
|
@ -2,11 +2,11 @@ use crate::spec::{RelroLevel, TargetOptions};
|
||||||
|
|
||||||
pub fn opts() -> TargetOptions {
|
pub fn opts() -> TargetOptions {
|
||||||
TargetOptions {
|
TargetOptions {
|
||||||
target_os: "haiku".to_string(),
|
os: "haiku".to_string(),
|
||||||
dynamic_linking: true,
|
dynamic_linking: true,
|
||||||
executables: true,
|
executables: true,
|
||||||
has_rpath: false,
|
has_rpath: false,
|
||||||
target_family: Some("unix".to_string()),
|
os_family: Some("unix".to_string()),
|
||||||
relro_level: RelroLevel::Full,
|
relro_level: RelroLevel::Full,
|
||||||
linker_is_gnu: true,
|
linker_is_gnu: true,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
|
|
|
@ -9,7 +9,7 @@ pub fn opts() -> TargetOptions {
|
||||||
);
|
);
|
||||||
|
|
||||||
TargetOptions {
|
TargetOptions {
|
||||||
target_os: "hermit".to_string(),
|
os: "hermit".to_string(),
|
||||||
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
|
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
|
||||||
linker: Some("rust-lld".to_owned()),
|
linker: Some("rust-lld".to_owned()),
|
||||||
executables: true,
|
executables: true,
|
||||||
|
@ -20,7 +20,7 @@ pub fn opts() -> TargetOptions {
|
||||||
position_independent_executables: true,
|
position_independent_executables: true,
|
||||||
static_position_independent_executables: true,
|
static_position_independent_executables: true,
|
||||||
relocation_model: RelocModel::Pic,
|
relocation_model: RelocModel::Pic,
|
||||||
target_family: None,
|
os_family: None,
|
||||||
tls_model: TlsModel::InitialExec,
|
tls_model: TlsModel::InitialExec,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ pub fn opts() -> TargetOptions {
|
||||||
);
|
);
|
||||||
|
|
||||||
TargetOptions {
|
TargetOptions {
|
||||||
target_os: "hermit".to_string(),
|
os: "hermit".to_string(),
|
||||||
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
|
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
|
||||||
disable_redzone: true,
|
disable_redzone: true,
|
||||||
linker: Some("rust-lld".to_owned()),
|
linker: Some("rust-lld".to_owned()),
|
||||||
|
@ -21,7 +21,7 @@ pub fn opts() -> TargetOptions {
|
||||||
position_independent_executables: true,
|
position_independent_executables: true,
|
||||||
static_position_independent_executables: true,
|
static_position_independent_executables: true,
|
||||||
relocation_model: RelocModel::Pic,
|
relocation_model: RelocModel::Pic,
|
||||||
target_family: None,
|
os_family: None,
|
||||||
tls_model: TlsModel::InitialExec,
|
tls_model: TlsModel::InitialExec,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,6 @@ pub fn target() -> Target {
|
||||||
f64:32:64-f80:128-n8:16:32-S128"
|
f64:32:64-f80:128-n8:16:32-S128"
|
||||||
.to_string(),
|
.to_string(),
|
||||||
arch: "x86".to_string(),
|
arch: "x86".to_string(),
|
||||||
options: TargetOptions { target_mcount: "\u{1}mcount".to_string(), ..base },
|
options: TargetOptions { mcount: "\u{1}mcount".to_string(), ..base },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,6 @@ pub fn target() -> Target {
|
||||||
f64:32:64-f80:32-n8:16:32-S128"
|
f64:32:64-f80:32-n8:16:32-S128"
|
||||||
.to_string(),
|
.to_string(),
|
||||||
arch: "x86".to_string(),
|
arch: "x86".to_string(),
|
||||||
options: TargetOptions { target_mcount: "__mcount".to_string(), ..base },
|
options: TargetOptions { mcount: "__mcount".to_string(), ..base },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,11 +16,11 @@ pub fn opts() -> TargetOptions {
|
||||||
);
|
);
|
||||||
|
|
||||||
TargetOptions {
|
TargetOptions {
|
||||||
target_os: "illumos".to_string(),
|
os: "illumos".to_string(),
|
||||||
dynamic_linking: true,
|
dynamic_linking: true,
|
||||||
executables: true,
|
executables: true,
|
||||||
has_rpath: true,
|
has_rpath: true,
|
||||||
target_family: Some("unix".to_string()),
|
os_family: Some("unix".to_string()),
|
||||||
is_like_solaris: true,
|
is_like_solaris: true,
|
||||||
limit_rdylib_exports: false, // Linker doesn't support this
|
limit_rdylib_exports: false, // Linker doesn't support this
|
||||||
eliminate_frame_pointer: false,
|
eliminate_frame_pointer: false,
|
||||||
|
|
|
@ -17,15 +17,15 @@ pub fn opts() -> TargetOptions {
|
||||||
args.insert(LinkerFlavor::Gcc, vec![]);
|
args.insert(LinkerFlavor::Gcc, vec![]);
|
||||||
|
|
||||||
TargetOptions {
|
TargetOptions {
|
||||||
target_os: "l4re".to_string(),
|
os: "l4re".to_string(),
|
||||||
target_env: "uclibc".to_string(),
|
env: "uclibc".to_string(),
|
||||||
linker_flavor: LinkerFlavor::Ld,
|
linker_flavor: LinkerFlavor::Ld,
|
||||||
executables: true,
|
executables: true,
|
||||||
has_elf_tls: false,
|
has_elf_tls: false,
|
||||||
panic_strategy: PanicStrategy::Abort,
|
panic_strategy: PanicStrategy::Abort,
|
||||||
linker: Some("ld".to_string()),
|
linker: Some("ld".to_string()),
|
||||||
pre_link_args: args,
|
pre_link_args: args,
|
||||||
target_family: Some("unix".to_string()),
|
os_family: Some("unix".to_string()),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,11 +19,11 @@ pub fn opts() -> TargetOptions {
|
||||||
);
|
);
|
||||||
|
|
||||||
TargetOptions {
|
TargetOptions {
|
||||||
target_os: "linux".to_string(),
|
os: "linux".to_string(),
|
||||||
target_env: "gnu".to_string(),
|
env: "gnu".to_string(),
|
||||||
dynamic_linking: true,
|
dynamic_linking: true,
|
||||||
executables: true,
|
executables: true,
|
||||||
target_family: Some("unix".to_string()),
|
os_family: Some("unix".to_string()),
|
||||||
linker_is_gnu: true,
|
linker_is_gnu: true,
|
||||||
has_rpath: true,
|
has_rpath: true,
|
||||||
pre_link_args: args,
|
pre_link_args: args,
|
||||||
|
|
|
@ -8,7 +8,7 @@ pub fn opts() -> TargetOptions {
|
||||||
);
|
);
|
||||||
|
|
||||||
TargetOptions {
|
TargetOptions {
|
||||||
target_env: "gnu".to_string(),
|
env: "gnu".to_string(),
|
||||||
disable_redzone: true,
|
disable_redzone: true,
|
||||||
panic_strategy: PanicStrategy::Abort,
|
panic_strategy: PanicStrategy::Abort,
|
||||||
stack_probes: true,
|
stack_probes: true,
|
||||||
|
|
|
@ -4,7 +4,7 @@ use crate::spec::TargetOptions;
|
||||||
pub fn opts() -> TargetOptions {
|
pub fn opts() -> TargetOptions {
|
||||||
let mut base = super::linux_base::opts();
|
let mut base = super::linux_base::opts();
|
||||||
|
|
||||||
base.target_env = "musl".to_string();
|
base.env = "musl".to_string();
|
||||||
base.pre_link_objects_fallback = crt_objects::pre_musl_fallback();
|
base.pre_link_objects_fallback = crt_objects::pre_musl_fallback();
|
||||||
base.post_link_objects_fallback = crt_objects::post_musl_fallback();
|
base.post_link_objects_fallback = crt_objects::post_musl_fallback();
|
||||||
base.crt_objects_fallback = Some(CrtObjectsFallback::Musl);
|
base.crt_objects_fallback = Some(CrtObjectsFallback::Musl);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
use crate::spec::TargetOptions;
|
use crate::spec::TargetOptions;
|
||||||
|
|
||||||
pub fn opts() -> TargetOptions {
|
pub fn opts() -> TargetOptions {
|
||||||
TargetOptions { target_env: "uclibc".to_string(), ..super::linux_base::opts() }
|
TargetOptions { env: "uclibc".to_string(), ..super::linux_base::opts() }
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,12 +7,12 @@ pub fn target() -> Target {
|
||||||
data_layout: "E-m:e-i8:8:32-i16:16:32-i64:64-n32:64-S128".to_string(),
|
data_layout: "E-m:e-i8:8:32-i16:16:32-i64:64-n32:64-S128".to_string(),
|
||||||
arch: "mips64".to_string(),
|
arch: "mips64".to_string(),
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
target_endian: "big".to_string(),
|
endian: "big".to_string(),
|
||||||
// NOTE(mips64r2) matches C toolchain
|
// NOTE(mips64r2) matches C toolchain
|
||||||
cpu: "mips64r2".to_string(),
|
cpu: "mips64r2".to_string(),
|
||||||
features: "+mips64r2".to_string(),
|
features: "+mips64r2".to_string(),
|
||||||
max_atomic_width: Some(64),
|
max_atomic_width: Some(64),
|
||||||
target_mcount: "_mcount".to_string(),
|
mcount: "_mcount".to_string(),
|
||||||
|
|
||||||
..super::linux_base::opts()
|
..super::linux_base::opts()
|
||||||
},
|
},
|
||||||
|
|
|
@ -11,10 +11,6 @@ pub fn target() -> Target {
|
||||||
pointer_width: 64,
|
pointer_width: 64,
|
||||||
data_layout: "E-m:e-i8:8:32-i16:16:32-i64:64-n32:64-S128".to_string(),
|
data_layout: "E-m:e-i8:8:32-i16:16:32-i64:64-n32:64-S128".to_string(),
|
||||||
arch: "mips64".to_string(),
|
arch: "mips64".to_string(),
|
||||||
options: TargetOptions {
|
options: TargetOptions { endian: "big".to_string(), mcount: "_mcount".to_string(), ..base },
|
||||||
target_endian: "big".to_string(),
|
|
||||||
target_mcount: "_mcount".to_string(),
|
|
||||||
..base
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ pub fn target() -> Target {
|
||||||
cpu: "mips64r2".to_string(),
|
cpu: "mips64r2".to_string(),
|
||||||
features: "+mips64r2".to_string(),
|
features: "+mips64r2".to_string(),
|
||||||
max_atomic_width: Some(64),
|
max_atomic_width: Some(64),
|
||||||
target_mcount: "_mcount".to_string(),
|
mcount: "_mcount".to_string(),
|
||||||
|
|
||||||
..super::linux_base::opts()
|
..super::linux_base::opts()
|
||||||
},
|
},
|
||||||
|
|
|
@ -11,6 +11,6 @@ pub fn target() -> Target {
|
||||||
pointer_width: 64,
|
pointer_width: 64,
|
||||||
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-n32:64-S128".to_string(),
|
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-n32:64-S128".to_string(),
|
||||||
arch: "mips64".to_string(),
|
arch: "mips64".to_string(),
|
||||||
options: TargetOptions { target_mcount: "_mcount".to_string(), ..base },
|
options: TargetOptions { mcount: "_mcount".to_string(), ..base },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,11 +7,11 @@ pub fn target() -> Target {
|
||||||
data_layout: "E-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".to_string(),
|
data_layout: "E-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".to_string(),
|
||||||
arch: "mips".to_string(),
|
arch: "mips".to_string(),
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
target_endian: "big".to_string(),
|
endian: "big".to_string(),
|
||||||
cpu: "mips32r2".to_string(),
|
cpu: "mips32r2".to_string(),
|
||||||
features: "+mips32r2,+fpxx,+nooddspreg".to_string(),
|
features: "+mips32r2,+fpxx,+nooddspreg".to_string(),
|
||||||
max_atomic_width: Some(32),
|
max_atomic_width: Some(32),
|
||||||
target_mcount: "_mcount".to_string(),
|
mcount: "_mcount".to_string(),
|
||||||
|
|
||||||
..super::linux_base::opts()
|
..super::linux_base::opts()
|
||||||
},
|
},
|
||||||
|
|
|
@ -11,10 +11,6 @@ pub fn target() -> Target {
|
||||||
pointer_width: 32,
|
pointer_width: 32,
|
||||||
data_layout: "E-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".to_string(),
|
data_layout: "E-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".to_string(),
|
||||||
arch: "mips".to_string(),
|
arch: "mips".to_string(),
|
||||||
options: TargetOptions {
|
options: TargetOptions { endian: "big".to_string(), mcount: "_mcount".to_string(), ..base },
|
||||||
target_endian: "big".to_string(),
|
|
||||||
target_mcount: "_mcount".to_string(),
|
|
||||||
..base
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,11 +7,11 @@ pub fn target() -> Target {
|
||||||
data_layout: "E-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".to_string(),
|
data_layout: "E-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".to_string(),
|
||||||
arch: "mips".to_string(),
|
arch: "mips".to_string(),
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
target_endian: "big".to_string(),
|
endian: "big".to_string(),
|
||||||
cpu: "mips32r2".to_string(),
|
cpu: "mips32r2".to_string(),
|
||||||
features: "+mips32r2,+soft-float".to_string(),
|
features: "+mips32r2,+soft-float".to_string(),
|
||||||
max_atomic_width: Some(32),
|
max_atomic_width: Some(32),
|
||||||
target_mcount: "_mcount".to_string(),
|
mcount: "_mcount".to_string(),
|
||||||
|
|
||||||
..super::linux_uclibc_base::opts()
|
..super::linux_uclibc_base::opts()
|
||||||
},
|
},
|
||||||
|
|
|
@ -15,8 +15,8 @@ pub fn target() -> Target {
|
||||||
arch: "mips".to_string(),
|
arch: "mips".to_string(),
|
||||||
|
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
target_os: "psp".to_string(),
|
os: "psp".to_string(),
|
||||||
target_vendor: "sony".to_string(),
|
vendor: "sony".to_string(),
|
||||||
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
|
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
|
||||||
cpu: "mips2".to_string(),
|
cpu: "mips2".to_string(),
|
||||||
executables: true,
|
executables: true,
|
||||||
|
|
|
@ -11,7 +11,7 @@ pub fn target() -> Target {
|
||||||
cpu: "mips32r2".to_string(),
|
cpu: "mips32r2".to_string(),
|
||||||
features: "+mips32r2,+fpxx,+nooddspreg".to_string(),
|
features: "+mips32r2,+fpxx,+nooddspreg".to_string(),
|
||||||
max_atomic_width: Some(32),
|
max_atomic_width: Some(32),
|
||||||
target_mcount: "_mcount".to_string(),
|
mcount: "_mcount".to_string(),
|
||||||
|
|
||||||
..super::linux_base::opts()
|
..super::linux_base::opts()
|
||||||
},
|
},
|
||||||
|
|
|
@ -11,6 +11,6 @@ pub fn target() -> Target {
|
||||||
pointer_width: 32,
|
pointer_width: 32,
|
||||||
data_layout: "e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".to_string(),
|
data_layout: "e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".to_string(),
|
||||||
arch: "mips".to_string(),
|
arch: "mips".to_string(),
|
||||||
options: TargetOptions { target_mcount: "_mcount".to_string(), ..base },
|
options: TargetOptions { mcount: "_mcount".to_string(), ..base },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ pub fn target() -> Target {
|
||||||
cpu: "mips32r2".to_string(),
|
cpu: "mips32r2".to_string(),
|
||||||
features: "+mips32r2,+soft-float".to_string(),
|
features: "+mips32r2,+soft-float".to_string(),
|
||||||
max_atomic_width: Some(32),
|
max_atomic_width: Some(32),
|
||||||
target_mcount: "_mcount".to_string(),
|
mcount: "_mcount".to_string(),
|
||||||
|
|
||||||
..super::linux_uclibc_base::opts()
|
..super::linux_uclibc_base::opts()
|
||||||
},
|
},
|
||||||
|
|
|
@ -14,7 +14,7 @@ pub fn target() -> Target {
|
||||||
arch: "mips".to_string(),
|
arch: "mips".to_string(),
|
||||||
|
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
target_vendor: String::new(),
|
vendor: String::new(),
|
||||||
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
|
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
|
||||||
cpu: "mips32r2".to_string(),
|
cpu: "mips32r2".to_string(),
|
||||||
features: "+mips32r2,+soft-float,+noabicalls".to_string(),
|
features: "+mips32r2,+soft-float,+noabicalls".to_string(),
|
||||||
|
|
|
@ -7,11 +7,11 @@ pub fn target() -> Target {
|
||||||
data_layout: "E-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".to_string(),
|
data_layout: "E-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".to_string(),
|
||||||
arch: "mips".to_string(),
|
arch: "mips".to_string(),
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
target_endian: "big".to_string(),
|
endian: "big".to_string(),
|
||||||
cpu: "mips32r6".to_string(),
|
cpu: "mips32r6".to_string(),
|
||||||
features: "+mips32r6".to_string(),
|
features: "+mips32r6".to_string(),
|
||||||
max_atomic_width: Some(32),
|
max_atomic_width: Some(32),
|
||||||
target_mcount: "_mcount".to_string(),
|
mcount: "_mcount".to_string(),
|
||||||
|
|
||||||
..super::linux_base::opts()
|
..super::linux_base::opts()
|
||||||
},
|
},
|
||||||
|
|
|
@ -11,7 +11,7 @@ pub fn target() -> Target {
|
||||||
cpu: "mips32r6".to_string(),
|
cpu: "mips32r6".to_string(),
|
||||||
features: "+mips32r6".to_string(),
|
features: "+mips32r6".to_string(),
|
||||||
max_atomic_width: Some(32),
|
max_atomic_width: Some(32),
|
||||||
target_mcount: "_mcount".to_string(),
|
mcount: "_mcount".to_string(),
|
||||||
|
|
||||||
..super::linux_base::opts()
|
..super::linux_base::opts()
|
||||||
},
|
},
|
||||||
|
|
|
@ -7,12 +7,12 @@ pub fn target() -> Target {
|
||||||
data_layout: "E-m:e-i8:8:32-i16:16:32-i64:64-n32:64-S128".to_string(),
|
data_layout: "E-m:e-i8:8:32-i16:16:32-i64:64-n32:64-S128".to_string(),
|
||||||
arch: "mips64".to_string(),
|
arch: "mips64".to_string(),
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
target_endian: "big".to_string(),
|
endian: "big".to_string(),
|
||||||
// NOTE(mips64r6) matches C toolchain
|
// NOTE(mips64r6) matches C toolchain
|
||||||
cpu: "mips64r6".to_string(),
|
cpu: "mips64r6".to_string(),
|
||||||
features: "+mips64r6".to_string(),
|
features: "+mips64r6".to_string(),
|
||||||
max_atomic_width: Some(64),
|
max_atomic_width: Some(64),
|
||||||
target_mcount: "_mcount".to_string(),
|
mcount: "_mcount".to_string(),
|
||||||
|
|
||||||
..super::linux_base::opts()
|
..super::linux_base::opts()
|
||||||
},
|
},
|
||||||
|
|
|
@ -11,7 +11,7 @@ pub fn target() -> Target {
|
||||||
cpu: "mips64r6".to_string(),
|
cpu: "mips64r6".to_string(),
|
||||||
features: "+mips64r6".to_string(),
|
features: "+mips64r6".to_string(),
|
||||||
max_atomic_width: Some(64),
|
max_atomic_width: Some(64),
|
||||||
target_mcount: "_mcount".to_string(),
|
mcount: "_mcount".to_string(),
|
||||||
|
|
||||||
..super::linux_base::opts()
|
..super::linux_base::opts()
|
||||||
},
|
},
|
||||||
|
|
|
@ -701,15 +701,15 @@ pub struct TargetOptions {
|
||||||
pub is_builtin: bool,
|
pub is_builtin: bool,
|
||||||
|
|
||||||
/// String to use as the `target_endian` `cfg` variable. Defaults to "little".
|
/// String to use as the `target_endian` `cfg` variable. Defaults to "little".
|
||||||
pub target_endian: String,
|
pub endian: String,
|
||||||
/// Width of c_int type. Defaults to "32".
|
/// Width of c_int type. Defaults to "32".
|
||||||
pub target_c_int_width: String,
|
pub c_int_width: String,
|
||||||
/// OS name to use for conditional compilation. Defaults to "none".
|
/// OS name to use for conditional compilation. Defaults to "none".
|
||||||
pub target_os: String,
|
pub os: String,
|
||||||
/// Environment name to use for conditional compilation. Defaults to "".
|
/// Environment name to use for conditional compilation. Defaults to "".
|
||||||
pub target_env: String,
|
pub env: String,
|
||||||
/// Vendor name to use for conditional compilation. Defaults to "unknown".
|
/// Vendor name to use for conditional compilation. Defaults to "unknown".
|
||||||
pub target_vendor: String,
|
pub vendor: String,
|
||||||
/// Default linker flavor used if `-C linker-flavor` or `-C linker` are not passed
|
/// Default linker flavor used if `-C linker-flavor` or `-C linker` are not passed
|
||||||
/// on the command line. Defaults to `LinkerFlavor::Gcc`.
|
/// on the command line. Defaults to `LinkerFlavor::Gcc`.
|
||||||
pub linker_flavor: LinkerFlavor,
|
pub linker_flavor: LinkerFlavor,
|
||||||
|
@ -800,7 +800,7 @@ pub struct TargetOptions {
|
||||||
/// String to append to the name of every static library. Defaults to ".a".
|
/// String to append to the name of every static library. Defaults to ".a".
|
||||||
pub staticlib_suffix: String,
|
pub staticlib_suffix: String,
|
||||||
/// OS family to use for conditional compilation. Valid options: "unix", "windows".
|
/// OS family to use for conditional compilation. Valid options: "unix", "windows".
|
||||||
pub target_family: Option<String>,
|
pub os_family: Option<String>,
|
||||||
/// Whether the target toolchain's ABI supports returning small structs as an integer.
|
/// Whether the target toolchain's ABI supports returning small structs as an integer.
|
||||||
pub abi_return_struct_as_int: bool,
|
pub abi_return_struct_as_int: bool,
|
||||||
/// Whether the target toolchain is like macOS's. Only useful for compiling against iOS/macOS,
|
/// Whether the target toolchain is like macOS's. Only useful for compiling against iOS/macOS,
|
||||||
|
@ -961,7 +961,7 @@ pub struct TargetOptions {
|
||||||
pub merge_functions: MergeFunctions,
|
pub merge_functions: MergeFunctions,
|
||||||
|
|
||||||
/// Use platform dependent mcount function
|
/// Use platform dependent mcount function
|
||||||
pub target_mcount: String,
|
pub mcount: String,
|
||||||
|
|
||||||
/// LLVM ABI name, corresponds to the '-mabi' parameter available in multilib C compilers
|
/// LLVM ABI name, corresponds to the '-mabi' parameter available in multilib C compilers
|
||||||
pub llvm_abiname: String,
|
pub llvm_abiname: String,
|
||||||
|
@ -992,11 +992,11 @@ impl Default for TargetOptions {
|
||||||
fn default() -> TargetOptions {
|
fn default() -> TargetOptions {
|
||||||
TargetOptions {
|
TargetOptions {
|
||||||
is_builtin: false,
|
is_builtin: false,
|
||||||
target_endian: "little".to_string(),
|
endian: "little".to_string(),
|
||||||
target_c_int_width: "32".to_string(),
|
c_int_width: "32".to_string(),
|
||||||
target_os: "none".to_string(),
|
os: "none".to_string(),
|
||||||
target_env: String::new(),
|
env: String::new(),
|
||||||
target_vendor: "unknown".to_string(),
|
vendor: "unknown".to_string(),
|
||||||
linker_flavor: LinkerFlavor::Gcc,
|
linker_flavor: LinkerFlavor::Gcc,
|
||||||
linker: option_env!("CFG_DEFAULT_LINKER").map(|s| s.to_string()),
|
linker: option_env!("CFG_DEFAULT_LINKER").map(|s| s.to_string()),
|
||||||
lld_flavor: LldFlavor::Ld,
|
lld_flavor: LldFlavor::Ld,
|
||||||
|
@ -1020,7 +1020,7 @@ impl Default for TargetOptions {
|
||||||
exe_suffix: String::new(),
|
exe_suffix: String::new(),
|
||||||
staticlib_prefix: "lib".to_string(),
|
staticlib_prefix: "lib".to_string(),
|
||||||
staticlib_suffix: ".a".to_string(),
|
staticlib_suffix: ".a".to_string(),
|
||||||
target_family: None,
|
os_family: None,
|
||||||
abi_return_struct_as_int: false,
|
abi_return_struct_as_int: false,
|
||||||
is_like_osx: false,
|
is_like_osx: false,
|
||||||
is_like_solaris: false,
|
is_like_solaris: false,
|
||||||
|
@ -1077,7 +1077,7 @@ impl Default for TargetOptions {
|
||||||
limit_rdylib_exports: true,
|
limit_rdylib_exports: true,
|
||||||
override_export_symbols: None,
|
override_export_symbols: None,
|
||||||
merge_functions: MergeFunctions::Aliases,
|
merge_functions: MergeFunctions::Aliases,
|
||||||
target_mcount: "mcount".to_string(),
|
mcount: "mcount".to_string(),
|
||||||
llvm_abiname: "".to_string(),
|
llvm_abiname: "".to_string(),
|
||||||
relax_elf_relocations: false,
|
relax_elf_relocations: false,
|
||||||
llvm_args: vec![],
|
llvm_args: vec![],
|
||||||
|
@ -1306,6 +1306,14 @@ impl Target {
|
||||||
.map(|s| s.to_string() );
|
.map(|s| s.to_string() );
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
($key_name:ident = $json_name:expr, optional) => ( {
|
||||||
|
let name = $json_name;
|
||||||
|
if let Some(o) = obj.find(&name[..]) {
|
||||||
|
base.$key_name = o
|
||||||
|
.as_string()
|
||||||
|
.map(|s| s.to_string() );
|
||||||
|
}
|
||||||
|
} );
|
||||||
($key_name:ident, LldFlavor) => ( {
|
($key_name:ident, LldFlavor) => ( {
|
||||||
let name = (stringify!($key_name)).replace("_", "-");
|
let name = (stringify!($key_name)).replace("_", "-");
|
||||||
obj.find(&name[..]).and_then(|o| o.as_string().and_then(|s| {
|
obj.find(&name[..]).and_then(|o| o.as_string().and_then(|s| {
|
||||||
|
@ -1415,11 +1423,11 @@ impl Target {
|
||||||
}
|
}
|
||||||
|
|
||||||
key!(is_builtin, bool);
|
key!(is_builtin, bool);
|
||||||
key!(target_endian);
|
key!(endian = "target_endian");
|
||||||
key!(target_c_int_width);
|
key!(c_int_width = "target_c_int_width");
|
||||||
key!(target_os = "os");
|
key!(os);
|
||||||
key!(target_env = "env");
|
key!(env);
|
||||||
key!(target_vendor = "vendor");
|
key!(vendor);
|
||||||
key!(linker_flavor, LinkerFlavor)?;
|
key!(linker_flavor, LinkerFlavor)?;
|
||||||
key!(linker, optional);
|
key!(linker, optional);
|
||||||
key!(lld_flavor, LldFlavor)?;
|
key!(lld_flavor, LldFlavor)?;
|
||||||
|
@ -1453,7 +1461,7 @@ impl Target {
|
||||||
key!(exe_suffix);
|
key!(exe_suffix);
|
||||||
key!(staticlib_prefix);
|
key!(staticlib_prefix);
|
||||||
key!(staticlib_suffix);
|
key!(staticlib_suffix);
|
||||||
key!(target_family, optional);
|
key!(os_family = "target_family", optional);
|
||||||
key!(abi_return_struct_as_int, bool);
|
key!(abi_return_struct_as_int, bool);
|
||||||
key!(is_like_osx, bool);
|
key!(is_like_osx, bool);
|
||||||
key!(is_like_solaris, bool);
|
key!(is_like_solaris, bool);
|
||||||
|
@ -1499,7 +1507,7 @@ impl Target {
|
||||||
key!(limit_rdylib_exports, bool);
|
key!(limit_rdylib_exports, bool);
|
||||||
key!(override_export_symbols, opt_list);
|
key!(override_export_symbols, opt_list);
|
||||||
key!(merge_functions, MergeFunctions)?;
|
key!(merge_functions, MergeFunctions)?;
|
||||||
key!(target_mcount);
|
key!(mcount = "target_mcount");
|
||||||
key!(llvm_abiname);
|
key!(llvm_abiname);
|
||||||
key!(relax_elf_relocations, bool);
|
key!(relax_elf_relocations, bool);
|
||||||
key!(llvm_args, list);
|
key!(llvm_args, list);
|
||||||
|
@ -1651,11 +1659,11 @@ impl ToJson for Target {
|
||||||
target_val!(data_layout);
|
target_val!(data_layout);
|
||||||
|
|
||||||
target_option_val!(is_builtin);
|
target_option_val!(is_builtin);
|
||||||
target_option_val!(target_endian);
|
target_option_val!(endian, "target_endian");
|
||||||
target_option_val!(target_c_int_width);
|
target_option_val!(c_int_width, "target_c_int_width");
|
||||||
target_option_val!(target_os, "os");
|
target_option_val!(os);
|
||||||
target_option_val!(target_env, "env");
|
target_option_val!(env);
|
||||||
target_option_val!(target_vendor, "vendor");
|
target_option_val!(vendor);
|
||||||
target_option_val!(linker_flavor);
|
target_option_val!(linker_flavor);
|
||||||
target_option_val!(linker);
|
target_option_val!(linker);
|
||||||
target_option_val!(lld_flavor);
|
target_option_val!(lld_flavor);
|
||||||
|
@ -1689,7 +1697,7 @@ impl ToJson for Target {
|
||||||
target_option_val!(exe_suffix);
|
target_option_val!(exe_suffix);
|
||||||
target_option_val!(staticlib_prefix);
|
target_option_val!(staticlib_prefix);
|
||||||
target_option_val!(staticlib_suffix);
|
target_option_val!(staticlib_suffix);
|
||||||
target_option_val!(target_family);
|
target_option_val!(os_family, "target_family");
|
||||||
target_option_val!(abi_return_struct_as_int);
|
target_option_val!(abi_return_struct_as_int);
|
||||||
target_option_val!(is_like_osx);
|
target_option_val!(is_like_osx);
|
||||||
target_option_val!(is_like_solaris);
|
target_option_val!(is_like_solaris);
|
||||||
|
@ -1735,7 +1743,7 @@ impl ToJson for Target {
|
||||||
target_option_val!(limit_rdylib_exports);
|
target_option_val!(limit_rdylib_exports);
|
||||||
target_option_val!(override_export_symbols);
|
target_option_val!(override_export_symbols);
|
||||||
target_option_val!(merge_functions);
|
target_option_val!(merge_functions);
|
||||||
target_option_val!(target_mcount);
|
target_option_val!(mcount, "target_mcount");
|
||||||
target_option_val!(llvm_abiname);
|
target_option_val!(llvm_abiname);
|
||||||
target_option_val!(relax_elf_relocations);
|
target_option_val!(relax_elf_relocations);
|
||||||
target_option_val!(llvm_args);
|
target_option_val!(llvm_args);
|
||||||
|
|
|
@ -8,8 +8,8 @@ pub fn target() -> Target {
|
||||||
arch: "msp430".to_string(),
|
arch: "msp430".to_string(),
|
||||||
|
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
target_c_int_width: "16".to_string(),
|
c_int_width: "16".to_string(),
|
||||||
target_vendor: String::new(),
|
vendor: String::new(),
|
||||||
executables: true,
|
executables: true,
|
||||||
|
|
||||||
// The LLVM backend currently can't generate object files. To
|
// The LLVM backend currently can't generate object files. To
|
||||||
|
|
|
@ -14,10 +14,10 @@ pub fn opts() -> TargetOptions {
|
||||||
);
|
);
|
||||||
|
|
||||||
TargetOptions {
|
TargetOptions {
|
||||||
target_os: "netbsd".to_string(),
|
os: "netbsd".to_string(),
|
||||||
dynamic_linking: true,
|
dynamic_linking: true,
|
||||||
executables: true,
|
executables: true,
|
||||||
target_family: Some("unix".to_string()),
|
os_family: Some("unix".to_string()),
|
||||||
linker_is_gnu: true,
|
linker_is_gnu: true,
|
||||||
no_default_libraries: false,
|
no_default_libraries: false,
|
||||||
has_rpath: true,
|
has_rpath: true,
|
||||||
|
|
|
@ -9,8 +9,8 @@ pub fn target() -> Target {
|
||||||
pointer_width: 64,
|
pointer_width: 64,
|
||||||
|
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
target_os: "cuda".to_string(),
|
os: "cuda".to_string(),
|
||||||
target_vendor: "nvidia".to_string(),
|
vendor: "nvidia".to_string(),
|
||||||
linker_flavor: LinkerFlavor::PtxLinker,
|
linker_flavor: LinkerFlavor::PtxLinker,
|
||||||
// The linker can be installed from `crates.io`.
|
// The linker can be installed from `crates.io`.
|
||||||
linker: Some("rust-ptx-linker".to_string()),
|
linker: Some("rust-ptx-linker".to_string()),
|
||||||
|
|
|
@ -16,10 +16,10 @@ pub fn opts() -> TargetOptions {
|
||||||
);
|
);
|
||||||
|
|
||||||
TargetOptions {
|
TargetOptions {
|
||||||
target_os: "openbsd".to_string(),
|
os: "openbsd".to_string(),
|
||||||
dynamic_linking: true,
|
dynamic_linking: true,
|
||||||
executables: true,
|
executables: true,
|
||||||
target_family: Some("unix".to_string()),
|
os_family: Some("unix".to_string()),
|
||||||
linker_is_gnu: true,
|
linker_is_gnu: true,
|
||||||
has_rpath: true,
|
has_rpath: true,
|
||||||
abi_return_struct_as_int: true,
|
abi_return_struct_as_int: true,
|
||||||
|
|
|
@ -11,10 +11,6 @@ pub fn target() -> Target {
|
||||||
pointer_width: 64,
|
pointer_width: 64,
|
||||||
data_layout: "E-m:e-i64:64-n32:64".to_string(),
|
data_layout: "E-m:e-i64:64-n32:64".to_string(),
|
||||||
arch: "powerpc64".to_string(),
|
arch: "powerpc64".to_string(),
|
||||||
options: TargetOptions {
|
options: TargetOptions { endian: "big".to_string(), mcount: "_mcount".to_string(), ..base },
|
||||||
target_endian: "big".to_string(),
|
|
||||||
target_mcount: "_mcount".to_string(),
|
|
||||||
..base
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,10 +15,6 @@ pub fn target() -> Target {
|
||||||
pointer_width: 64,
|
pointer_width: 64,
|
||||||
data_layout: "E-m:e-i64:64-n32:64".to_string(),
|
data_layout: "E-m:e-i64:64-n32:64".to_string(),
|
||||||
arch: "powerpc64".to_string(),
|
arch: "powerpc64".to_string(),
|
||||||
options: TargetOptions {
|
options: TargetOptions { endian: "big".to_string(), mcount: "_mcount".to_string(), ..base },
|
||||||
target_endian: "big".to_string(),
|
|
||||||
target_mcount: "_mcount".to_string(),
|
|
||||||
..base
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,10 +11,6 @@ pub fn target() -> Target {
|
||||||
pointer_width: 64,
|
pointer_width: 64,
|
||||||
data_layout: "E-m:e-i64:64-n32:64".to_string(),
|
data_layout: "E-m:e-i64:64-n32:64".to_string(),
|
||||||
arch: "powerpc64".to_string(),
|
arch: "powerpc64".to_string(),
|
||||||
options: TargetOptions {
|
options: TargetOptions { endian: "big".to_string(), mcount: "_mcount".to_string(), ..base },
|
||||||
target_endian: "big".to_string(),
|
|
||||||
target_mcount: "_mcount".to_string(),
|
|
||||||
..base
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,6 @@ pub fn target() -> Target {
|
||||||
pointer_width: 64,
|
pointer_width: 64,
|
||||||
data_layout: "E-m:e-i64:64-n32:64".to_string(),
|
data_layout: "E-m:e-i64:64-n32:64".to_string(),
|
||||||
arch: "powerpc64".to_string(),
|
arch: "powerpc64".to_string(),
|
||||||
options: TargetOptions { target_endian: "big".to_string(), ..base },
|
options: TargetOptions { endian: "big".to_string(), ..base },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,6 @@ pub fn target() -> Target {
|
||||||
pointer_width: 64,
|
pointer_width: 64,
|
||||||
data_layout: "e-m:e-i64:64-n32:64".to_string(),
|
data_layout: "e-m:e-i64:64-n32:64".to_string(),
|
||||||
arch: "powerpc64".to_string(),
|
arch: "powerpc64".to_string(),
|
||||||
options: TargetOptions { target_mcount: "_mcount".to_string(), ..base },
|
options: TargetOptions { mcount: "_mcount".to_string(), ..base },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,6 @@ pub fn target() -> Target {
|
||||||
pointer_width: 64,
|
pointer_width: 64,
|
||||||
data_layout: "e-m:e-i64:64-n32:64".to_string(),
|
data_layout: "e-m:e-i64:64-n32:64".to_string(),
|
||||||
arch: "powerpc64".to_string(),
|
arch: "powerpc64".to_string(),
|
||||||
options: TargetOptions { target_mcount: "_mcount".to_string(), ..base },
|
options: TargetOptions { mcount: "_mcount".to_string(), ..base },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,10 +10,6 @@ pub fn target() -> Target {
|
||||||
pointer_width: 32,
|
pointer_width: 32,
|
||||||
data_layout: "E-m:e-p:32:32-i64:64-n32".to_string(),
|
data_layout: "E-m:e-p:32:32-i64:64-n32".to_string(),
|
||||||
arch: "powerpc".to_string(),
|
arch: "powerpc".to_string(),
|
||||||
options: TargetOptions {
|
options: TargetOptions { endian: "big".to_string(), mcount: "_mcount".to_string(), ..base },
|
||||||
target_endian: "big".to_string(),
|
|
||||||
target_mcount: "_mcount".to_string(),
|
|
||||||
..base
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,10 +10,6 @@ pub fn target() -> Target {
|
||||||
pointer_width: 32,
|
pointer_width: 32,
|
||||||
data_layout: "E-m:e-p:32:32-i64:64-n32".to_string(),
|
data_layout: "E-m:e-p:32:32-i64:64-n32".to_string(),
|
||||||
arch: "powerpc".to_string(),
|
arch: "powerpc".to_string(),
|
||||||
options: TargetOptions {
|
options: TargetOptions { endian: "big".to_string(), mcount: "_mcount".to_string(), ..base },
|
||||||
target_endian: "big".to_string(),
|
|
||||||
target_mcount: "_mcount".to_string(),
|
|
||||||
..base
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,10 +10,6 @@ pub fn target() -> Target {
|
||||||
pointer_width: 32,
|
pointer_width: 32,
|
||||||
data_layout: "E-m:e-p:32:32-i64:64-n32".to_string(),
|
data_layout: "E-m:e-p:32:32-i64:64-n32".to_string(),
|
||||||
arch: "powerpc".to_string(),
|
arch: "powerpc".to_string(),
|
||||||
options: TargetOptions {
|
options: TargetOptions { endian: "big".to_string(), mcount: "_mcount".to_string(), ..base },
|
||||||
target_endian: "big".to_string(),
|
|
||||||
target_mcount: "_mcount".to_string(),
|
|
||||||
..base
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,8 +11,8 @@ pub fn target() -> Target {
|
||||||
data_layout: "E-m:e-p:32:32-i64:64-n32".to_string(),
|
data_layout: "E-m:e-p:32:32-i64:64-n32".to_string(),
|
||||||
arch: "powerpc".to_string(),
|
arch: "powerpc".to_string(),
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
target_endian: "big".to_string(),
|
endian: "big".to_string(),
|
||||||
target_mcount: "__mcount".to_string(),
|
mcount: "__mcount".to_string(),
|
||||||
..base
|
..base
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ pub fn target() -> Target {
|
||||||
data_layout: "E-m:e-p:32:32-i64:64-n32".to_string(),
|
data_layout: "E-m:e-p:32:32-i64:64-n32".to_string(),
|
||||||
arch: "powerpc".to_string(),
|
arch: "powerpc".to_string(),
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
target_endian: "big".to_string(),
|
endian: "big".to_string(),
|
||||||
features: "+secure-plt".to_string(),
|
features: "+secure-plt".to_string(),
|
||||||
..base
|
..base
|
||||||
},
|
},
|
||||||
|
|
|
@ -12,7 +12,7 @@ pub fn target() -> Target {
|
||||||
data_layout: "E-m:e-p:32:32-i64:64-n32".to_string(),
|
data_layout: "E-m:e-p:32:32-i64:64-n32".to_string(),
|
||||||
arch: "powerpc".to_string(),
|
arch: "powerpc".to_string(),
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
target_endian: "big".to_string(),
|
endian: "big".to_string(),
|
||||||
// feature msync would disable instruction 'fsync' which is not supported by fsl_p1p2
|
// feature msync would disable instruction 'fsync' which is not supported by fsl_p1p2
|
||||||
features: "+secure-plt,+msync".to_string(),
|
features: "+secure-plt,+msync".to_string(),
|
||||||
..base
|
..base
|
||||||
|
|
|
@ -19,11 +19,11 @@ pub fn opts() -> TargetOptions {
|
||||||
);
|
);
|
||||||
|
|
||||||
TargetOptions {
|
TargetOptions {
|
||||||
target_os: "redox".to_string(),
|
os: "redox".to_string(),
|
||||||
target_env: "relibc".to_string(),
|
env: "relibc".to_string(),
|
||||||
dynamic_linking: true,
|
dynamic_linking: true,
|
||||||
executables: true,
|
executables: true,
|
||||||
target_family: Some("unix".to_string()),
|
os_family: Some("unix".to_string()),
|
||||||
linker_is_gnu: true,
|
linker_is_gnu: true,
|
||||||
has_rpath: true,
|
has_rpath: true,
|
||||||
pre_link_args: args,
|
pre_link_args: args,
|
||||||
|
|
|
@ -2,7 +2,7 @@ use crate::spec::Target;
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
let mut base = super::linux_base::opts();
|
let mut base = super::linux_base::opts();
|
||||||
base.target_endian = "big".to_string();
|
base.endian = "big".to_string();
|
||||||
// z10 is the oldest CPU supported by LLVM
|
// z10 is the oldest CPU supported by LLVM
|
||||||
base.cpu = "z10".to_string();
|
base.cpu = "z10".to_string();
|
||||||
// FIXME: The data_layout string below and the ABI implementation in
|
// FIXME: The data_layout string below and the ABI implementation in
|
||||||
|
|
|
@ -2,12 +2,12 @@ use crate::spec::TargetOptions;
|
||||||
|
|
||||||
pub fn opts() -> TargetOptions {
|
pub fn opts() -> TargetOptions {
|
||||||
TargetOptions {
|
TargetOptions {
|
||||||
target_os: "solaris".to_string(),
|
os: "solaris".to_string(),
|
||||||
target_vendor: "sun".to_string(),
|
vendor: "sun".to_string(),
|
||||||
dynamic_linking: true,
|
dynamic_linking: true,
|
||||||
executables: true,
|
executables: true,
|
||||||
has_rpath: true,
|
has_rpath: true,
|
||||||
target_family: Some("unix".to_string()),
|
os_family: Some("unix".to_string()),
|
||||||
is_like_solaris: true,
|
is_like_solaris: true,
|
||||||
limit_rdylib_exports: false, // Linker doesn't support this
|
limit_rdylib_exports: false, // Linker doesn't support this
|
||||||
eh_frame_header: false,
|
eh_frame_header: false,
|
||||||
|
|
|
@ -2,7 +2,7 @@ use crate::spec::Target;
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
let mut base = super::linux_base::opts();
|
let mut base = super::linux_base::opts();
|
||||||
base.target_endian = "big".to_string();
|
base.endian = "big".to_string();
|
||||||
base.cpu = "v9".to_string();
|
base.cpu = "v9".to_string();
|
||||||
base.max_atomic_width = Some(64);
|
base.max_atomic_width = Some(64);
|
||||||
|
|
||||||
|
|
|
@ -12,8 +12,8 @@ pub fn target() -> Target {
|
||||||
data_layout: "E-m:e-i64:64-n32:64-S128".to_string(),
|
data_layout: "E-m:e-i64:64-n32:64-S128".to_string(),
|
||||||
arch: "sparc64".to_string(),
|
arch: "sparc64".to_string(),
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
target_endian: "big".to_string(),
|
endian: "big".to_string(),
|
||||||
target_mcount: "__mcount".to_string(),
|
mcount: "__mcount".to_string(),
|
||||||
..base
|
..base
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@ use crate::spec::{LinkerFlavor, Target};
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
let mut base = super::openbsd_base::opts();
|
let mut base = super::openbsd_base::opts();
|
||||||
base.target_endian = "big".to_string();
|
base.endian = "big".to_string();
|
||||||
base.cpu = "v9".to_string();
|
base.cpu = "v9".to_string();
|
||||||
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
|
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
|
||||||
base.max_atomic_width = Some(64);
|
base.max_atomic_width = Some(64);
|
||||||
|
|
|
@ -2,7 +2,7 @@ use crate::spec::{LinkerFlavor, Target};
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
let mut base = super::linux_base::opts();
|
let mut base = super::linux_base::opts();
|
||||||
base.target_endian = "big".to_string();
|
base.endian = "big".to_string();
|
||||||
base.cpu = "v9".to_string();
|
base.cpu = "v9".to_string();
|
||||||
base.max_atomic_width = Some(64);
|
base.max_atomic_width = Some(64);
|
||||||
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-mv8plus".to_string());
|
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-mv8plus".to_string());
|
||||||
|
|
|
@ -2,7 +2,7 @@ use crate::spec::{LinkerFlavor, Target};
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
let mut base = super::solaris_base::opts();
|
let mut base = super::solaris_base::opts();
|
||||||
base.target_endian = "big".to_string();
|
base.endian = "big".to_string();
|
||||||
base.pre_link_args.insert(LinkerFlavor::Gcc, vec!["-m64".to_string()]);
|
base.pre_link_args.insert(LinkerFlavor::Gcc, vec!["-m64".to_string()]);
|
||||||
// llvm calls this "v9"
|
// llvm calls this "v9"
|
||||||
base.cpu = "v9".to_string();
|
base.cpu = "v9".to_string();
|
||||||
|
|
|
@ -32,7 +32,7 @@ use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy, RelocModel, TargetOpti
|
||||||
pub fn opts() -> TargetOptions {
|
pub fn opts() -> TargetOptions {
|
||||||
// See rust-lang/rfcs#1645 for a discussion about these defaults
|
// See rust-lang/rfcs#1645 for a discussion about these defaults
|
||||||
TargetOptions {
|
TargetOptions {
|
||||||
target_vendor: String::new(),
|
vendor: String::new(),
|
||||||
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
|
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
|
||||||
executables: true,
|
executables: true,
|
||||||
// In most cases, LLD is good enough
|
// In most cases, LLD is good enough
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue