Rollup merge of #95202 - Urgau:check-cfg-perf-well-known-values, r=petrochenkov
Reduce the cost of loading all built-ins targets This PR started by measuring the exact slowdown of checking of well known conditional values. Than this PR implemented some technics to reduce the cost of loading all built-ins targets. cf. https://github.com/rust-lang/rust/issues/82450#issuecomment-1073992323
This commit is contained in:
commit
796bc7e9aa
226 changed files with 1337 additions and 1296 deletions
|
@ -304,8 +304,12 @@ pub(crate) fn run_aot(
|
||||||
};
|
};
|
||||||
|
|
||||||
// FIXME handle `-Ctarget-cpu=native`
|
// FIXME handle `-Ctarget-cpu=native`
|
||||||
let target_cpu =
|
let target_cpu = match tcx.sess.opts.cg.target_cpu {
|
||||||
tcx.sess.opts.cg.target_cpu.as_ref().unwrap_or(&tcx.sess.target.cpu).to_owned();
|
Some(ref name) => name,
|
||||||
|
None => tcx.sess.target.cpu.as_ref(),
|
||||||
|
}
|
||||||
|
.to_owned();
|
||||||
|
|
||||||
Box::new((
|
Box::new((
|
||||||
CodegenResults {
|
CodegenResults {
|
||||||
modules,
|
modules,
|
||||||
|
|
|
@ -287,8 +287,10 @@ fn handle_native(name: &str) -> &str {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn target_cpu(sess: &Session) -> &str {
|
pub fn target_cpu(sess: &Session) -> &str {
|
||||||
let name = sess.opts.cg.target_cpu.as_ref().unwrap_or(&sess.target.cpu);
|
match sess.opts.cg.target_cpu {
|
||||||
handle_native(name)
|
Some(ref name) => handle_native(name),
|
||||||
|
None => handle_native(sess.target.cpu.as_ref()),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn target_features(sess: &Session) -> Vec<Symbol> {
|
pub fn target_features(sess: &Session) -> Vec<Symbol> {
|
||||||
|
|
|
@ -116,7 +116,7 @@ fn instrument_function_attr<'ll>(cx: &CodegenCx<'ll, '_>) -> Option<&'ll Attribu
|
||||||
|
|
||||||
// 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 = cx.sess().target.mcount.as_str();
|
let mcount_name = cx.sess().target.mcount.as_ref();
|
||||||
|
|
||||||
Some(llvm::CreateAttrStringValue(
|
Some(llvm::CreateAttrStringValue(
|
||||||
cx.llcx,
|
cx.llcx,
|
||||||
|
|
|
@ -1452,7 +1452,7 @@ impl<'a, 'll, 'tcx> Builder<'a, 'll, 'tcx> {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn fptoint_sat_broken_in_llvm(&self) -> bool {
|
fn fptoint_sat_broken_in_llvm(&self) -> bool {
|
||||||
match self.tcx.sess.target.arch.as_str() {
|
match self.tcx.sess.target.arch.as_ref() {
|
||||||
// FIXME - https://bugs.llvm.org/show_bug.cgi?id=50083
|
// FIXME - https://bugs.llvm.org/show_bug.cgi?id=50083
|
||||||
"riscv64" => llvm_util::get_version() < (13, 0, 0),
|
"riscv64" => llvm_util::get_version() < (13, 0, 0),
|
||||||
_ => false,
|
_ => false,
|
||||||
|
|
|
@ -134,7 +134,7 @@ pub unsafe fn create_module<'ll>(
|
||||||
let mod_name = SmallCStr::new(mod_name);
|
let mod_name = SmallCStr::new(mod_name);
|
||||||
let llmod = llvm::LLVMModuleCreateWithNameInContext(mod_name.as_ptr(), llcx);
|
let llmod = llvm::LLVMModuleCreateWithNameInContext(mod_name.as_ptr(), llcx);
|
||||||
|
|
||||||
let mut target_data_layout = sess.target.data_layout.clone();
|
let mut target_data_layout = sess.target.data_layout.to_string();
|
||||||
let llvm_version = llvm_util::get_version();
|
let llvm_version = llvm_util::get_version();
|
||||||
if llvm_version < (13, 0, 0) {
|
if llvm_version < (13, 0, 0) {
|
||||||
if sess.target.arch == "powerpc64" {
|
if sess.target.arch == "powerpc64" {
|
||||||
|
@ -859,7 +859,7 @@ impl<'ll> CodegenCx<'ll, '_> {
|
||||||
|
|
||||||
// This isn't an "LLVM intrinsic", but LLVM's optimization passes
|
// This isn't an "LLVM intrinsic", but LLVM's optimization passes
|
||||||
// recognize it like one and we assume it exists in `core::slice::cmp`
|
// recognize it like one and we assume it exists in `core::slice::cmp`
|
||||||
match self.sess().target.arch.as_str() {
|
match self.sess().target.arch.as_ref() {
|
||||||
"avr" | "msp430" => ifn!("memcmp", fn(i8p, i8p, t_isize) -> t_i16),
|
"avr" | "msp430" => ifn!("memcmp", fn(i8p, i8p, t_isize) -> t_i16),
|
||||||
_ => ifn!("memcmp", fn(i8p, i8p, t_isize) -> t_i32),
|
_ => ifn!("memcmp", fn(i8p, i8p, t_isize) -> t_i32),
|
||||||
}
|
}
|
||||||
|
|
|
@ -329,7 +329,7 @@ impl<'ll, 'tcx> IntrinsicCallMethods<'tcx> for Builder<'_, 'll, 'tcx> {
|
||||||
let b_ptr = self.bitcast(b, i8p_ty);
|
let b_ptr = self.bitcast(b, i8p_ty);
|
||||||
let n = self.const_usize(layout.size().bytes());
|
let n = self.const_usize(layout.size().bytes());
|
||||||
let cmp = self.call_intrinsic("memcmp", &[a_ptr, b_ptr, n]);
|
let cmp = self.call_intrinsic("memcmp", &[a_ptr, b_ptr, n]);
|
||||||
match self.cx.sess().target.arch.as_str() {
|
match self.cx.sess().target.arch.as_ref() {
|
||||||
"avr" | "msp430" => self.icmp(IntPredicate::IntEQ, cmp, self.const_i16(0)),
|
"avr" | "msp430" => self.icmp(IntPredicate::IntEQ, cmp, self.const_i16(0)),
|
||||||
_ => self.icmp(IntPredicate::IntEQ, cmp, self.const_i32(0)),
|
_ => self.icmp(IntPredicate::IntEQ, cmp, self.const_i32(0)),
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,8 +61,8 @@ unsafe fn configure_llvm(sess: &Session) {
|
||||||
full_arg.trim().split(|c: char| c == '=' || c.is_whitespace()).next().unwrap_or("")
|
full_arg.trim().split(|c: char| c == '=' || c.is_whitespace()).next().unwrap_or("")
|
||||||
}
|
}
|
||||||
|
|
||||||
let cg_opts = sess.opts.cg.llvm_args.iter();
|
let cg_opts = sess.opts.cg.llvm_args.iter().map(AsRef::as_ref);
|
||||||
let tg_opts = sess.target.llvm_args.iter();
|
let tg_opts = sess.target.llvm_args.iter().map(AsRef::as_ref);
|
||||||
let sess_args = cg_opts.chain(tg_opts);
|
let sess_args = cg_opts.chain(tg_opts);
|
||||||
|
|
||||||
let user_specified_args: FxHashSet<_> =
|
let user_specified_args: FxHashSet<_> =
|
||||||
|
@ -375,8 +375,10 @@ fn handle_native(name: &str) -> &str {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn target_cpu(sess: &Session) -> &str {
|
pub fn target_cpu(sess: &Session) -> &str {
|
||||||
let name = sess.opts.cg.target_cpu.as_ref().unwrap_or(&sess.target.cpu);
|
match sess.opts.cg.target_cpu {
|
||||||
handle_native(name)
|
Some(ref name) => handle_native(name),
|
||||||
|
None => handle_native(sess.target.cpu.as_ref()),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The list of LLVM features computed from CLI flags (`-Ctarget-cpu`, `-Ctarget-feature`,
|
/// The list of LLVM features computed from CLI flags (`-Ctarget-cpu`, `-Ctarget-feature`,
|
||||||
|
|
|
@ -40,6 +40,7 @@ use std::ffi::OsString;
|
||||||
use std::fs::{File, OpenOptions};
|
use std::fs::{File, OpenOptions};
|
||||||
use std::io::{BufWriter, Write};
|
use std::io::{BufWriter, Write};
|
||||||
use std::lazy::OnceCell;
|
use std::lazy::OnceCell;
|
||||||
|
use std::ops::Deref;
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
use std::process::{ExitStatus, Output, Stdio};
|
use std::process::{ExitStatus, Output, Stdio};
|
||||||
use std::{ascii, char, env, fmt, fs, io, mem, str};
|
use std::{ascii, char, env, fmt, fs, io, mem, str};
|
||||||
|
@ -674,11 +675,11 @@ fn link_natively<'a, B: ArchiveBuilder<'a>>(
|
||||||
|
|
||||||
linker::disable_localization(&mut cmd);
|
linker::disable_localization(&mut cmd);
|
||||||
|
|
||||||
for &(ref k, ref v) in &sess.target.link_env {
|
for &(ref k, ref v) in sess.target.link_env.as_ref() {
|
||||||
cmd.env(k, v);
|
cmd.env(k.as_ref(), v.as_ref());
|
||||||
}
|
}
|
||||||
for k in &sess.target.link_env_remove {
|
for k in sess.target.link_env_remove.as_ref() {
|
||||||
cmd.env_remove(k);
|
cmd.env_remove(k.as_ref());
|
||||||
}
|
}
|
||||||
|
|
||||||
if sess.opts.prints.contains(&PrintRequest::LinkArgs) {
|
if sess.opts.prints.contains(&PrintRequest::LinkArgs) {
|
||||||
|
@ -1216,7 +1217,7 @@ pub fn linker_and_flavor(sess: &Session) -> (PathBuf, LinkerFlavor) {
|
||||||
|
|
||||||
if let Some(ret) = infer_from(
|
if let Some(ret) = infer_from(
|
||||||
sess,
|
sess,
|
||||||
sess.target.linker.clone().map(PathBuf::from),
|
sess.target.linker.as_deref().map(PathBuf::from),
|
||||||
Some(sess.target.linker_flavor),
|
Some(sess.target.linker_flavor),
|
||||||
) {
|
) {
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -1586,7 +1587,7 @@ fn add_post_link_objects(
|
||||||
/// FIXME: Determine where exactly these args need to be inserted.
|
/// FIXME: Determine where exactly these args need to be inserted.
|
||||||
fn add_pre_link_args(cmd: &mut dyn Linker, sess: &Session, flavor: LinkerFlavor) {
|
fn add_pre_link_args(cmd: &mut dyn Linker, sess: &Session, flavor: LinkerFlavor) {
|
||||||
if let Some(args) = sess.target.pre_link_args.get(&flavor) {
|
if let Some(args) = sess.target.pre_link_args.get(&flavor) {
|
||||||
cmd.args(args);
|
cmd.args(args.iter().map(Deref::deref));
|
||||||
}
|
}
|
||||||
cmd.args(&sess.opts.debugging_opts.pre_link_args);
|
cmd.args(&sess.opts.debugging_opts.pre_link_args);
|
||||||
}
|
}
|
||||||
|
@ -1602,7 +1603,7 @@ fn add_link_script(cmd: &mut dyn Linker, sess: &Session, tmpdir: &Path, crate_ty
|
||||||
let file_name = ["rustc", &sess.target.llvm_target, "linkfile.ld"].join("-");
|
let file_name = ["rustc", &sess.target.llvm_target, "linkfile.ld"].join("-");
|
||||||
|
|
||||||
let path = tmpdir.join(file_name);
|
let path = tmpdir.join(file_name);
|
||||||
if let Err(e) = fs::write(&path, script) {
|
if let Err(e) = fs::write(&path, script.as_ref()) {
|
||||||
sess.fatal(&format!("failed to write link script to {}: {}", path.display(), e));
|
sess.fatal(&format!("failed to write link script to {}: {}", path.display(), e));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1634,15 +1635,15 @@ fn add_late_link_args(
|
||||||
});
|
});
|
||||||
if any_dynamic_crate {
|
if any_dynamic_crate {
|
||||||
if let Some(args) = sess.target.late_link_args_dynamic.get(&flavor) {
|
if let Some(args) = sess.target.late_link_args_dynamic.get(&flavor) {
|
||||||
cmd.args(args);
|
cmd.args(args.iter().map(Deref::deref));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if let Some(args) = sess.target.late_link_args_static.get(&flavor) {
|
if let Some(args) = sess.target.late_link_args_static.get(&flavor) {
|
||||||
cmd.args(args);
|
cmd.args(args.iter().map(Deref::deref));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if let Some(args) = sess.target.late_link_args.get(&flavor) {
|
if let Some(args) = sess.target.late_link_args.get(&flavor) {
|
||||||
cmd.args(args);
|
cmd.args(args.iter().map(Deref::deref));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1650,7 +1651,7 @@ fn add_late_link_args(
|
||||||
/// FIXME: Determine where exactly these args need to be inserted.
|
/// FIXME: Determine where exactly these args need to be inserted.
|
||||||
fn add_post_link_args(cmd: &mut dyn Linker, sess: &Session, flavor: LinkerFlavor) {
|
fn add_post_link_args(cmd: &mut dyn Linker, sess: &Session, flavor: LinkerFlavor) {
|
||||||
if let Some(args) = sess.target.post_link_args.get(&flavor) {
|
if let Some(args) = sess.target.post_link_args.get(&flavor) {
|
||||||
cmd.args(args);
|
cmd.args(args.iter().map(Deref::deref));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1960,8 +1961,8 @@ fn add_order_independent_options(
|
||||||
cmd.arg(&codegen_results.crate_info.target_cpu);
|
cmd.arg(&codegen_results.crate_info.target_cpu);
|
||||||
cmd.arg("--cpu-features");
|
cmd.arg("--cpu-features");
|
||||||
cmd.arg(match &sess.opts.cg.target_feature {
|
cmd.arg(match &sess.opts.cg.target_feature {
|
||||||
feat if !feat.is_empty() => feat,
|
feat if !feat.is_empty() => feat.as_ref(),
|
||||||
_ => &sess.target.options.features,
|
_ => sess.target.options.features.as_ref(),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2478,12 +2479,12 @@ fn add_apple_sdk(cmd: &mut dyn Linker, sess: &Session, flavor: LinkerFlavor) {
|
||||||
let os = &sess.target.os;
|
let os = &sess.target.os;
|
||||||
let llvm_target = &sess.target.llvm_target;
|
let llvm_target = &sess.target.llvm_target;
|
||||||
if sess.target.vendor != "apple"
|
if sess.target.vendor != "apple"
|
||||||
|| !matches!(os.as_str(), "ios" | "tvos")
|
|| !matches!(os.as_ref(), "ios" | "tvos")
|
||||||
|| flavor != LinkerFlavor::Gcc
|
|| flavor != LinkerFlavor::Gcc
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let sdk_name = match (arch.as_str(), os.as_str()) {
|
let sdk_name = match (arch.as_ref(), os.as_ref()) {
|
||||||
("aarch64", "tvos") => "appletvos",
|
("aarch64", "tvos") => "appletvos",
|
||||||
("x86_64", "tvos") => "appletvsimulator",
|
("x86_64", "tvos") => "appletvsimulator",
|
||||||
("arm", "ios") => "iphoneos",
|
("arm", "ios") => "iphoneos",
|
||||||
|
|
|
@ -75,7 +75,7 @@ pub fn get_linker<'a>(
|
||||||
if let Some(ref tool) = msvc_tool {
|
if let Some(ref tool) = msvc_tool {
|
||||||
let original_path = tool.path();
|
let original_path = tool.path();
|
||||||
if let Some(ref root_lib_path) = original_path.ancestors().nth(4) {
|
if let Some(ref root_lib_path) = original_path.ancestors().nth(4) {
|
||||||
let arch = match t.arch.as_str() {
|
let arch = match t.arch.as_ref() {
|
||||||
"x86_64" => Some("x64"),
|
"x86_64" => Some("x64"),
|
||||||
"x86" => Some("x86"),
|
"x86" => Some("x86"),
|
||||||
"aarch64" => Some("arm64"),
|
"aarch64" => Some("arm64"),
|
||||||
|
@ -1520,7 +1520,7 @@ impl<'a> L4Bender<'a> {
|
||||||
|
|
||||||
pub(crate) fn exported_symbols(tcx: TyCtxt<'_>, crate_type: CrateType) -> Vec<String> {
|
pub(crate) fn exported_symbols(tcx: TyCtxt<'_>, crate_type: CrateType) -> Vec<String> {
|
||||||
if let Some(ref exports) = tcx.sess.target.override_export_symbols {
|
if let Some(ref exports) = tcx.sess.target.override_export_symbols {
|
||||||
return exports.clone();
|
return exports.iter().map(ToString::to_string).collect();
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut symbols = Vec::new();
|
let mut symbols = Vec::new();
|
||||||
|
|
|
@ -218,7 +218,7 @@ impl ModuleConfig {
|
||||||
false
|
false
|
||||||
),
|
),
|
||||||
emit_obj,
|
emit_obj,
|
||||||
bc_cmdline: sess.target.bitcode_llvm_cmdline.clone(),
|
bc_cmdline: sess.target.bitcode_llvm_cmdline.to_string(),
|
||||||
|
|
||||||
verify_llvm_ir: sess.verify_llvm_ir(),
|
verify_llvm_ir: sess.verify_llvm_ir(),
|
||||||
no_prepopulate_passes: sess.opts.cg.no_prepopulate_passes,
|
no_prepopulate_passes: sess.opts.cg.no_prepopulate_passes,
|
||||||
|
@ -1061,7 +1061,7 @@ fn start_executing_work<B: ExtraBackendMethods>(
|
||||||
is_pe_coff: tcx.sess.target.is_like_windows,
|
is_pe_coff: tcx.sess.target.is_like_windows,
|
||||||
target_can_use_split_dwarf: tcx.sess.target_can_use_split_dwarf(),
|
target_can_use_split_dwarf: tcx.sess.target_can_use_split_dwarf(),
|
||||||
target_pointer_width: tcx.sess.target.pointer_width,
|
target_pointer_width: tcx.sess.target.pointer_width,
|
||||||
target_arch: tcx.sess.target.arch.clone(),
|
target_arch: tcx.sess.target.arch.to_string(),
|
||||||
debuginfo: tcx.sess.opts.debuginfo,
|
debuginfo: tcx.sess.opts.debuginfo,
|
||||||
split_debuginfo: tcx.sess.split_debuginfo(),
|
split_debuginfo: tcx.sess.split_debuginfo(),
|
||||||
split_dwarf_kind: tcx.sess.opts.debugging_opts.split_dwarf_kind,
|
split_dwarf_kind: tcx.sess.opts.debugging_opts.split_dwarf_kind,
|
||||||
|
|
|
@ -416,10 +416,10 @@ impl<'a> CrateLocator<'a> {
|
||||||
(&f[rlib_prefix.len()..(f.len() - rlib_suffix.len())], CrateFlavor::Rlib)
|
(&f[rlib_prefix.len()..(f.len() - rlib_suffix.len())], CrateFlavor::Rlib)
|
||||||
} else if f.starts_with(rmeta_prefix) && f.ends_with(rmeta_suffix) {
|
} else if f.starts_with(rmeta_prefix) && f.ends_with(rmeta_suffix) {
|
||||||
(&f[rmeta_prefix.len()..(f.len() - rmeta_suffix.len())], CrateFlavor::Rmeta)
|
(&f[rmeta_prefix.len()..(f.len() - rmeta_suffix.len())], CrateFlavor::Rmeta)
|
||||||
} else if f.starts_with(dylib_prefix) && f.ends_with(dylib_suffix) {
|
} else if f.starts_with(dylib_prefix) && f.ends_with(dylib_suffix.as_ref()) {
|
||||||
(&f[dylib_prefix.len()..(f.len() - dylib_suffix.len())], CrateFlavor::Dylib)
|
(&f[dylib_prefix.len()..(f.len() - dylib_suffix.len())], CrateFlavor::Dylib)
|
||||||
} else {
|
} else {
|
||||||
if f.starts_with(staticlib_prefix) && f.ends_with(staticlib_suffix) {
|
if f.starts_with(staticlib_prefix) && f.ends_with(staticlib_suffix.as_ref()) {
|
||||||
self.crate_rejections.via_kind.push(CrateMismatch {
|
self.crate_rejections.via_kind.push(CrateMismatch {
|
||||||
path: spf.path.clone(),
|
path: spf.path.clone(),
|
||||||
got: "static".to_string(),
|
got: "static".to_string(),
|
||||||
|
@ -698,8 +698,8 @@ impl<'a> CrateLocator<'a> {
|
||||||
};
|
};
|
||||||
|
|
||||||
if file.starts_with("lib") && (file.ends_with(".rlib") || file.ends_with(".rmeta"))
|
if file.starts_with("lib") && (file.ends_with(".rlib") || file.ends_with(".rmeta"))
|
||||||
|| file.starts_with(&self.target.dll_prefix)
|
|| file.starts_with(self.target.dll_prefix.as_ref())
|
||||||
&& file.ends_with(&self.target.dll_suffix)
|
&& file.ends_with(self.target.dll_suffix.as_ref())
|
||||||
{
|
{
|
||||||
// Make sure there's at most one rlib and at most one dylib.
|
// Make sure there's at most one rlib and at most one dylib.
|
||||||
// Note to take care and match against the non-canonicalized name:
|
// Note to take care and match against the non-canonicalized name:
|
||||||
|
@ -733,8 +733,8 @@ impl<'a> CrateLocator<'a> {
|
||||||
crate_name: self.crate_name,
|
crate_name: self.crate_name,
|
||||||
root,
|
root,
|
||||||
triple: self.triple,
|
triple: self.triple,
|
||||||
dll_prefix: self.target.dll_prefix.clone(),
|
dll_prefix: self.target.dll_prefix.to_string(),
|
||||||
dll_suffix: self.target.dll_suffix.clone(),
|
dll_suffix: self.target.dll_suffix.to_string(),
|
||||||
crate_rejections: self.crate_rejections,
|
crate_rejections: self.crate_rejections,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -170,6 +170,7 @@ use self::JsonEvent::*;
|
||||||
use self::ParserError::*;
|
use self::ParserError::*;
|
||||||
use self::ParserState::*;
|
use self::ParserState::*;
|
||||||
|
|
||||||
|
use std::borrow::Cow;
|
||||||
use std::collections::{BTreeMap, HashMap};
|
use std::collections::{BTreeMap, HashMap};
|
||||||
use std::mem::swap;
|
use std::mem::swap;
|
||||||
use std::num::FpCategory as Fp;
|
use std::num::FpCategory as Fp;
|
||||||
|
@ -2196,6 +2197,12 @@ impl ToJson for string::String {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<'a> ToJson for Cow<'a, str> {
|
||||||
|
fn to_json(&self) -> Json {
|
||||||
|
Json::String(self.to_string())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
macro_rules! tuple_impl {
|
macro_rules! tuple_impl {
|
||||||
// use variables to indicate the arity of the tuple
|
// use variables to indicate the arity of the tuple
|
||||||
($($tyvar:ident),* ) => {
|
($($tyvar:ident),* ) => {
|
||||||
|
@ -2240,6 +2247,15 @@ impl<A: ToJson> ToJson for Vec<A> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<'a, A: ToJson> ToJson for Cow<'a, [A]>
|
||||||
|
where
|
||||||
|
[A]: ToOwned,
|
||||||
|
{
|
||||||
|
fn to_json(&self) -> Json {
|
||||||
|
Json::Array(self.iter().map(|elt| elt.to_json()).collect())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<T: ToString, A: ToJson> ToJson for BTreeMap<T, A> {
|
impl<T: ToString, A: ToJson> ToJson for BTreeMap<T, A> {
|
||||||
fn to_json(&self) -> Json {
|
fn to_json(&self) -> Json {
|
||||||
let mut d = BTreeMap::new();
|
let mut d = BTreeMap::new();
|
||||||
|
|
|
@ -956,7 +956,7 @@ fn default_configuration(sess: &Session) -> CrateConfig {
|
||||||
ret.reserve(7); // the minimum number of insertions
|
ret.reserve(7); // 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))));
|
||||||
for fam in &sess.target.families {
|
for fam in sess.target.families.as_ref() {
|
||||||
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));
|
||||||
|
|
|
@ -2,14 +2,14 @@ use crate::spec::{FramePointer, LinkerFlavor, SanitizerSet, Target, TargetOption
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
let mut base = super::apple_base::opts("macos");
|
let mut base = super::apple_base::opts("macos");
|
||||||
base.cpu = "apple-a14".to_string();
|
base.cpu = "apple-a14".into();
|
||||||
base.max_atomic_width = Some(128);
|
base.max_atomic_width = Some(128);
|
||||||
|
|
||||||
// FIXME: The leak sanitizer currently fails the tests, see #88132.
|
// FIXME: The leak sanitizer currently fails the tests, see #88132.
|
||||||
base.supported_sanitizers = SanitizerSet::ADDRESS | SanitizerSet::CFI | SanitizerSet::THREAD;
|
base.supported_sanitizers = SanitizerSet::ADDRESS | SanitizerSet::CFI | SanitizerSet::THREAD;
|
||||||
|
|
||||||
base.pre_link_args.insert(LinkerFlavor::Gcc, vec!["-arch".to_string(), "arm64".to_string()]);
|
base.pre_link_args.insert(LinkerFlavor::Gcc, vec!["-arch".into(), "arm64".into()]);
|
||||||
base.link_env_remove.extend(super::apple_base::macos_link_env_remove());
|
base.link_env_remove.to_mut().extend(super::apple_base::macos_link_env_remove());
|
||||||
|
|
||||||
// Clang automatically chooses a more specific target based on
|
// Clang automatically chooses a more specific target based on
|
||||||
// MACOSX_DEPLOYMENT_TARGET. To enable cross-language LTO to work
|
// MACOSX_DEPLOYMENT_TARGET. To enable cross-language LTO to work
|
||||||
|
@ -17,12 +17,12 @@ pub fn target() -> Target {
|
||||||
let llvm_target = super::apple_base::macos_llvm_target("arm64");
|
let llvm_target = super::apple_base::macos_llvm_target("arm64");
|
||||||
|
|
||||||
Target {
|
Target {
|
||||||
llvm_target,
|
llvm_target: llvm_target.into(),
|
||||||
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".into(),
|
||||||
arch: "aarch64".to_string(),
|
arch: "aarch64".into(),
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
mcount: "\u{1}mcount".to_string(),
|
mcount: "\u{1}mcount".into(),
|
||||||
frame_pointer: FramePointer::NonLeaf,
|
frame_pointer: FramePointer::NonLeaf,
|
||||||
..base
|
..base
|
||||||
},
|
},
|
||||||
|
|
|
@ -10,12 +10,12 @@ pub fn target() -> Target {
|
||||||
let llvm_target = super::apple_base::ios_llvm_target(arch);
|
let llvm_target = super::apple_base::ios_llvm_target(arch);
|
||||||
|
|
||||||
Target {
|
Target {
|
||||||
llvm_target,
|
llvm_target: llvm_target.into(),
|
||||||
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".into(),
|
||||||
arch: "aarch64".to_string(),
|
arch: "aarch64".into(),
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
features: "+neon,+fp-armv8,+apple-a7".to_string(),
|
features: "+neon,+fp-armv8,+apple-a7".into(),
|
||||||
max_atomic_width: Some(128),
|
max_atomic_width: Some(128),
|
||||||
forces_embed_bitcode: true,
|
forces_embed_bitcode: true,
|
||||||
frame_pointer: FramePointer::NonLeaf,
|
frame_pointer: FramePointer::NonLeaf,
|
||||||
|
@ -29,7 +29,7 @@ pub fn target() -> Target {
|
||||||
-target-abi\0\
|
-target-abi\0\
|
||||||
darwinpcs\0\
|
darwinpcs\0\
|
||||||
-Os\0"
|
-Os\0"
|
||||||
.to_string(),
|
.into(),
|
||||||
..opts("ios", Arch::Arm64)
|
..opts("ios", Arch::Arm64)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,12 +3,12 @@ use crate::spec::{FramePointer, Target, TargetOptions};
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "arm64-apple-ios14.0-macabi".to_string(),
|
llvm_target: "arm64-apple-ios14.0-macabi".into(),
|
||||||
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".into(),
|
||||||
arch: "aarch64".to_string(),
|
arch: "aarch64".into(),
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
features: "+neon,+fp-armv8,+apple-a12".to_string(),
|
features: "+neon,+fp-armv8,+apple-a12".into(),
|
||||||
max_atomic_width: Some(128),
|
max_atomic_width: Some(128),
|
||||||
forces_embed_bitcode: true,
|
forces_embed_bitcode: true,
|
||||||
frame_pointer: FramePointer::NonLeaf,
|
frame_pointer: FramePointer::NonLeaf,
|
||||||
|
@ -20,7 +20,7 @@ pub fn target() -> Target {
|
||||||
-emit-obj\0\
|
-emit-obj\0\
|
||||||
-disable-llvm-passes\0\
|
-disable-llvm-passes\0\
|
||||||
-Os\0"
|
-Os\0"
|
||||||
.to_string(),
|
.into(),
|
||||||
..opts("ios", Arch::Arm64_macabi)
|
..opts("ios", Arch::Arm64_macabi)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,12 +12,12 @@ pub fn target() -> Target {
|
||||||
let llvm_target = super::apple_base::ios_sim_llvm_target(arch);
|
let llvm_target = super::apple_base::ios_sim_llvm_target(arch);
|
||||||
|
|
||||||
Target {
|
Target {
|
||||||
llvm_target: llvm_target,
|
llvm_target: llvm_target.into(),
|
||||||
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".into(),
|
||||||
arch: "aarch64".to_string(),
|
arch: "aarch64".into(),
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
features: "+neon,+fp-armv8,+apple-a7".to_string(),
|
features: "+neon,+fp-armv8,+apple-a7".into(),
|
||||||
max_atomic_width: Some(128),
|
max_atomic_width: Some(128),
|
||||||
forces_embed_bitcode: true,
|
forces_embed_bitcode: true,
|
||||||
frame_pointer: FramePointer::NonLeaf,
|
frame_pointer: FramePointer::NonLeaf,
|
||||||
|
@ -31,7 +31,7 @@ pub fn target() -> Target {
|
||||||
-target-abi\0\
|
-target-abi\0\
|
||||||
darwinpcs\0\
|
darwinpcs\0\
|
||||||
-Os\0"
|
-Os\0"
|
||||||
.to_string(),
|
.into(),
|
||||||
..base
|
..base
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,12 +3,12 @@ use crate::spec::{FramePointer, Target, TargetOptions};
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "arm64-apple-tvos".to_string(),
|
llvm_target: "arm64-apple-tvos".into(),
|
||||||
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".into(),
|
||||||
arch: "aarch64".to_string(),
|
arch: "aarch64".into(),
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
features: "+neon,+fp-armv8,+apple-a7".to_string(),
|
features: "+neon,+fp-armv8,+apple-a7".into(),
|
||||||
max_atomic_width: Some(128),
|
max_atomic_width: Some(128),
|
||||||
forces_embed_bitcode: true,
|
forces_embed_bitcode: true,
|
||||||
frame_pointer: FramePointer::NonLeaf,
|
frame_pointer: FramePointer::NonLeaf,
|
||||||
|
|
|
@ -3,14 +3,14 @@ use crate::spec::{Target, TargetOptions};
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "aarch64_be-unknown-linux-gnu".to_string(),
|
llvm_target: "aarch64_be-unknown-linux-gnu".into(),
|
||||||
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".into(),
|
||||||
arch: "aarch64".to_string(),
|
arch: "aarch64".into(),
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
features: "+outline-atomics".to_string(),
|
features: "+outline-atomics".into(),
|
||||||
max_atomic_width: Some(128),
|
max_atomic_width: Some(128),
|
||||||
mcount: "\u{1}_mcount".to_string(),
|
mcount: "\u{1}_mcount".into(),
|
||||||
endian: Endian::Big,
|
endian: Endian::Big,
|
||||||
..super::linux_gnu_base::opts()
|
..super::linux_gnu_base::opts()
|
||||||
},
|
},
|
||||||
|
|
|
@ -6,14 +6,14 @@ pub fn target() -> Target {
|
||||||
base.max_atomic_width = Some(128);
|
base.max_atomic_width = Some(128);
|
||||||
|
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "aarch64_be-unknown-linux-gnu_ilp32".to_string(),
|
llvm_target: "aarch64_be-unknown-linux-gnu_ilp32".into(),
|
||||||
pointer_width: 32,
|
pointer_width: 32,
|
||||||
data_layout: "E-m:e-p:32:32-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".to_string(),
|
data_layout: "E-m:e-p:32:32-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".into(),
|
||||||
arch: "aarch64".to_string(),
|
arch: "aarch64".into(),
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
abi: "ilp32".to_string(),
|
abi: "ilp32".into(),
|
||||||
features: "+outline-atomics".to_string(),
|
features: "+outline-atomics".into(),
|
||||||
mcount: "\u{1}_mcount".to_string(),
|
mcount: "\u{1}_mcount".into(),
|
||||||
endian: Endian::Big,
|
endian: Endian::Big,
|
||||||
..base
|
..base
|
||||||
},
|
},
|
||||||
|
|
|
@ -2,10 +2,10 @@ use crate::spec::{SanitizerSet, Target, TargetOptions};
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "aarch64-fuchsia".to_string(),
|
llvm_target: "aarch64-fuchsia".into(),
|
||||||
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".into(),
|
||||||
arch: "aarch64".to_string(),
|
arch: "aarch64".into(),
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
max_atomic_width: Some(128),
|
max_atomic_width: Some(128),
|
||||||
supported_sanitizers: SanitizerSet::ADDRESS | SanitizerSet::CFI,
|
supported_sanitizers: SanitizerSet::ADDRESS | SanitizerSet::CFI,
|
||||||
|
|
|
@ -3,13 +3,13 @@ use super::{RelocModel, Target, TargetOptions};
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
let base = super::solid_base::opts("asp3");
|
let base = super::solid_base::opts("asp3");
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "aarch64-unknown-none".to_string(),
|
llvm_target: "aarch64-unknown-none".into(),
|
||||||
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".into(),
|
||||||
arch: "aarch64".to_string(),
|
arch: "aarch64".into(),
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
linker: Some("aarch64-kmc-elf-gcc".to_owned()),
|
linker: Some("aarch64-kmc-elf-gcc".into()),
|
||||||
features: "+neon,+fp-armv8".to_string(),
|
features: "+neon,+fp-armv8".into(),
|
||||||
relocation_model: RelocModel::Static,
|
relocation_model: RelocModel::Static,
|
||||||
disable_redzone: true,
|
disable_redzone: true,
|
||||||
max_atomic_width: Some(128),
|
max_atomic_width: Some(128),
|
||||||
|
|
|
@ -5,15 +5,15 @@ use crate::spec::{SanitizerSet, Target, TargetOptions};
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "aarch64-linux-android".to_string(),
|
llvm_target: "aarch64-linux-android".into(),
|
||||||
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".into(),
|
||||||
arch: "aarch64".to_string(),
|
arch: "aarch64".into(),
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
max_atomic_width: Some(128),
|
max_atomic_width: Some(128),
|
||||||
// As documented in https://developer.android.com/ndk/guides/cpu-features.html
|
// As documented in https://developer.android.com/ndk/guides/cpu-features.html
|
||||||
// the neon (ASIMD) and FP must exist on all android aarch64 targets.
|
// the neon (ASIMD) and FP must exist on all android aarch64 targets.
|
||||||
features: "+neon,+fp-armv8".to_string(),
|
features: "+neon,+fp-armv8".into(),
|
||||||
supported_sanitizers: SanitizerSet::CFI
|
supported_sanitizers: SanitizerSet::CFI
|
||||||
| SanitizerSet::HWADDRESS
|
| SanitizerSet::HWADDRESS
|
||||||
| SanitizerSet::MEMTAG
|
| SanitizerSet::MEMTAG
|
||||||
|
|
|
@ -3,13 +3,13 @@ use crate::spec::Target;
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
let mut base = super::windows_msvc_base::opts();
|
let mut base = super::windows_msvc_base::opts();
|
||||||
base.max_atomic_width = Some(64);
|
base.max_atomic_width = Some(64);
|
||||||
base.features = "+neon,+fp-armv8".to_string();
|
base.features = "+neon,+fp-armv8".into();
|
||||||
|
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "aarch64-pc-windows-msvc".to_string(),
|
llvm_target: "aarch64-pc-windows-msvc".into(),
|
||||||
pointer_width: 64,
|
pointer_width: 64,
|
||||||
data_layout: "e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128".to_string(),
|
data_layout: "e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128".into(),
|
||||||
arch: "aarch64".to_string(),
|
arch: "aarch64".into(),
|
||||||
options: base,
|
options: base,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,10 +2,10 @@ use crate::spec::{SanitizerSet, Target, TargetOptions};
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "aarch64-unknown-freebsd".to_string(),
|
llvm_target: "aarch64-unknown-freebsd".into(),
|
||||||
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".into(),
|
||||||
arch: "aarch64".to_string(),
|
arch: "aarch64".into(),
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
max_atomic_width: Some(128),
|
max_atomic_width: Some(128),
|
||||||
supported_sanitizers: SanitizerSet::ADDRESS
|
supported_sanitizers: SanitizerSet::ADDRESS
|
||||||
|
|
|
@ -3,13 +3,13 @@ use crate::spec::Target;
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
let mut base = super::hermit_base::opts();
|
let mut base = super::hermit_base::opts();
|
||||||
base.max_atomic_width = Some(128);
|
base.max_atomic_width = Some(128);
|
||||||
base.features = "+strict-align,+neon,+fp-armv8".to_string();
|
base.features = "+strict-align,+neon,+fp-armv8".into();
|
||||||
|
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "aarch64-unknown-hermit".to_string(),
|
llvm_target: "aarch64-unknown-hermit".into(),
|
||||||
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".into(),
|
||||||
arch: "aarch64".to_string(),
|
arch: "aarch64".into(),
|
||||||
options: base,
|
options: base,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,13 +2,13 @@ use crate::spec::{SanitizerSet, Target, TargetOptions};
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "aarch64-unknown-linux-gnu".to_string(),
|
llvm_target: "aarch64-unknown-linux-gnu".into(),
|
||||||
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".into(),
|
||||||
arch: "aarch64".to_string(),
|
arch: "aarch64".into(),
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
features: "+outline-atomics".to_string(),
|
features: "+outline-atomics".into(),
|
||||||
mcount: "\u{1}_mcount".to_string(),
|
mcount: "\u{1}_mcount".into(),
|
||||||
max_atomic_width: Some(128),
|
max_atomic_width: Some(128),
|
||||||
supported_sanitizers: SanitizerSet::ADDRESS
|
supported_sanitizers: SanitizerSet::ADDRESS
|
||||||
| SanitizerSet::CFI
|
| SanitizerSet::CFI
|
||||||
|
|
|
@ -2,15 +2,15 @@ use crate::spec::{Target, TargetOptions};
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "aarch64-unknown-linux-gnu_ilp32".to_string(),
|
llvm_target: "aarch64-unknown-linux-gnu_ilp32".into(),
|
||||||
pointer_width: 32,
|
pointer_width: 32,
|
||||||
data_layout: "e-m:e-p:32:32-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".to_string(),
|
data_layout: "e-m:e-p:32:32-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".into(),
|
||||||
arch: "aarch64".to_string(),
|
arch: "aarch64".into(),
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
abi: "ilp32".to_string(),
|
abi: "ilp32".into(),
|
||||||
features: "+outline-atomics".to_string(),
|
features: "+outline-atomics".into(),
|
||||||
max_atomic_width: Some(128),
|
max_atomic_width: Some(128),
|
||||||
mcount: "\u{1}_mcount".to_string(),
|
mcount: "\u{1}_mcount".into(),
|
||||||
..super::linux_gnu_base::opts()
|
..super::linux_gnu_base::opts()
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,10 +5,10 @@ pub fn target() -> Target {
|
||||||
base.max_atomic_width = Some(128);
|
base.max_atomic_width = Some(128);
|
||||||
|
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "aarch64-unknown-linux-musl".to_string(),
|
llvm_target: "aarch64-unknown-linux-musl".into(),
|
||||||
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".into(),
|
||||||
arch: "aarch64".to_string(),
|
arch: "aarch64".into(),
|
||||||
options: TargetOptions { mcount: "\u{1}_mcount".to_string(), ..base },
|
options: TargetOptions { mcount: "\u{1}_mcount".into(), ..base },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,12 +2,12 @@ use crate::spec::{Target, TargetOptions};
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "aarch64-unknown-netbsd".to_string(),
|
llvm_target: "aarch64-unknown-netbsd".into(),
|
||||||
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".into(),
|
||||||
arch: "aarch64".to_string(),
|
arch: "aarch64".into(),
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
mcount: "__mcount".to_string(),
|
mcount: "__mcount".into(),
|
||||||
max_atomic_width: Some(128),
|
max_atomic_width: Some(128),
|
||||||
..super::netbsd_base::opts()
|
..super::netbsd_base::opts()
|
||||||
},
|
},
|
||||||
|
|
|
@ -11,8 +11,8 @@ use super::{LinkerFlavor, LldFlavor, PanicStrategy, RelocModel, Target, TargetOp
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
let opts = TargetOptions {
|
let opts = TargetOptions {
|
||||||
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
|
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
|
||||||
linker: Some("rust-lld".to_owned()),
|
linker: Some("rust-lld".into()),
|
||||||
features: "+strict-align,+neon,+fp-armv8".to_string(),
|
features: "+strict-align,+neon,+fp-armv8".into(),
|
||||||
executables: true,
|
executables: true,
|
||||||
relocation_model: RelocModel::Static,
|
relocation_model: RelocModel::Static,
|
||||||
disable_redzone: true,
|
disable_redzone: true,
|
||||||
|
@ -21,10 +21,10 @@ pub fn target() -> Target {
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "aarch64-unknown-none".to_string(),
|
llvm_target: "aarch64-unknown-none".into(),
|
||||||
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".into(),
|
||||||
arch: "aarch64".to_string(),
|
arch: "aarch64".into(),
|
||||||
options: opts,
|
options: opts,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,10 +10,10 @@ use super::{LinkerFlavor, LldFlavor, PanicStrategy, RelocModel, Target, TargetOp
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
let opts = TargetOptions {
|
let opts = TargetOptions {
|
||||||
abi: "softfloat".to_string(),
|
abi: "softfloat".into(),
|
||||||
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
|
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
|
||||||
linker: Some("rust-lld".to_owned()),
|
linker: Some("rust-lld".into()),
|
||||||
features: "+strict-align,-neon,-fp-armv8".to_string(),
|
features: "+strict-align,-neon,-fp-armv8".into(),
|
||||||
executables: true,
|
executables: true,
|
||||||
relocation_model: RelocModel::Static,
|
relocation_model: RelocModel::Static,
|
||||||
disable_redzone: true,
|
disable_redzone: true,
|
||||||
|
@ -22,10 +22,10 @@ pub fn target() -> Target {
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "aarch64-unknown-none".to_string(),
|
llvm_target: "aarch64-unknown-none".into(),
|
||||||
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".into(),
|
||||||
arch: "aarch64".to_string(),
|
arch: "aarch64".into(),
|
||||||
options: opts,
|
options: opts,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,10 +2,10 @@ use crate::spec::{Target, TargetOptions};
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "aarch64-unknown-openbsd".to_string(),
|
llvm_target: "aarch64-unknown-openbsd".into(),
|
||||||
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".into(),
|
||||||
arch: "aarch64".to_string(),
|
arch: "aarch64".into(),
|
||||||
options: TargetOptions { max_atomic_width: Some(128), ..super::openbsd_base::opts() },
|
options: TargetOptions { max_atomic_width: Some(128), ..super::openbsd_base::opts() },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,10 +5,10 @@ pub fn target() -> Target {
|
||||||
base.max_atomic_width = Some(128);
|
base.max_atomic_width = Some(128);
|
||||||
|
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "aarch64-unknown-redox".to_string(),
|
llvm_target: "aarch64-unknown-redox".into(),
|
||||||
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".into(),
|
||||||
arch: "aarch64".to_string(),
|
arch: "aarch64".into(),
|
||||||
options: base,
|
options: base,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ pub fn target() -> Target {
|
||||||
|
|
||||||
base.max_atomic_width = Some(64);
|
base.max_atomic_width = Some(64);
|
||||||
|
|
||||||
let pre_link_args_msvc = vec!["/machine:arm64".to_string()];
|
let pre_link_args_msvc = vec!["/machine:arm64".into()];
|
||||||
|
|
||||||
base.pre_link_args.get_mut(&LinkerFlavor::Msvc).unwrap().extend(pre_link_args_msvc.clone());
|
base.pre_link_args.get_mut(&LinkerFlavor::Msvc).unwrap().extend(pre_link_args_msvc.clone());
|
||||||
base.pre_link_args
|
base.pre_link_args
|
||||||
|
@ -18,10 +18,10 @@ pub fn target() -> Target {
|
||||||
.extend(pre_link_args_msvc);
|
.extend(pre_link_args_msvc);
|
||||||
|
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "aarch64-unknown-windows".to_string(),
|
llvm_target: "aarch64-unknown-windows".into(),
|
||||||
pointer_width: 64,
|
pointer_width: 64,
|
||||||
data_layout: "e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128".to_string(),
|
data_layout: "e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128".into(),
|
||||||
arch: "aarch64".to_string(),
|
arch: "aarch64".into(),
|
||||||
options: base,
|
options: base,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,10 +5,10 @@ pub fn target() -> Target {
|
||||||
base.max_atomic_width = Some(64);
|
base.max_atomic_width = Some(64);
|
||||||
|
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "aarch64-pc-windows-msvc".to_string(),
|
llvm_target: "aarch64-pc-windows-msvc".into(),
|
||||||
pointer_width: 64,
|
pointer_width: 64,
|
||||||
data_layout: "e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128".to_string(),
|
data_layout: "e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128".into(),
|
||||||
arch: "aarch64".to_string(),
|
arch: "aarch64".into(),
|
||||||
options: base,
|
options: base,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,10 +2,10 @@ use crate::spec::{Target, TargetOptions};
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "aarch64-unknown-linux-gnu".to_string(),
|
llvm_target: "aarch64-unknown-linux-gnu".into(),
|
||||||
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".into(),
|
||||||
arch: "aarch64".to_string(),
|
arch: "aarch64".into(),
|
||||||
options: TargetOptions { max_atomic_width: Some(128), ..super::vxworks_base::opts() },
|
options: TargetOptions { max_atomic_width: Some(128), ..super::vxworks_base::opts() },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,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.os = "android".to_string();
|
base.os = "android".into();
|
||||||
base.dwarf_version = Some(2);
|
base.dwarf_version = Some(2);
|
||||||
base.position_independent_executables = true;
|
base.position_independent_executables = true;
|
||||||
base.has_thread_local = false;
|
base.has_thread_local = false;
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
use std::env;
|
use std::{borrow::Cow, env};
|
||||||
|
|
||||||
use crate::spec::{FramePointer, LldFlavor, SplitDebuginfo, TargetOptions};
|
use crate::spec::{cvs, FramePointer, LldFlavor, SplitDebuginfo, TargetOptions};
|
||||||
|
|
||||||
pub fn opts(os: &str) -> TargetOptions {
|
pub fn opts(os: &'static str) -> TargetOptions {
|
||||||
// ELF TLS is only available in macOS 10.7+. If you try to compile for 10.6
|
// ELF TLS is only available in macOS 10.7+. If you try to compile for 10.6
|
||||||
// either the linker will complain if it is used or the binary will end up
|
// either the linker will complain if it is used or the binary will end up
|
||||||
// segfaulting at runtime when run on 10.6. Rust by default supports macOS
|
// segfaulting at runtime when run on 10.6. Rust by default supports macOS
|
||||||
|
@ -19,20 +19,20 @@ pub fn opts(os: &str) -> TargetOptions {
|
||||||
let has_thread_local = macos_deployment_target("x86_64") >= (10, 7);
|
let has_thread_local = macos_deployment_target("x86_64") >= (10, 7);
|
||||||
|
|
||||||
TargetOptions {
|
TargetOptions {
|
||||||
os: os.to_string(),
|
os: os.into(),
|
||||||
vendor: "apple".to_string(),
|
vendor: "apple".into(),
|
||||||
// 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,
|
||||||
linker_is_gnu: false,
|
linker_is_gnu: false,
|
||||||
executables: true,
|
executables: true,
|
||||||
families: vec!["unix".to_string()],
|
families: cvs!["unix"],
|
||||||
is_like_osx: true,
|
is_like_osx: true,
|
||||||
dwarf_version: Some(2),
|
dwarf_version: Some(2),
|
||||||
frame_pointer: FramePointer::Always,
|
frame_pointer: FramePointer::Always,
|
||||||
has_rpath: true,
|
has_rpath: true,
|
||||||
dll_suffix: ".dylib".to_string(),
|
dll_suffix: ".dylib".into(),
|
||||||
archive_format: "darwin".to_string(),
|
archive_format: "darwin".into(),
|
||||||
has_thread_local,
|
has_thread_local,
|
||||||
abi_return_struct_as_int: true,
|
abi_return_struct_as_int: true,
|
||||||
emit_debug_gdb_scripts: false,
|
emit_debug_gdb_scripts: false,
|
||||||
|
@ -51,7 +51,7 @@ pub fn opts(os: &str) -> TargetOptions {
|
||||||
// this environment variable too in recent versions.
|
// this environment variable too in recent versions.
|
||||||
//
|
//
|
||||||
// For some more info see the commentary on #47086
|
// For some more info see the commentary on #47086
|
||||||
link_env: vec![("ZERO_AR_DATE".to_string(), "1".to_string())],
|
link_env: Cow::Borrowed(&[(Cow::Borrowed("ZERO_AR_DATE"), Cow::Borrowed("1"))]),
|
||||||
|
|
||||||
..Default::default()
|
..Default::default()
|
||||||
}
|
}
|
||||||
|
@ -79,19 +79,19 @@ pub fn macos_llvm_target(arch: &str) -> String {
|
||||||
format!("{}-apple-macosx{}.{}.0", arch, major, minor)
|
format!("{}-apple-macosx{}.{}.0", arch, major, minor)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn macos_link_env_remove() -> Vec<String> {
|
pub fn macos_link_env_remove() -> Vec<Cow<'static, str>> {
|
||||||
let mut env_remove = Vec::with_capacity(2);
|
let mut env_remove = Vec::with_capacity(2);
|
||||||
// Remove the `SDKROOT` environment variable if it's clearly set for the wrong platform, which
|
// Remove the `SDKROOT` environment variable if it's clearly set for the wrong platform, which
|
||||||
// may occur when we're linking a custom build script while targeting iOS for example.
|
// may occur when we're linking a custom build script while targeting iOS for example.
|
||||||
if let Ok(sdkroot) = env::var("SDKROOT") {
|
if let Ok(sdkroot) = env::var("SDKROOT") {
|
||||||
if sdkroot.contains("iPhoneOS.platform") || sdkroot.contains("iPhoneSimulator.platform") {
|
if sdkroot.contains("iPhoneOS.platform") || sdkroot.contains("iPhoneSimulator.platform") {
|
||||||
env_remove.push("SDKROOT".to_string())
|
env_remove.push("SDKROOT".into())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Additionally, `IPHONEOS_DEPLOYMENT_TARGET` must not be set when using the Xcode linker at
|
// Additionally, `IPHONEOS_DEPLOYMENT_TARGET` must not be set when using the Xcode linker at
|
||||||
// "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld",
|
// "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld",
|
||||||
// although this is apparently ignored when using the linker at "/usr/bin/ld".
|
// although this is apparently ignored when using the linker at "/usr/bin/ld".
|
||||||
env_remove.push("IPHONEOS_DEPLOYMENT_TARGET".to_string());
|
env_remove.push("IPHONEOS_DEPLOYMENT_TARGET".into());
|
||||||
env_remove
|
env_remove
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
use crate::spec::TargetOptions;
|
use crate::{spec::cvs, spec::TargetOptions};
|
||||||
|
use std::borrow::Cow;
|
||||||
|
|
||||||
use Arch::*;
|
use Arch::*;
|
||||||
#[allow(non_camel_case_types)]
|
#[allow(non_camel_case_types)]
|
||||||
|
@ -14,16 +15,15 @@ pub enum Arch {
|
||||||
Arm64_sim,
|
Arm64_sim,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn target_abi(arch: Arch) -> String {
|
fn target_abi(arch: Arch) -> &'static str {
|
||||||
match arch {
|
match arch {
|
||||||
Armv7 | Armv7s | Arm64 | I386 | X86_64 => "",
|
Armv7 | Armv7s | Arm64 | I386 | X86_64 => "",
|
||||||
X86_64_macabi | Arm64_macabi => "macabi",
|
X86_64_macabi | Arm64_macabi => "macabi",
|
||||||
Arm64_sim => "sim",
|
Arm64_sim => "sim",
|
||||||
}
|
}
|
||||||
.to_string()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn target_cpu(arch: Arch) -> String {
|
fn target_cpu(arch: Arch) -> &'static str {
|
||||||
match arch {
|
match arch {
|
||||||
Armv7 => "cortex-a8", // iOS7 is supported on iPhone 4 and higher
|
Armv7 => "cortex-a8", // iOS7 is supported on iPhone 4 and higher
|
||||||
Armv7s => "cortex-a9",
|
Armv7s => "cortex-a9",
|
||||||
|
@ -34,22 +34,21 @@ fn target_cpu(arch: Arch) -> String {
|
||||||
Arm64_macabi => "apple-a12",
|
Arm64_macabi => "apple-a12",
|
||||||
Arm64_sim => "apple-a12",
|
Arm64_sim => "apple-a12",
|
||||||
}
|
}
|
||||||
.to_string()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn link_env_remove(arch: Arch) -> Vec<String> {
|
fn link_env_remove(arch: Arch) -> Cow<'static, [Cow<'static, str>]> {
|
||||||
match arch {
|
match arch {
|
||||||
Armv7 | Armv7s | Arm64 | I386 | X86_64 | Arm64_sim => {
|
Armv7 | Armv7s | Arm64 | I386 | X86_64 | Arm64_sim => {
|
||||||
vec!["MACOSX_DEPLOYMENT_TARGET".to_string()]
|
cvs!["MACOSX_DEPLOYMENT_TARGET"]
|
||||||
}
|
}
|
||||||
X86_64_macabi | Arm64_macabi => vec!["IPHONEOS_DEPLOYMENT_TARGET".to_string()],
|
X86_64_macabi | Arm64_macabi => cvs!["IPHONEOS_DEPLOYMENT_TARGET"],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn opts(os: &str, arch: Arch) -> TargetOptions {
|
pub fn opts(os: &'static str, arch: Arch) -> TargetOptions {
|
||||||
TargetOptions {
|
TargetOptions {
|
||||||
abi: target_abi(arch),
|
abi: target_abi(arch).into(),
|
||||||
cpu: target_cpu(arch),
|
cpu: target_cpu(arch).into(),
|
||||||
dynamic_linking: false,
|
dynamic_linking: false,
|
||||||
executables: true,
|
executables: true,
|
||||||
link_env_remove: link_env_remove(arch),
|
link_env_remove: link_env_remove(arch),
|
||||||
|
|
|
@ -2,14 +2,14 @@ use crate::spec::{SanitizerSet, Target, TargetOptions};
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "arm-linux-androideabi".to_string(),
|
llvm_target: "arm-linux-androideabi".into(),
|
||||||
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".into(),
|
||||||
arch: "arm".to_string(),
|
arch: "arm".into(),
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
abi: "eabi".to_string(),
|
abi: "eabi".into(),
|
||||||
// https://developer.android.com/ndk/guides/abis.html#armeabi
|
// https://developer.android.com/ndk/guides/abis.html#armeabi
|
||||||
features: "+strict-align,+v5te".to_string(),
|
features: "+strict-align,+v5te".into(),
|
||||||
supported_sanitizers: SanitizerSet::ADDRESS,
|
supported_sanitizers: SanitizerSet::ADDRESS,
|
||||||
max_atomic_width: Some(32),
|
max_atomic_width: Some(32),
|
||||||
..super::android_base::opts()
|
..super::android_base::opts()
|
||||||
|
|
|
@ -2,15 +2,15 @@ use crate::spec::{Target, TargetOptions};
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "arm-unknown-linux-gnueabi".to_string(),
|
llvm_target: "arm-unknown-linux-gnueabi".into(),
|
||||||
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".into(),
|
||||||
arch: "arm".to_string(),
|
arch: "arm".into(),
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
abi: "eabi".to_string(),
|
abi: "eabi".into(),
|
||||||
features: "+strict-align,+v6".to_string(),
|
features: "+strict-align,+v6".into(),
|
||||||
max_atomic_width: Some(64),
|
max_atomic_width: Some(64),
|
||||||
mcount: "\u{1}__gnu_mcount_nc".to_string(),
|
mcount: "\u{1}__gnu_mcount_nc".into(),
|
||||||
..super::linux_gnu_base::opts()
|
..super::linux_gnu_base::opts()
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,15 +2,15 @@ use crate::spec::{Target, TargetOptions};
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "arm-unknown-linux-gnueabihf".to_string(),
|
llvm_target: "arm-unknown-linux-gnueabihf".into(),
|
||||||
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".into(),
|
||||||
arch: "arm".to_string(),
|
arch: "arm".into(),
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
abi: "eabihf".to_string(),
|
abi: "eabihf".into(),
|
||||||
features: "+strict-align,+v6,+vfp2,-d32".to_string(),
|
features: "+strict-align,+v6,+vfp2,-d32".into(),
|
||||||
max_atomic_width: Some(64),
|
max_atomic_width: Some(64),
|
||||||
mcount: "\u{1}__gnu_mcount_nc".to_string(),
|
mcount: "\u{1}__gnu_mcount_nc".into(),
|
||||||
..super::linux_gnu_base::opts()
|
..super::linux_gnu_base::opts()
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,17 +5,17 @@ pub fn target() -> Target {
|
||||||
// It's important we use "gnueabi" and not "musleabi" here. LLVM uses it
|
// It's important we use "gnueabi" and not "musleabi" here. LLVM uses it
|
||||||
// to determine the calling convention and float ABI, and it doesn't
|
// to determine the calling convention and float ABI, and it doesn't
|
||||||
// support the "musleabi" value.
|
// support the "musleabi" value.
|
||||||
llvm_target: "arm-unknown-linux-gnueabi".to_string(),
|
llvm_target: "arm-unknown-linux-gnueabi".into(),
|
||||||
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".into(),
|
||||||
arch: "arm".to_string(),
|
arch: "arm".into(),
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
abi: "eabi".to_string(),
|
abi: "eabi".into(),
|
||||||
// Most of these settings are copied from the arm_unknown_linux_gnueabi
|
// Most of these settings are copied from the arm_unknown_linux_gnueabi
|
||||||
// target.
|
// target.
|
||||||
features: "+strict-align,+v6".to_string(),
|
features: "+strict-align,+v6".into(),
|
||||||
max_atomic_width: Some(64),
|
max_atomic_width: Some(64),
|
||||||
mcount: "\u{1}mcount".to_string(),
|
mcount: "\u{1}mcount".into(),
|
||||||
..super::linux_musl_base::opts()
|
..super::linux_musl_base::opts()
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,17 +5,17 @@ pub fn target() -> Target {
|
||||||
// It's important we use "gnueabihf" and not "musleabihf" here. LLVM
|
// It's important we use "gnueabihf" and not "musleabihf" here. LLVM
|
||||||
// uses it to determine the calling convention and float ABI, and it
|
// uses it to determine the calling convention and float ABI, and it
|
||||||
// doesn't support the "musleabihf" value.
|
// doesn't support the "musleabihf" value.
|
||||||
llvm_target: "arm-unknown-linux-gnueabihf".to_string(),
|
llvm_target: "arm-unknown-linux-gnueabihf".into(),
|
||||||
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".into(),
|
||||||
arch: "arm".to_string(),
|
arch: "arm".into(),
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
abi: "eabihf".to_string(),
|
abi: "eabihf".into(),
|
||||||
// Most of these settings are copied from the arm_unknown_linux_gnueabihf
|
// Most of these settings are copied from the arm_unknown_linux_gnueabihf
|
||||||
// target.
|
// target.
|
||||||
features: "+strict-align,+v6,+vfp2,-d32".to_string(),
|
features: "+strict-align,+v6,+vfp2,-d32".into(),
|
||||||
max_atomic_width: Some(64),
|
max_atomic_width: Some(64),
|
||||||
mcount: "\u{1}mcount".to_string(),
|
mcount: "\u{1}mcount".into(),
|
||||||
..super::linux_musl_base::opts()
|
..super::linux_musl_base::opts()
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,16 +6,16 @@ use crate::spec::{Target, TargetOptions};
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "armebv7r-unknown-none-eabi".to_string(),
|
llvm_target: "armebv7r-unknown-none-eabi".into(),
|
||||||
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".into(),
|
||||||
arch: "arm".to_string(),
|
arch: "arm".into(),
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
abi: "eabi".to_string(),
|
abi: "eabi".into(),
|
||||||
endian: Endian::Big,
|
endian: Endian::Big,
|
||||||
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".into()),
|
||||||
relocation_model: RelocModel::Static,
|
relocation_model: RelocModel::Static,
|
||||||
panic_strategy: PanicStrategy::Abort,
|
panic_strategy: PanicStrategy::Abort,
|
||||||
max_atomic_width: Some(32),
|
max_atomic_width: Some(32),
|
||||||
|
|
|
@ -6,19 +6,19 @@ use crate::spec::{Target, TargetOptions};
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "armebv7r-unknown-none-eabihf".to_string(),
|
llvm_target: "armebv7r-unknown-none-eabihf".into(),
|
||||||
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".into(),
|
||||||
arch: "arm".to_string(),
|
arch: "arm".into(),
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
abi: "eabihf".to_string(),
|
abi: "eabihf".into(),
|
||||||
endian: Endian::Big,
|
endian: Endian::Big,
|
||||||
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".into()),
|
||||||
relocation_model: RelocModel::Static,
|
relocation_model: RelocModel::Static,
|
||||||
panic_strategy: PanicStrategy::Abort,
|
panic_strategy: PanicStrategy::Abort,
|
||||||
features: "+vfp3,-d32,-fp16".to_string(),
|
features: "+vfp3,-d32,-fp16".into(),
|
||||||
max_atomic_width: Some(32),
|
max_atomic_width: Some(32),
|
||||||
emit_debug_gdb_scripts: false,
|
emit_debug_gdb_scripts: false,
|
||||||
// GCC and Clang default to 8 for arm-none here
|
// GCC and Clang default to 8 for arm-none here
|
||||||
|
|
|
@ -2,16 +2,16 @@ use crate::spec::{Target, TargetOptions};
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "armv4t-unknown-linux-gnueabi".to_string(),
|
llvm_target: "armv4t-unknown-linux-gnueabi".into(),
|
||||||
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".into(),
|
||||||
arch: "arm".to_string(),
|
arch: "arm".into(),
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
abi: "eabi".to_string(),
|
abi: "eabi".into(),
|
||||||
features: "+soft-float,+strict-align".to_string(),
|
features: "+soft-float,+strict-align".into(),
|
||||||
// Atomic operations provided by compiler-builtins
|
// Atomic operations provided by compiler-builtins
|
||||||
max_atomic_width: Some(32),
|
max_atomic_width: Some(32),
|
||||||
mcount: "\u{1}__gnu_mcount_nc".to_string(),
|
mcount: "\u{1}__gnu_mcount_nc".into(),
|
||||||
has_thumb_interworking: true,
|
has_thumb_interworking: true,
|
||||||
..super::linux_gnu_base::opts()
|
..super::linux_gnu_base::opts()
|
||||||
},
|
},
|
||||||
|
|
|
@ -2,16 +2,16 @@ use crate::spec::{Target, TargetOptions};
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "armv5te-unknown-linux-gnueabi".to_string(),
|
llvm_target: "armv5te-unknown-linux-gnueabi".into(),
|
||||||
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".into(),
|
||||||
arch: "arm".to_string(),
|
arch: "arm".into(),
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
abi: "eabi".to_string(),
|
abi: "eabi".into(),
|
||||||
features: "+soft-float,+strict-align".to_string(),
|
features: "+soft-float,+strict-align".into(),
|
||||||
// Atomic operations provided by compiler-builtins
|
// Atomic operations provided by compiler-builtins
|
||||||
max_atomic_width: Some(32),
|
max_atomic_width: Some(32),
|
||||||
mcount: "\u{1}__gnu_mcount_nc".to_string(),
|
mcount: "\u{1}__gnu_mcount_nc".into(),
|
||||||
has_thumb_interworking: true,
|
has_thumb_interworking: true,
|
||||||
..super::linux_gnu_base::opts()
|
..super::linux_gnu_base::opts()
|
||||||
},
|
},
|
||||||
|
|
|
@ -6,16 +6,16 @@ pub fn target() -> Target {
|
||||||
// It's important we use "gnueabihf" and not "musleabihf" here. LLVM
|
// It's important we use "gnueabihf" and not "musleabihf" here. LLVM
|
||||||
// uses it to determine the calling convention and float ABI, and LLVM
|
// uses it to determine the calling convention and float ABI, and LLVM
|
||||||
// doesn't support the "musleabihf" value.
|
// doesn't support the "musleabihf" value.
|
||||||
llvm_target: "armv5te-unknown-linux-gnueabi".to_string(),
|
llvm_target: "armv5te-unknown-linux-gnueabi".into(),
|
||||||
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".into(),
|
||||||
arch: "arm".to_string(),
|
arch: "arm".into(),
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
abi: "eabi".to_string(),
|
abi: "eabi".into(),
|
||||||
features: "+soft-float,+strict-align".to_string(),
|
features: "+soft-float,+strict-align".into(),
|
||||||
// Atomic operations provided by compiler-builtins
|
// Atomic operations provided by compiler-builtins
|
||||||
max_atomic_width: Some(32),
|
max_atomic_width: Some(32),
|
||||||
mcount: "\u{1}mcount".to_string(),
|
mcount: "\u{1}mcount".into(),
|
||||||
has_thumb_interworking: true,
|
has_thumb_interworking: true,
|
||||||
..super::linux_musl_base::opts()
|
..super::linux_musl_base::opts()
|
||||||
},
|
},
|
||||||
|
|
|
@ -2,16 +2,16 @@ use crate::spec::{Target, TargetOptions};
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "armv5te-unknown-linux-uclibcgnueabi".to_string(),
|
llvm_target: "armv5te-unknown-linux-uclibcgnueabi".into(),
|
||||||
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".into(),
|
||||||
arch: "arm".to_string(),
|
arch: "arm".into(),
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
abi: "eabi".to_string(),
|
abi: "eabi".into(),
|
||||||
features: "+soft-float,+strict-align".to_string(),
|
features: "+soft-float,+strict-align".into(),
|
||||||
// Atomic operations provided by compiler-builtins
|
// Atomic operations provided by compiler-builtins
|
||||||
max_atomic_width: Some(32),
|
max_atomic_width: Some(32),
|
||||||
mcount: "\u{1}__gnu_mcount_nc".to_string(),
|
mcount: "\u{1}__gnu_mcount_nc".into(),
|
||||||
has_thumb_interworking: true,
|
has_thumb_interworking: true,
|
||||||
..super::linux_uclibc_base::opts()
|
..super::linux_uclibc_base::opts()
|
||||||
},
|
},
|
||||||
|
|
|
@ -2,17 +2,17 @@ use crate::spec::{Target, TargetOptions};
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "armv6-unknown-freebsd-gnueabihf".to_string(),
|
llvm_target: "armv6-unknown-freebsd-gnueabihf".into(),
|
||||||
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".into(),
|
||||||
arch: "arm".to_string(),
|
arch: "arm".into(),
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
abi: "eabihf".to_string(),
|
abi: "eabihf".into(),
|
||||||
// FIXME: change env to "gnu" when cfg_target_abi becomes stable
|
// FIXME: change env to "gnu" when cfg_target_abi becomes stable
|
||||||
env: "gnueabihf".to_string(),
|
env: "gnueabihf".into(),
|
||||||
features: "+v6,+vfp2,-d32".to_string(),
|
features: "+v6,+vfp2,-d32".into(),
|
||||||
max_atomic_width: Some(64),
|
max_atomic_width: Some(64),
|
||||||
mcount: "\u{1}__gnu_mcount_nc".to_string(),
|
mcount: "\u{1}__gnu_mcount_nc".into(),
|
||||||
..super::freebsd_base::opts()
|
..super::freebsd_base::opts()
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,17 +2,17 @@ use crate::spec::{Target, TargetOptions};
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "armv6-unknown-netbsdelf-eabihf".to_string(),
|
llvm_target: "armv6-unknown-netbsdelf-eabihf".into(),
|
||||||
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".into(),
|
||||||
arch: "arm".to_string(),
|
arch: "arm".into(),
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
abi: "eabihf".to_string(),
|
abi: "eabihf".into(),
|
||||||
// FIXME: remove env when cfg_target_abi becomes stable
|
// FIXME: remove env when cfg_target_abi becomes stable
|
||||||
env: "eabihf".to_string(),
|
env: "eabihf".into(),
|
||||||
features: "+v6,+vfp2,-d32".to_string(),
|
features: "+v6,+vfp2,-d32".into(),
|
||||||
max_atomic_width: Some(64),
|
max_atomic_width: Some(64),
|
||||||
mcount: "__mcount".to_string(),
|
mcount: "__mcount".into(),
|
||||||
..super::netbsd_base::opts()
|
..super::netbsd_base::opts()
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
use crate::spec::{LinkArgs, LinkerFlavor, RelocModel, Target, TargetOptions};
|
use crate::spec::{cvs, LinkArgs, LinkerFlavor, RelocModel, Target, TargetOptions};
|
||||||
|
|
||||||
/// A base target for Nintendo 3DS devices using the devkitARM toolchain.
|
/// A base target for Nintendo 3DS devices using the devkitARM toolchain.
|
||||||
///
|
///
|
||||||
|
@ -9,33 +9,33 @@ pub fn target() -> Target {
|
||||||
pre_link_args.insert(
|
pre_link_args.insert(
|
||||||
LinkerFlavor::Gcc,
|
LinkerFlavor::Gcc,
|
||||||
vec![
|
vec![
|
||||||
"-specs=3dsx.specs".to_string(),
|
"-specs=3dsx.specs".into(),
|
||||||
"-mtune=mpcore".to_string(),
|
"-mtune=mpcore".into(),
|
||||||
"-mfloat-abi=hard".to_string(),
|
"-mfloat-abi=hard".into(),
|
||||||
"-mtp=soft".to_string(),
|
"-mtp=soft".into(),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "armv6k-none-eabihf".to_string(),
|
llvm_target: "armv6k-none-eabihf".into(),
|
||||||
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".into(),
|
||||||
arch: "arm".to_string(),
|
arch: "arm".into(),
|
||||||
|
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
os: "horizon".to_string(),
|
os: "horizon".into(),
|
||||||
env: "newlib".to_string(),
|
env: "newlib".into(),
|
||||||
vendor: "nintendo".to_string(),
|
vendor: "nintendo".into(),
|
||||||
abi: "eabihf".to_string(),
|
abi: "eabihf".into(),
|
||||||
linker_flavor: LinkerFlavor::Gcc,
|
linker_flavor: LinkerFlavor::Gcc,
|
||||||
cpu: "mpcore".to_string(),
|
cpu: "mpcore".into(),
|
||||||
executables: true,
|
executables: true,
|
||||||
families: vec!["unix".to_string()],
|
families: cvs!["unix"],
|
||||||
linker: Some("arm-none-eabi-gcc".to_string()),
|
linker: Some("arm-none-eabi-gcc".into()),
|
||||||
relocation_model: RelocModel::Static,
|
relocation_model: RelocModel::Static,
|
||||||
features: "+vfp2".to_string(),
|
features: "+vfp2".into(),
|
||||||
pre_link_args,
|
pre_link_args,
|
||||||
exe_suffix: ".elf".to_string(),
|
exe_suffix: ".elf".into(),
|
||||||
no_default_libraries: false,
|
no_default_libraries: false,
|
||||||
has_thread_local: true,
|
has_thread_local: true,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
|
|
|
@ -2,13 +2,15 @@ use super::apple_sdk_base::{opts, Arch};
|
||||||
use crate::spec::{Target, TargetOptions};
|
use crate::spec::{Target, TargetOptions};
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
|
let llvm_target = super::apple_base::ios_llvm_target("armv7");
|
||||||
|
|
||||||
Target {
|
Target {
|
||||||
llvm_target: super::apple_base::ios_llvm_target("armv7"),
|
llvm_target: llvm_target.into(),
|
||||||
pointer_width: 32,
|
pointer_width: 32,
|
||||||
data_layout: "e-m:o-p:32:32-Fi8-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32".to_string(),
|
data_layout: "e-m:o-p:32:32-Fi8-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32".into(),
|
||||||
arch: "arm".to_string(),
|
arch: "arm".into(),
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
features: "+v7,+vfp3,+neon".to_string(),
|
features: "+v7,+vfp3,+neon".into(),
|
||||||
max_atomic_width: Some(64),
|
max_atomic_width: Some(64),
|
||||||
..opts("ios", Arch::Armv7)
|
..opts("ios", Arch::Armv7)
|
||||||
},
|
},
|
||||||
|
|
|
@ -10,15 +10,15 @@ use crate::spec::{LinkerFlavor, SanitizerSet, Target, TargetOptions};
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
let mut base = super::android_base::opts();
|
let mut base = super::android_base::opts();
|
||||||
base.pre_link_args.entry(LinkerFlavor::Gcc).or_default().push("-march=armv7-a".to_string());
|
base.pre_link_args.entry(LinkerFlavor::Gcc).or_default().push("-march=armv7-a".into());
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "armv7-none-linux-android".to_string(),
|
llvm_target: "armv7-none-linux-android".into(),
|
||||||
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".into(),
|
||||||
arch: "arm".to_string(),
|
arch: "arm".into(),
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
abi: "eabi".to_string(),
|
abi: "eabi".into(),
|
||||||
features: "+v7,+thumb-mode,+thumb2,+vfp3,-d32,-neon".to_string(),
|
features: "+v7,+thumb-mode,+thumb2,+vfp3,-d32,-neon".into(),
|
||||||
supported_sanitizers: SanitizerSet::ADDRESS,
|
supported_sanitizers: SanitizerSet::ADDRESS,
|
||||||
max_atomic_width: Some(64),
|
max_atomic_width: Some(64),
|
||||||
..base
|
..base
|
||||||
|
|
|
@ -2,17 +2,17 @@ use crate::spec::{Target, TargetOptions};
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "armv7-unknown-freebsd-gnueabihf".to_string(),
|
llvm_target: "armv7-unknown-freebsd-gnueabihf".into(),
|
||||||
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".into(),
|
||||||
arch: "arm".to_string(),
|
arch: "arm".into(),
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
abi: "eabihf".to_string(),
|
abi: "eabihf".into(),
|
||||||
// FIXME: change env to "gnu" when cfg_target_abi becomes stable
|
// FIXME: change env to "gnu" when cfg_target_abi becomes stable
|
||||||
env: "gnueabihf".to_string(),
|
env: "gnueabihf".into(),
|
||||||
features: "+v7,+vfp3,-d32,+thumb2,-neon".to_string(),
|
features: "+v7,+vfp3,-d32,+thumb2,-neon".into(),
|
||||||
max_atomic_width: Some(64),
|
max_atomic_width: Some(64),
|
||||||
mcount: "\u{1}__gnu_mcount_nc".to_string(),
|
mcount: "\u{1}__gnu_mcount_nc".into(),
|
||||||
..super::freebsd_base::opts()
|
..super::freebsd_base::opts()
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,15 +5,15 @@ use crate::spec::{Target, TargetOptions};
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "armv7-unknown-linux-gnueabi".to_string(),
|
llvm_target: "armv7-unknown-linux-gnueabi".into(),
|
||||||
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".into(),
|
||||||
arch: "arm".to_string(),
|
arch: "arm".into(),
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
abi: "eabi".to_string(),
|
abi: "eabi".into(),
|
||||||
features: "+v7,+thumb2,+soft-float,-neon".to_string(),
|
features: "+v7,+thumb2,+soft-float,-neon".into(),
|
||||||
max_atomic_width: Some(64),
|
max_atomic_width: Some(64),
|
||||||
mcount: "\u{1}__gnu_mcount_nc".to_string(),
|
mcount: "\u{1}__gnu_mcount_nc".into(),
|
||||||
..super::linux_gnu_base::opts()
|
..super::linux_gnu_base::opts()
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,16 +5,16 @@ use crate::spec::{Target, TargetOptions};
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "armv7-unknown-linux-gnueabihf".to_string(),
|
llvm_target: "armv7-unknown-linux-gnueabihf".into(),
|
||||||
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".into(),
|
||||||
arch: "arm".to_string(),
|
arch: "arm".into(),
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
abi: "eabihf".to_string(),
|
abi: "eabihf".into(),
|
||||||
// Info about features at https://wiki.debian.org/ArmHardFloatPort
|
// Info about features at https://wiki.debian.org/ArmHardFloatPort
|
||||||
features: "+v7,+vfp3,-d32,+thumb2,-neon".to_string(),
|
features: "+v7,+vfp3,-d32,+thumb2,-neon".into(),
|
||||||
max_atomic_width: Some(64),
|
max_atomic_width: Some(64),
|
||||||
mcount: "\u{1}__gnu_mcount_nc".to_string(),
|
mcount: "\u{1}__gnu_mcount_nc".into(),
|
||||||
..super::linux_gnu_base::opts()
|
..super::linux_gnu_base::opts()
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,16 +10,16 @@ pub fn target() -> Target {
|
||||||
// It's important we use "gnueabi" and not "musleabi" here. LLVM uses it
|
// It's important we use "gnueabi" and not "musleabi" here. LLVM uses it
|
||||||
// to determine the calling convention and float ABI, and it doesn't
|
// to determine the calling convention and float ABI, and it doesn't
|
||||||
// support the "musleabi" value.
|
// support the "musleabi" value.
|
||||||
llvm_target: "armv7-unknown-linux-gnueabi".to_string(),
|
llvm_target: "armv7-unknown-linux-gnueabi".into(),
|
||||||
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".into(),
|
||||||
arch: "arm".to_string(),
|
arch: "arm".into(),
|
||||||
|
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
abi: "eabi".to_string(),
|
abi: "eabi".into(),
|
||||||
features: "+v7,+thumb2,+soft-float,-neon".to_string(),
|
features: "+v7,+thumb2,+soft-float,-neon".into(),
|
||||||
max_atomic_width: Some(64),
|
max_atomic_width: Some(64),
|
||||||
mcount: "\u{1}mcount".to_string(),
|
mcount: "\u{1}mcount".into(),
|
||||||
..super::linux_musl_base::opts()
|
..super::linux_musl_base::opts()
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,18 +7,18 @@ pub fn target() -> Target {
|
||||||
// It's important we use "gnueabihf" and not "musleabihf" here. LLVM
|
// It's important we use "gnueabihf" and not "musleabihf" here. LLVM
|
||||||
// uses it to determine the calling convention and float ABI, and LLVM
|
// uses it to determine the calling convention and float ABI, and LLVM
|
||||||
// doesn't support the "musleabihf" value.
|
// doesn't support the "musleabihf" value.
|
||||||
llvm_target: "armv7-unknown-linux-gnueabihf".to_string(),
|
llvm_target: "armv7-unknown-linux-gnueabihf".into(),
|
||||||
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".into(),
|
||||||
arch: "arm".to_string(),
|
arch: "arm".into(),
|
||||||
|
|
||||||
// Most of these settings are copied from the armv7_unknown_linux_gnueabihf
|
// Most of these settings are copied from the armv7_unknown_linux_gnueabihf
|
||||||
// target.
|
// target.
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
abi: "eabihf".to_string(),
|
abi: "eabihf".into(),
|
||||||
features: "+v7,+vfp3,-d32,+thumb2,-neon".to_string(),
|
features: "+v7,+vfp3,-d32,+thumb2,-neon".into(),
|
||||||
max_atomic_width: Some(64),
|
max_atomic_width: Some(64),
|
||||||
mcount: "\u{1}mcount".to_string(),
|
mcount: "\u{1}mcount".into(),
|
||||||
..super::linux_musl_base::opts()
|
..super::linux_musl_base::opts()
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,17 +6,17 @@ use crate::spec::{Target, TargetOptions};
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
let base = super::linux_uclibc_base::opts();
|
let base = super::linux_uclibc_base::opts();
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "armv7-unknown-linux-gnueabi".to_string(),
|
llvm_target: "armv7-unknown-linux-gnueabi".into(),
|
||||||
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".into(),
|
||||||
arch: "arm".to_string(),
|
arch: "arm".into(),
|
||||||
|
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
features: "+v7,+thumb2,+soft-float,-neon".to_string(),
|
features: "+v7,+thumb2,+soft-float,-neon".into(),
|
||||||
cpu: "generic".to_string(),
|
cpu: "generic".into(),
|
||||||
max_atomic_width: Some(64),
|
max_atomic_width: Some(64),
|
||||||
mcount: "_mcount".to_string(),
|
mcount: "_mcount".into(),
|
||||||
abi: "eabi".to_string(),
|
abi: "eabi".into(),
|
||||||
..base
|
..base
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,18 +6,18 @@ use crate::spec::{Target, TargetOptions};
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
let base = super::linux_uclibc_base::opts();
|
let base = super::linux_uclibc_base::opts();
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "armv7-unknown-linux-gnueabihf".to_string(),
|
llvm_target: "armv7-unknown-linux-gnueabihf".into(),
|
||||||
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".into(),
|
||||||
arch: "arm".to_string(),
|
arch: "arm".into(),
|
||||||
|
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
// Info about features at https://wiki.debian.org/ArmHardFloatPort
|
// Info about features at https://wiki.debian.org/ArmHardFloatPort
|
||||||
features: "+v7,+vfp3,-d32,+thumb2,-neon".to_string(),
|
features: "+v7,+vfp3,-d32,+thumb2,-neon".into(),
|
||||||
cpu: "generic".to_string(),
|
cpu: "generic".into(),
|
||||||
max_atomic_width: Some(64),
|
max_atomic_width: Some(64),
|
||||||
mcount: "_mcount".to_string(),
|
mcount: "_mcount".into(),
|
||||||
abi: "eabihf".to_string(),
|
abi: "eabihf".into(),
|
||||||
..base
|
..base
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,17 +2,17 @@ use crate::spec::{Target, TargetOptions};
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "armv7-unknown-netbsdelf-eabihf".to_string(),
|
llvm_target: "armv7-unknown-netbsdelf-eabihf".into(),
|
||||||
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".into(),
|
||||||
arch: "arm".to_string(),
|
arch: "arm".into(),
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
abi: "eabihf".to_string(),
|
abi: "eabihf".into(),
|
||||||
// FIXME: remove env when cfg_target_abi becomes stable
|
// FIXME: remove env when cfg_target_abi becomes stable
|
||||||
env: "eabihf".to_string(),
|
env: "eabihf".into(),
|
||||||
features: "+v7,+vfp3,-d32,+thumb2,-neon".to_string(),
|
features: "+v7,+vfp3,-d32,+thumb2,-neon".into(),
|
||||||
max_atomic_width: Some(64),
|
max_atomic_width: Some(64),
|
||||||
mcount: "__mcount".to_string(),
|
mcount: "__mcount".into(),
|
||||||
..super::netbsd_base::opts()
|
..super::netbsd_base::opts()
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,14 +2,14 @@ use crate::spec::{Target, TargetOptions};
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "armv7-unknown-linux-gnueabihf".to_string(),
|
llvm_target: "armv7-unknown-linux-gnueabihf".into(),
|
||||||
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".into(),
|
||||||
arch: "arm".to_string(),
|
arch: "arm".into(),
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
abi: "eabihf".to_string(),
|
abi: "eabihf".into(),
|
||||||
// Info about features at https://wiki.debian.org/ArmHardFloatPort
|
// Info about features at https://wiki.debian.org/ArmHardFloatPort
|
||||||
features: "+v7,+vfp3,-d32,+thumb2,-neon".to_string(),
|
features: "+v7,+vfp3,-d32,+thumb2,-neon".into(),
|
||||||
max_atomic_width: Some(64),
|
max_atomic_width: Some(64),
|
||||||
..super::vxworks_base::opts()
|
..super::vxworks_base::opts()
|
||||||
},
|
},
|
||||||
|
|
|
@ -3,13 +3,13 @@ use super::{RelocModel, Target, TargetOptions};
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
let base = super::solid_base::opts("asp3");
|
let base = super::solid_base::opts("asp3");
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "armv7a-none-eabi".to_string(),
|
llvm_target: "armv7a-none-eabi".into(),
|
||||||
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".into(),
|
||||||
arch: "arm".to_string(),
|
arch: "arm".into(),
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
linker: Some("arm-kmc-eabi-gcc".to_owned()),
|
linker: Some("arm-kmc-eabi-gcc".into()),
|
||||||
features: "+v7,+soft-float,+thumb2,-neon".to_string(),
|
features: "+v7,+soft-float,+thumb2,-neon".into(),
|
||||||
relocation_model: RelocModel::Static,
|
relocation_model: RelocModel::Static,
|
||||||
disable_redzone: true,
|
disable_redzone: true,
|
||||||
max_atomic_width: Some(64),
|
max_atomic_width: Some(64),
|
||||||
|
|
|
@ -3,13 +3,13 @@ use super::{RelocModel, Target, TargetOptions};
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
let base = super::solid_base::opts("asp3");
|
let base = super::solid_base::opts("asp3");
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "armv7a-none-eabihf".to_string(),
|
llvm_target: "armv7a-none-eabihf".into(),
|
||||||
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".into(),
|
||||||
arch: "arm".to_string(),
|
arch: "arm".into(),
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
linker: Some("arm-kmc-eabi-gcc".to_owned()),
|
linker: Some("arm-kmc-eabi-gcc".into()),
|
||||||
features: "+v7,+vfp3,-d32,+thumb2,-neon".to_string(),
|
features: "+v7,+vfp3,-d32,+thumb2,-neon".into(),
|
||||||
relocation_model: RelocModel::Static,
|
relocation_model: RelocModel::Static,
|
||||||
disable_redzone: true,
|
disable_redzone: true,
|
||||||
max_atomic_width: Some(64),
|
max_atomic_width: Some(64),
|
||||||
|
|
|
@ -18,10 +18,10 @@ use super::{LinkerFlavor, LldFlavor, PanicStrategy, RelocModel, Target, TargetOp
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
let opts = TargetOptions {
|
let opts = TargetOptions {
|
||||||
abi: "eabi".to_string(),
|
abi: "eabi".into(),
|
||||||
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
|
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
|
||||||
linker: Some("rust-lld".to_owned()),
|
linker: Some("rust-lld".into()),
|
||||||
features: "+v7,+thumb2,+soft-float,-neon,+strict-align".to_string(),
|
features: "+v7,+thumb2,+soft-float,-neon,+strict-align".into(),
|
||||||
executables: true,
|
executables: true,
|
||||||
relocation_model: RelocModel::Static,
|
relocation_model: RelocModel::Static,
|
||||||
disable_redzone: true,
|
disable_redzone: true,
|
||||||
|
@ -32,10 +32,10 @@ pub fn target() -> Target {
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "armv7a-none-eabi".to_string(),
|
llvm_target: "armv7a-none-eabi".into(),
|
||||||
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".into(),
|
||||||
arch: "arm".to_string(),
|
arch: "arm".into(),
|
||||||
options: opts,
|
options: opts,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,10 +9,10 @@ use super::{LinkerFlavor, LldFlavor, PanicStrategy, RelocModel, Target, TargetOp
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
let opts = TargetOptions {
|
let opts = TargetOptions {
|
||||||
abi: "eabihf".to_string(),
|
abi: "eabihf".into(),
|
||||||
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
|
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
|
||||||
linker: Some("rust-lld".to_owned()),
|
linker: Some("rust-lld".into()),
|
||||||
features: "+v7,+vfp3,-d32,+thumb2,-neon,+strict-align".to_string(),
|
features: "+v7,+vfp3,-d32,+thumb2,-neon,+strict-align".into(),
|
||||||
executables: true,
|
executables: true,
|
||||||
relocation_model: RelocModel::Static,
|
relocation_model: RelocModel::Static,
|
||||||
disable_redzone: true,
|
disable_redzone: true,
|
||||||
|
@ -24,10 +24,10 @@ pub fn target() -> Target {
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "armv7a-none-eabihf".to_string(),
|
llvm_target: "armv7a-none-eabihf".into(),
|
||||||
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".into(),
|
||||||
arch: "arm".to_string(),
|
arch: "arm".into(),
|
||||||
options: opts,
|
options: opts,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,16 +5,16 @@ use crate::spec::{Target, TargetOptions};
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "armv7r-unknown-none-eabi".to_string(),
|
llvm_target: "armv7r-unknown-none-eabi".into(),
|
||||||
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".into(),
|
||||||
arch: "arm".to_string(),
|
arch: "arm".into(),
|
||||||
|
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
abi: "eabi".to_string(),
|
abi: "eabi".into(),
|
||||||
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".into()),
|
||||||
relocation_model: RelocModel::Static,
|
relocation_model: RelocModel::Static,
|
||||||
panic_strategy: PanicStrategy::Abort,
|
panic_strategy: PanicStrategy::Abort,
|
||||||
max_atomic_width: Some(32),
|
max_atomic_width: Some(32),
|
||||||
|
|
|
@ -5,19 +5,19 @@ use crate::spec::{Target, TargetOptions};
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "armv7r-unknown-none-eabihf".to_string(),
|
llvm_target: "armv7r-unknown-none-eabihf".into(),
|
||||||
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".into(),
|
||||||
arch: "arm".to_string(),
|
arch: "arm".into(),
|
||||||
|
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
abi: "eabihf".to_string(),
|
abi: "eabihf".into(),
|
||||||
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".into()),
|
||||||
relocation_model: RelocModel::Static,
|
relocation_model: RelocModel::Static,
|
||||||
panic_strategy: PanicStrategy::Abort,
|
panic_strategy: PanicStrategy::Abort,
|
||||||
features: "+vfp3,-d32,-fp16".to_string(),
|
features: "+vfp3,-d32,-fp16".into(),
|
||||||
max_atomic_width: Some(32),
|
max_atomic_width: Some(32),
|
||||||
emit_debug_gdb_scripts: false,
|
emit_debug_gdb_scripts: false,
|
||||||
// GCC and Clang default to 8 for arm-none here
|
// GCC and Clang default to 8 for arm-none here
|
||||||
|
|
|
@ -3,12 +3,12 @@ use crate::spec::{Target, TargetOptions};
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "armv7s-apple-ios".to_string(),
|
llvm_target: "armv7s-apple-ios".into(),
|
||||||
pointer_width: 32,
|
pointer_width: 32,
|
||||||
data_layout: "e-m:o-p:32:32-Fi8-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32".to_string(),
|
data_layout: "e-m:o-p:32:32-Fi8-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32".into(),
|
||||||
arch: "arm".to_string(),
|
arch: "arm".into(),
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
features: "+v7,+vfp4,+neon".to_string(),
|
features: "+v7,+vfp4,+neon".into(),
|
||||||
max_atomic_width: Some(64),
|
max_atomic_width: Some(64),
|
||||||
..opts("ios", Arch::Armv7s)
|
..opts("ios", Arch::Armv7s)
|
||||||
},
|
},
|
||||||
|
|
|
@ -6,6 +6,6 @@ pub fn target() -> Target {
|
||||||
.post_link_args
|
.post_link_args
|
||||||
.entry(LinkerFlavor::Em)
|
.entry(LinkerFlavor::Em)
|
||||||
.or_default()
|
.or_default()
|
||||||
.extend(vec!["-s".to_string(), "WASM=0".to_string()]);
|
.extend(vec!["-s".into(), "WASM=0".into()]);
|
||||||
target
|
target
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,24 +3,24 @@ use crate::spec::{LinkerFlavor, Target, TargetOptions};
|
||||||
/// A base target for AVR devices using the GNU toolchain.
|
/// A base target for AVR devices using the GNU toolchain.
|
||||||
///
|
///
|
||||||
/// Requires GNU avr-gcc and avr-binutils on the host system.
|
/// Requires GNU avr-gcc and avr-binutils on the host system.
|
||||||
pub fn target(target_cpu: String) -> Target {
|
pub fn target(target_cpu: &'static str) -> Target {
|
||||||
Target {
|
Target {
|
||||||
arch: "avr".to_string(),
|
arch: "avr".into(),
|
||||||
data_layout: "e-P1-p:16:8-i8:8-i16:8-i32:8-i64:8-f32:8-f64:8-n8-a:8".to_string(),
|
data_layout: "e-P1-p:16:8-i8:8-i16:8-i32:8-i64:8-f32:8-f64:8-n8-a:8".into(),
|
||||||
llvm_target: "avr-unknown-unknown".to_string(),
|
llvm_target: "avr-unknown-unknown".into(),
|
||||||
pointer_width: 16,
|
pointer_width: 16,
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
c_int_width: "16".to_string(),
|
c_int_width: "16".into(),
|
||||||
cpu: target_cpu.clone(),
|
cpu: target_cpu.into(),
|
||||||
exe_suffix: ".elf".to_string(),
|
exe_suffix: ".elf".into(),
|
||||||
|
|
||||||
linker: Some("avr-gcc".to_owned()),
|
linker: Some("avr-gcc".into()),
|
||||||
executables: true,
|
executables: true,
|
||||||
eh_frame_header: false,
|
eh_frame_header: false,
|
||||||
pre_link_args: [(LinkerFlavor::Gcc, vec![format!("-mmcu={}", target_cpu)])]
|
pre_link_args: [(LinkerFlavor::Gcc, vec![format!("-mmcu={}", target_cpu).into()])]
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.collect(),
|
.collect(),
|
||||||
late_link_args: [(LinkerFlavor::Gcc, vec!["-lgcc".to_owned()])].into_iter().collect(),
|
late_link_args: [(LinkerFlavor::Gcc, vec!["-lgcc".into()])].into_iter().collect(),
|
||||||
max_atomic_width: Some(0),
|
max_atomic_width: Some(0),
|
||||||
atomic_cas: false,
|
atomic_cas: false,
|
||||||
..TargetOptions::default()
|
..TargetOptions::default()
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
use crate::spec::Target;
|
use crate::spec::Target;
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
super::avr_gnu_base::target("atmega328".to_owned())
|
super::avr_gnu_base::target("atmega328")
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,10 +3,10 @@ use crate::{abi::Endian, spec::bpf_base};
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "bpfeb".to_string(),
|
llvm_target: "bpfeb".into(),
|
||||||
data_layout: "E-m:e-p:64:64-i64:64-i128:128-n32:64-S128".to_string(),
|
data_layout: "E-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
|
||||||
pointer_width: 64,
|
pointer_width: 64,
|
||||||
arch: "bpf".to_string(),
|
arch: "bpf".into(),
|
||||||
options: bpf_base::opts(Endian::Big),
|
options: bpf_base::opts(Endian::Big),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,10 +3,10 @@ use crate::{abi::Endian, spec::bpf_base};
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "bpfel".to_string(),
|
llvm_target: "bpfel".into(),
|
||||||
data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".to_string(),
|
data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
|
||||||
pointer_width: 64,
|
pointer_width: 64,
|
||||||
arch: "bpf".to_string(),
|
arch: "bpf".into(),
|
||||||
options: bpf_base::opts(Endian::Little),
|
options: bpf_base::opts(Endian::Little),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,16 +42,17 @@
|
||||||
|
|
||||||
use crate::spec::LinkOutputKind;
|
use crate::spec::LinkOutputKind;
|
||||||
use rustc_serialize::json::{Json, ToJson};
|
use rustc_serialize::json::{Json, ToJson};
|
||||||
|
use std::borrow::Cow;
|
||||||
use std::collections::BTreeMap;
|
use std::collections::BTreeMap;
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
||||||
pub type CrtObjects = BTreeMap<LinkOutputKind, Vec<String>>;
|
pub type CrtObjects = BTreeMap<LinkOutputKind, Vec<Cow<'static, str>>>;
|
||||||
|
|
||||||
pub(super) fn new(obj_table: &[(LinkOutputKind, &[&str])]) -> CrtObjects {
|
pub(super) fn new(obj_table: &[(LinkOutputKind, &[&'static str])]) -> CrtObjects {
|
||||||
obj_table.iter().map(|(z, k)| (*z, k.iter().map(|b| b.to_string()).collect())).collect()
|
obj_table.iter().map(|(z, k)| (*z, k.iter().map(|b| (*b).into()).collect())).collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(super) fn all(obj: &str) -> CrtObjects {
|
pub(super) fn all(obj: &'static str) -> CrtObjects {
|
||||||
new(&[
|
new(&[
|
||||||
(LinkOutputKind::DynamicNoPicExe, &[obj]),
|
(LinkOutputKind::DynamicNoPicExe, &[obj]),
|
||||||
(LinkOutputKind::DynamicPicExe, &[obj]),
|
(LinkOutputKind::DynamicPicExe, &[obj]),
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
use crate::spec::{RelroLevel, TargetOptions};
|
use crate::spec::{cvs, RelroLevel, TargetOptions};
|
||||||
|
|
||||||
pub fn opts() -> TargetOptions {
|
pub fn opts() -> TargetOptions {
|
||||||
TargetOptions {
|
TargetOptions {
|
||||||
os: "dragonfly".to_string(),
|
os: "dragonfly".into(),
|
||||||
dynamic_linking: true,
|
dynamic_linking: true,
|
||||||
executables: true,
|
executables: true,
|
||||||
families: vec!["unix".to_string()],
|
families: cvs!["unix"],
|
||||||
has_rpath: true,
|
has_rpath: true,
|
||||||
position_independent_executables: true,
|
position_independent_executables: true,
|
||||||
relro_level: RelroLevel::Full,
|
relro_level: RelroLevel::Full,
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
use crate::spec::{RelroLevel, TargetOptions};
|
use crate::spec::{cvs, RelroLevel, TargetOptions};
|
||||||
|
|
||||||
pub fn opts() -> TargetOptions {
|
pub fn opts() -> TargetOptions {
|
||||||
TargetOptions {
|
TargetOptions {
|
||||||
os: "freebsd".to_string(),
|
os: "freebsd".into(),
|
||||||
dynamic_linking: true,
|
dynamic_linking: true,
|
||||||
executables: true,
|
executables: true,
|
||||||
families: vec!["unix".to_string()],
|
families: cvs!["unix"],
|
||||||
has_rpath: true,
|
has_rpath: true,
|
||||||
position_independent_executables: true,
|
position_independent_executables: true,
|
||||||
relro_level: RelroLevel::Full,
|
relro_level: RelroLevel::Full,
|
||||||
|
|
|
@ -1,31 +1,33 @@
|
||||||
use crate::spec::{crt_objects, LinkArgs, LinkOutputKind, LinkerFlavor, LldFlavor, TargetOptions};
|
use crate::spec::{
|
||||||
|
crt_objects, cvs, LinkArgs, LinkOutputKind, LinkerFlavor, LldFlavor, TargetOptions,
|
||||||
|
};
|
||||||
|
|
||||||
pub fn opts() -> TargetOptions {
|
pub fn opts() -> TargetOptions {
|
||||||
let mut pre_link_args = LinkArgs::new();
|
let mut pre_link_args = LinkArgs::new();
|
||||||
pre_link_args.insert(
|
pre_link_args.insert(
|
||||||
LinkerFlavor::Lld(LldFlavor::Ld),
|
LinkerFlavor::Lld(LldFlavor::Ld),
|
||||||
vec![
|
vec![
|
||||||
"--build-id".to_string(),
|
"--build-id".into(),
|
||||||
"--hash-style=gnu".to_string(),
|
"--hash-style=gnu".into(),
|
||||||
"-z".to_string(),
|
"-z".into(),
|
||||||
"max-page-size=4096".to_string(),
|
"max-page-size=4096".into(),
|
||||||
"-z".to_string(),
|
"-z".into(),
|
||||||
"now".to_string(),
|
"now".into(),
|
||||||
"-z".to_string(),
|
"-z".into(),
|
||||||
"rodynamic".to_string(),
|
"rodynamic".into(),
|
||||||
"-z".to_string(),
|
"-z".into(),
|
||||||
"separate-loadable-segments".to_string(),
|
"separate-loadable-segments".into(),
|
||||||
"--pack-dyn-relocs=relr".to_string(),
|
"--pack-dyn-relocs=relr".into(),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
TargetOptions {
|
TargetOptions {
|
||||||
os: "fuchsia".to_string(),
|
os: "fuchsia".into(),
|
||||||
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
|
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
|
||||||
linker: Some("rust-lld".to_owned()),
|
linker: Some("rust-lld".into()),
|
||||||
dynamic_linking: true,
|
dynamic_linking: true,
|
||||||
executables: true,
|
executables: true,
|
||||||
families: vec!["unix".to_string()],
|
families: cvs!["unix"],
|
||||||
is_like_fuchsia: true,
|
is_like_fuchsia: true,
|
||||||
pre_link_args,
|
pre_link_args,
|
||||||
pre_link_objects: crt_objects::new(&[
|
pre_link_objects: crt_objects::new(&[
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
use crate::spec::{RelroLevel, TargetOptions};
|
use crate::spec::{cvs, RelroLevel, TargetOptions};
|
||||||
|
|
||||||
pub fn opts() -> TargetOptions {
|
pub fn opts() -> TargetOptions {
|
||||||
TargetOptions {
|
TargetOptions {
|
||||||
os: "haiku".to_string(),
|
os: "haiku".into(),
|
||||||
dynamic_linking: true,
|
dynamic_linking: true,
|
||||||
executables: true,
|
executables: true,
|
||||||
families: vec!["unix".to_string()],
|
families: cvs!["unix"],
|
||||||
relro_level: RelroLevel::Full,
|
relro_level: RelroLevel::Full,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,13 +4,13 @@ pub fn opts() -> TargetOptions {
|
||||||
let mut pre_link_args = LinkArgs::new();
|
let mut pre_link_args = LinkArgs::new();
|
||||||
pre_link_args.insert(
|
pre_link_args.insert(
|
||||||
LinkerFlavor::Lld(LldFlavor::Ld),
|
LinkerFlavor::Lld(LldFlavor::Ld),
|
||||||
vec!["--build-id".to_string(), "--hash-style=gnu".to_string(), "--Bstatic".to_string()],
|
vec!["--build-id".into(), "--hash-style=gnu".into(), "--Bstatic".into()],
|
||||||
);
|
);
|
||||||
|
|
||||||
TargetOptions {
|
TargetOptions {
|
||||||
os: "hermit".to_string(),
|
os: "hermit".into(),
|
||||||
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
|
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
|
||||||
linker: Some("rust-lld".to_owned()),
|
linker: Some("rust-lld".into()),
|
||||||
executables: true,
|
executables: true,
|
||||||
has_thread_local: true,
|
has_thread_local: true,
|
||||||
pre_link_args,
|
pre_link_args,
|
||||||
|
|
|
@ -2,10 +2,10 @@ use crate::spec::Target;
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
let mut base = super::linux_musl_base::opts();
|
let mut base = super::linux_musl_base::opts();
|
||||||
base.cpu = "hexagonv60".to_string();
|
base.cpu = "hexagonv60".into();
|
||||||
base.max_atomic_width = Some(32);
|
base.max_atomic_width = Some(32);
|
||||||
// FIXME: HVX length defaults are per-CPU
|
// FIXME: HVX length defaults are per-CPU
|
||||||
base.features = "-small-data,+hvx-length128b".to_string();
|
base.features = "-small-data,+hvx-length128b".into();
|
||||||
|
|
||||||
base.crt_static_default = false;
|
base.crt_static_default = false;
|
||||||
base.has_rpath = true;
|
base.has_rpath = true;
|
||||||
|
@ -16,7 +16,7 @@ pub fn target() -> Target {
|
||||||
base.c_enum_min_bits = 8;
|
base.c_enum_min_bits = 8;
|
||||||
|
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "hexagon-unknown-linux-musl".to_string(),
|
llvm_target: "hexagon-unknown-linux-musl".into(),
|
||||||
pointer_width: 32,
|
pointer_width: 32,
|
||||||
data_layout: concat!(
|
data_layout: concat!(
|
||||||
"e-m:e-p:32:32:32-a:0-n16:32-i64:64:64-i32:32",
|
"e-m:e-p:32:32:32-a:0-n16:32-i64:64:64-i32:32",
|
||||||
|
@ -24,8 +24,8 @@ pub fn target() -> Target {
|
||||||
":32:32-v64:64:64-v512:512:512-v1024:1024:1024-v2048",
|
":32:32-v64:64:64-v512:512:512-v1024:1024:1024-v2048",
|
||||||
":2048:2048"
|
":2048:2048"
|
||||||
)
|
)
|
||||||
.to_string(),
|
.into(),
|
||||||
arch: "hexagon".to_string(),
|
arch: "hexagon".into(),
|
||||||
options: base,
|
options: base,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,13 +3,15 @@ use crate::spec::{StackProbeType, Target, TargetOptions};
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
let base = opts("ios", Arch::I386);
|
let base = opts("ios", Arch::I386);
|
||||||
|
let llvm_target = super::apple_base::ios_sim_llvm_target("i386");
|
||||||
|
|
||||||
Target {
|
Target {
|
||||||
llvm_target: super::apple_base::ios_sim_llvm_target("i386"),
|
llvm_target: llvm_target.into(),
|
||||||
pointer_width: 32,
|
pointer_width: 32,
|
||||||
data_layout: "e-m:o-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
|
data_layout: "e-m:o-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
|
||||||
f64:32:64-f80:128-n8:16:32-S128"
|
f64:32:64-f80:128-n8:16:32-S128"
|
||||||
.to_string(),
|
.into(),
|
||||||
arch: "x86".to_string(),
|
arch: "x86".into(),
|
||||||
options: TargetOptions {
|
options: TargetOptions {
|
||||||
max_atomic_width: Some(64),
|
max_atomic_width: Some(64),
|
||||||
// don't use probe-stack=inline-asm until rust#83139 and rust#84667 are resolved
|
// don't use probe-stack=inline-asm until rust#83139 and rust#84667 are resolved
|
||||||
|
|
|
@ -2,7 +2,7 @@ use crate::spec::Target;
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
let mut base = super::i686_unknown_linux_gnu::target();
|
let mut base = super::i686_unknown_linux_gnu::target();
|
||||||
base.cpu = "i386".to_string();
|
base.cpu = "i386".into();
|
||||||
base.llvm_target = "i386-unknown-linux-gnu".to_string();
|
base.llvm_target = "i386-unknown-linux-gnu".into();
|
||||||
base
|
base
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@ use crate::spec::Target;
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
let mut base = super::i686_unknown_linux_gnu::target();
|
let mut base = super::i686_unknown_linux_gnu::target();
|
||||||
base.cpu = "i486".to_string();
|
base.cpu = "i486".into();
|
||||||
base.llvm_target = "i486-unknown-linux-gnu".to_string();
|
base.llvm_target = "i486-unknown-linux-gnu".into();
|
||||||
base
|
base
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@ use crate::spec::Target;
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
let mut base = super::i686_pc_windows_msvc::target();
|
let mut base = super::i686_pc_windows_msvc::target();
|
||||||
base.cpu = "pentium".to_string();
|
base.cpu = "pentium".into();
|
||||||
base.llvm_target = "i586-pc-windows-msvc".to_string();
|
base.llvm_target = "i586-pc-windows-msvc".into();
|
||||||
base
|
base
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@ use crate::spec::Target;
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
let mut base = super::i686_unknown_linux_gnu::target();
|
let mut base = super::i686_unknown_linux_gnu::target();
|
||||||
base.cpu = "pentium".to_string();
|
base.cpu = "pentium".into();
|
||||||
base.llvm_target = "i586-unknown-linux-gnu".to_string();
|
base.llvm_target = "i586-unknown-linux-gnu".into();
|
||||||
base
|
base
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@ use crate::spec::Target;
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
let mut base = super::i686_unknown_linux_musl::target();
|
let mut base = super::i686_unknown_linux_musl::target();
|
||||||
base.cpu = "pentium".to_string();
|
base.cpu = "pentium".into();
|
||||||
base.llvm_target = "i586-unknown-linux-musl".to_string();
|
base.llvm_target = "i586-unknown-linux-musl".into();
|
||||||
base
|
base
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,10 +2,10 @@ use crate::spec::{FramePointer, LinkerFlavor, StackProbeType, Target, TargetOpti
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
let mut base = super::apple_base::opts("macos");
|
let mut base = super::apple_base::opts("macos");
|
||||||
base.cpu = "yonah".to_string();
|
base.cpu = "yonah".into();
|
||||||
base.max_atomic_width = Some(64);
|
base.max_atomic_width = Some(64);
|
||||||
base.pre_link_args.insert(LinkerFlavor::Gcc, vec!["-m32".to_string()]);
|
base.pre_link_args.insert(LinkerFlavor::Gcc, vec!["-m32".into()]);
|
||||||
base.link_env_remove.extend(super::apple_base::macos_link_env_remove());
|
base.link_env_remove.to_mut().extend(super::apple_base::macos_link_env_remove());
|
||||||
// don't use probe-stack=inline-asm until rust#83139 and rust#84667 are resolved
|
// don't use probe-stack=inline-asm until rust#83139 and rust#84667 are resolved
|
||||||
base.stack_probes = StackProbeType::Call;
|
base.stack_probes = StackProbeType::Call;
|
||||||
base.frame_pointer = FramePointer::Always;
|
base.frame_pointer = FramePointer::Always;
|
||||||
|
@ -17,12 +17,12 @@ pub fn target() -> Target {
|
||||||
let llvm_target = super::apple_base::macos_llvm_target(&arch);
|
let llvm_target = super::apple_base::macos_llvm_target(&arch);
|
||||||
|
|
||||||
Target {
|
Target {
|
||||||
llvm_target,
|
llvm_target: llvm_target.into(),
|
||||||
pointer_width: 32,
|
pointer_width: 32,
|
||||||
data_layout: "e-m:o-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
|
data_layout: "e-m:o-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
|
||||||
f64:32:64-f80:128-n8:16:32-S128"
|
f64:32:64-f80:128-n8:16:32-S128"
|
||||||
.to_string(),
|
.into(),
|
||||||
arch: "x86".to_string(),
|
arch: "x86".into(),
|
||||||
options: TargetOptions { mcount: "\u{1}mcount".to_string(), ..base },
|
options: TargetOptions { mcount: "\u{1}mcount".into(), ..base },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,18 +9,18 @@ pub fn target() -> Target {
|
||||||
base.max_atomic_width = Some(64);
|
base.max_atomic_width = Some(64);
|
||||||
|
|
||||||
// https://developer.android.com/ndk/guides/abis.html#x86
|
// https://developer.android.com/ndk/guides/abis.html#x86
|
||||||
base.cpu = "pentiumpro".to_string();
|
base.cpu = "pentiumpro".into();
|
||||||
base.features = "+mmx,+sse,+sse2,+sse3,+ssse3".to_string();
|
base.features = "+mmx,+sse,+sse2,+sse3,+ssse3".into();
|
||||||
// don't use probe-stack=inline-asm until rust#83139 and rust#84667 are resolved
|
// don't use probe-stack=inline-asm until rust#83139 and rust#84667 are resolved
|
||||||
base.stack_probes = StackProbeType::Call;
|
base.stack_probes = StackProbeType::Call;
|
||||||
|
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "i686-linux-android".to_string(),
|
llvm_target: "i686-linux-android".into(),
|
||||||
pointer_width: 32,
|
pointer_width: 32,
|
||||||
data_layout: "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
|
data_layout: "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
|
||||||
f64:32:64-f80:32-n8:16:32-S128"
|
f64:32:64-f80:32-n8:16:32-S128"
|
||||||
.to_string(),
|
.into(),
|
||||||
arch: "x86".to_string(),
|
arch: "x86".into(),
|
||||||
options: TargetOptions { supported_sanitizers: SanitizerSet::ADDRESS, ..base },
|
options: TargetOptions { supported_sanitizers: SanitizerSet::ADDRESS, ..base },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,27 +2,26 @@ use crate::spec::{FramePointer, LinkerFlavor, LldFlavor, Target};
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
let mut base = super::windows_gnu_base::opts();
|
let mut base = super::windows_gnu_base::opts();
|
||||||
base.cpu = "pentium4".to_string();
|
base.cpu = "pentium4".into();
|
||||||
base.pre_link_args
|
base.pre_link_args.insert(LinkerFlavor::Lld(LldFlavor::Ld), vec!["-m".into(), "i386pe".into()]);
|
||||||
.insert(LinkerFlavor::Lld(LldFlavor::Ld), vec!["-m".to_string(), "i386pe".to_string()]);
|
|
||||||
base.max_atomic_width = Some(64);
|
base.max_atomic_width = Some(64);
|
||||||
base.frame_pointer = FramePointer::Always; // Required for backtraces
|
base.frame_pointer = FramePointer::Always; // Required for backtraces
|
||||||
base.linker = Some("i686-w64-mingw32-gcc".to_string());
|
base.linker = Some("i686-w64-mingw32-gcc".into());
|
||||||
|
|
||||||
// Mark all dynamic libraries and executables as compatible with the larger 4GiB address
|
// Mark all dynamic libraries and executables as compatible with the larger 4GiB address
|
||||||
// space available to x86 Windows binaries on x86_64.
|
// space available to x86 Windows binaries on x86_64.
|
||||||
base.pre_link_args
|
base.pre_link_args
|
||||||
.entry(LinkerFlavor::Gcc)
|
.entry(LinkerFlavor::Gcc)
|
||||||
.or_default()
|
.or_default()
|
||||||
.push("-Wl,--large-address-aware".to_string());
|
.push("-Wl,--large-address-aware".into());
|
||||||
|
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "i686-pc-windows-gnu".to_string(),
|
llvm_target: "i686-pc-windows-gnu".into(),
|
||||||
pointer_width: 32,
|
pointer_width: 32,
|
||||||
data_layout: "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
|
data_layout: "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
|
||||||
i64:64-f80:32-n8:16:32-a:0:32-S32"
|
i64:64-f80:32-n8:16:32-a:0:32-S32"
|
||||||
.to_string(),
|
.into(),
|
||||||
arch: "x86".to_string(),
|
arch: "x86".into(),
|
||||||
options: base,
|
options: base,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,17 +2,17 @@ use crate::spec::{LinkerFlavor, LldFlavor, Target};
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
let mut base = super::windows_msvc_base::opts();
|
let mut base = super::windows_msvc_base::opts();
|
||||||
base.cpu = "pentium4".to_string();
|
base.cpu = "pentium4".into();
|
||||||
base.max_atomic_width = Some(64);
|
base.max_atomic_width = Some(64);
|
||||||
|
|
||||||
let pre_link_args_msvc = vec![
|
let pre_link_args_msvc = vec![
|
||||||
// Mark all dynamic libraries and executables as compatible with the larger 4GiB address
|
// Mark all dynamic libraries and executables as compatible with the larger 4GiB address
|
||||||
// space available to x86 Windows binaries on x86_64.
|
// space available to x86 Windows binaries on x86_64.
|
||||||
"/LARGEADDRESSAWARE".to_string(),
|
"/LARGEADDRESSAWARE".into(),
|
||||||
// Ensure the linker will only produce an image if it can also produce a table of
|
// Ensure the linker will only produce an image if it can also produce a table of
|
||||||
// the image's safe exception handlers.
|
// the image's safe exception handlers.
|
||||||
// https://docs.microsoft.com/en-us/cpp/build/reference/safeseh-image-has-safe-exception-handlers
|
// https://docs.microsoft.com/en-us/cpp/build/reference/safeseh-image-has-safe-exception-handlers
|
||||||
"/SAFESEH".to_string(),
|
"/SAFESEH".into(),
|
||||||
];
|
];
|
||||||
base.pre_link_args.entry(LinkerFlavor::Msvc).or_default().extend(pre_link_args_msvc.clone());
|
base.pre_link_args.entry(LinkerFlavor::Msvc).or_default().extend(pre_link_args_msvc.clone());
|
||||||
base.pre_link_args
|
base.pre_link_args
|
||||||
|
@ -23,12 +23,12 @@ pub fn target() -> Target {
|
||||||
base.has_thread_local = false;
|
base.has_thread_local = false;
|
||||||
|
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "i686-pc-windows-msvc".to_string(),
|
llvm_target: "i686-pc-windows-msvc".into(),
|
||||||
pointer_width: 32,
|
pointer_width: 32,
|
||||||
data_layout: "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
|
data_layout: "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
|
||||||
i64:64-f80:128-n8:16:32-a:0:32-S32"
|
i64:64-f80:128-n8:16:32-a:0:32-S32"
|
||||||
.to_string(),
|
.into(),
|
||||||
arch: "x86".to_string(),
|
arch: "x86".into(),
|
||||||
options: base,
|
options: base,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,21 +2,21 @@ use crate::spec::{LinkerFlavor, StackProbeType, Target};
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
let mut base = super::freebsd_base::opts();
|
let mut base = super::freebsd_base::opts();
|
||||||
base.cpu = "pentium4".to_string();
|
base.cpu = "pentium4".into();
|
||||||
base.max_atomic_width = Some(64);
|
base.max_atomic_width = Some(64);
|
||||||
let pre_link_args = base.pre_link_args.entry(LinkerFlavor::Gcc).or_default();
|
let pre_link_args = base.pre_link_args.entry(LinkerFlavor::Gcc).or_default();
|
||||||
pre_link_args.push("-m32".to_string());
|
pre_link_args.push("-m32".into());
|
||||||
pre_link_args.push("-Wl,-znotext".to_string());
|
pre_link_args.push("-Wl,-znotext".into());
|
||||||
// don't use probe-stack=inline-asm until rust#83139 and rust#84667 are resolved
|
// don't use probe-stack=inline-asm until rust#83139 and rust#84667 are resolved
|
||||||
base.stack_probes = StackProbeType::Call;
|
base.stack_probes = StackProbeType::Call;
|
||||||
|
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "i686-unknown-freebsd".to_string(),
|
llvm_target: "i686-unknown-freebsd".into(),
|
||||||
pointer_width: 32,
|
pointer_width: 32,
|
||||||
data_layout: "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
|
data_layout: "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
|
||||||
f64:32:64-f80:32-n8:16:32-S128"
|
f64:32:64-f80:32-n8:16:32-S128"
|
||||||
.to_string(),
|
.into(),
|
||||||
arch: "x86".to_string(),
|
arch: "x86".into(),
|
||||||
options: base,
|
options: base,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,19 +2,19 @@ use crate::spec::{LinkerFlavor, StackProbeType, Target};
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
let mut base = super::haiku_base::opts();
|
let mut base = super::haiku_base::opts();
|
||||||
base.cpu = "pentium4".to_string();
|
base.cpu = "pentium4".into();
|
||||||
base.max_atomic_width = Some(64);
|
base.max_atomic_width = Some(64);
|
||||||
base.pre_link_args.insert(LinkerFlavor::Gcc, vec!["-m32".to_string()]);
|
base.pre_link_args.insert(LinkerFlavor::Gcc, vec!["-m32".into()]);
|
||||||
// don't use probe-stack=inline-asm until rust#83139 and rust#84667 are resolved
|
// don't use probe-stack=inline-asm until rust#83139 and rust#84667 are resolved
|
||||||
base.stack_probes = StackProbeType::Call;
|
base.stack_probes = StackProbeType::Call;
|
||||||
|
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "i686-unknown-haiku".to_string(),
|
llvm_target: "i686-unknown-haiku".into(),
|
||||||
pointer_width: 32,
|
pointer_width: 32,
|
||||||
data_layout: "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
|
data_layout: "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
|
||||||
f64:32:64-f80:32-n8:16:32-S128"
|
f64:32:64-f80:32-n8:16:32-S128"
|
||||||
.to_string(),
|
.into(),
|
||||||
arch: "x86".to_string(),
|
arch: "x86".into(),
|
||||||
options: base,
|
options: base,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,19 +2,19 @@ use crate::spec::{LinkerFlavor, StackProbeType, Target};
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
let mut base = super::linux_gnu_base::opts();
|
let mut base = super::linux_gnu_base::opts();
|
||||||
base.cpu = "pentium4".to_string();
|
base.cpu = "pentium4".into();
|
||||||
base.max_atomic_width = Some(64);
|
base.max_atomic_width = Some(64);
|
||||||
base.pre_link_args.entry(LinkerFlavor::Gcc).or_default().push("-m32".to_string());
|
base.pre_link_args.entry(LinkerFlavor::Gcc).or_default().push("-m32".into());
|
||||||
// don't use probe-stack=inline-asm until rust#83139 and rust#84667 are resolved
|
// don't use probe-stack=inline-asm until rust#83139 and rust#84667 are resolved
|
||||||
base.stack_probes = StackProbeType::Call;
|
base.stack_probes = StackProbeType::Call;
|
||||||
|
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "i686-unknown-linux-gnu".to_string(),
|
llvm_target: "i686-unknown-linux-gnu".into(),
|
||||||
pointer_width: 32,
|
pointer_width: 32,
|
||||||
data_layout: "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
|
data_layout: "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
|
||||||
f64:32:64-f80:32-n8:16:32-S128"
|
f64:32:64-f80:32-n8:16:32-S128"
|
||||||
.to_string(),
|
.into(),
|
||||||
arch: "x86".to_string(),
|
arch: "x86".into(),
|
||||||
options: base,
|
options: base,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,10 +2,10 @@ use crate::spec::{FramePointer, LinkerFlavor, StackProbeType, Target};
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
let mut base = super::linux_musl_base::opts();
|
let mut base = super::linux_musl_base::opts();
|
||||||
base.cpu = "pentium4".to_string();
|
base.cpu = "pentium4".into();
|
||||||
base.max_atomic_width = Some(64);
|
base.max_atomic_width = Some(64);
|
||||||
base.pre_link_args.entry(LinkerFlavor::Gcc).or_default().push("-m32".to_string());
|
base.pre_link_args.entry(LinkerFlavor::Gcc).or_default().push("-m32".into());
|
||||||
base.pre_link_args.entry(LinkerFlavor::Gcc).or_default().push("-Wl,-melf_i386".to_string());
|
base.pre_link_args.entry(LinkerFlavor::Gcc).or_default().push("-Wl,-melf_i386".into());
|
||||||
// don't use probe-stack=inline-asm until rust#83139 and rust#84667 are resolved
|
// don't use probe-stack=inline-asm until rust#83139 and rust#84667 are resolved
|
||||||
base.stack_probes = StackProbeType::Call;
|
base.stack_probes = StackProbeType::Call;
|
||||||
|
|
||||||
|
@ -24,12 +24,12 @@ pub fn target() -> Target {
|
||||||
base.frame_pointer = FramePointer::Always;
|
base.frame_pointer = FramePointer::Always;
|
||||||
|
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "i686-unknown-linux-musl".to_string(),
|
llvm_target: "i686-unknown-linux-musl".into(),
|
||||||
pointer_width: 32,
|
pointer_width: 32,
|
||||||
data_layout: "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
|
data_layout: "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
|
||||||
f64:32:64-f80:32-n8:16:32-S128"
|
f64:32:64-f80:32-n8:16:32-S128"
|
||||||
.to_string(),
|
.into(),
|
||||||
arch: "x86".to_string(),
|
arch: "x86".into(),
|
||||||
options: base,
|
options: base,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,19 +2,19 @@ use crate::spec::{LinkerFlavor, StackProbeType, Target, TargetOptions};
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
let mut base = super::netbsd_base::opts();
|
let mut base = super::netbsd_base::opts();
|
||||||
base.cpu = "pentium4".to_string();
|
base.cpu = "pentium4".into();
|
||||||
base.max_atomic_width = Some(64);
|
base.max_atomic_width = Some(64);
|
||||||
base.pre_link_args.entry(LinkerFlavor::Gcc).or_default().push("-m32".to_string());
|
base.pre_link_args.entry(LinkerFlavor::Gcc).or_default().push("-m32".into());
|
||||||
// don't use probe-stack=inline-asm until rust#83139 and rust#84667 are resolved
|
// don't use probe-stack=inline-asm until rust#83139 and rust#84667 are resolved
|
||||||
base.stack_probes = StackProbeType::Call;
|
base.stack_probes = StackProbeType::Call;
|
||||||
|
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "i686-unknown-netbsdelf".to_string(),
|
llvm_target: "i686-unknown-netbsdelf".into(),
|
||||||
pointer_width: 32,
|
pointer_width: 32,
|
||||||
data_layout: "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
|
data_layout: "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
|
||||||
f64:32:64-f80:32-n8:16:32-S128"
|
f64:32:64-f80:32-n8:16:32-S128"
|
||||||
.to_string(),
|
.into(),
|
||||||
arch: "x86".to_string(),
|
arch: "x86".into(),
|
||||||
options: TargetOptions { mcount: "__mcount".to_string(), ..base },
|
options: TargetOptions { mcount: "__mcount".into(), ..base },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,20 +2,20 @@ use crate::spec::{LinkerFlavor, StackProbeType, Target};
|
||||||
|
|
||||||
pub fn target() -> Target {
|
pub fn target() -> Target {
|
||||||
let mut base = super::openbsd_base::opts();
|
let mut base = super::openbsd_base::opts();
|
||||||
base.cpu = "pentium4".to_string();
|
base.cpu = "pentium4".into();
|
||||||
base.max_atomic_width = Some(64);
|
base.max_atomic_width = Some(64);
|
||||||
base.pre_link_args.entry(LinkerFlavor::Gcc).or_default().push("-m32".to_string());
|
base.pre_link_args.entry(LinkerFlavor::Gcc).or_default().push("-m32".into());
|
||||||
base.pre_link_args.entry(LinkerFlavor::Gcc).or_default().push("-fuse-ld=lld".to_string());
|
base.pre_link_args.entry(LinkerFlavor::Gcc).or_default().push("-fuse-ld=lld".into());
|
||||||
// don't use probe-stack=inline-asm until rust#83139 and rust#84667 are resolved
|
// don't use probe-stack=inline-asm until rust#83139 and rust#84667 are resolved
|
||||||
base.stack_probes = StackProbeType::Call;
|
base.stack_probes = StackProbeType::Call;
|
||||||
|
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "i686-unknown-openbsd".to_string(),
|
llvm_target: "i686-unknown-openbsd".into(),
|
||||||
pointer_width: 32,
|
pointer_width: 32,
|
||||||
data_layout: "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
|
data_layout: "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
|
||||||
f64:32:64-f80:32-n8:16:32-S128"
|
f64:32:64-f80:32-n8:16:32-S128"
|
||||||
.to_string(),
|
.into(),
|
||||||
arch: "x86".to_string(),
|
arch: "x86".into(),
|
||||||
options: base,
|
options: base,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue