mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-21 22:34:05 +00:00
Auto merge of #95624 - Dylan-DPC:rollup-r8w7ui3, r=Dylan-DPC
Rollup of 5 pull requests Successful merges: - #95202 (Reduce the cost of loading all built-ins targets) - #95553 (Don't emit non-asm contents error for naked function composed of errors) - #95613 (Fix rustdoc attribute display) - #95617 (Fix &mut invalidation in ptr::swap doctest) - #95618 (core: document that the align_of* functions return the alignment in bytes) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This commit is contained in:
commit
6af09d2505
@ -304,8 +304,12 @@ pub(crate) fn run_aot(
|
||||
};
|
||||
|
||||
// FIXME handle `-Ctarget-cpu=native`
|
||||
let target_cpu =
|
||||
tcx.sess.opts.cg.target_cpu.as_ref().unwrap_or(&tcx.sess.target.cpu).to_owned();
|
||||
let target_cpu = match tcx.sess.opts.cg.target_cpu {
|
||||
Some(ref name) => name,
|
||||
None => tcx.sess.target.cpu.as_ref(),
|
||||
}
|
||||
.to_owned();
|
||||
|
||||
Box::new((
|
||||
CodegenResults {
|
||||
modules,
|
||||
|
@ -287,8 +287,10 @@ fn handle_native(name: &str) -> &str {
|
||||
}
|
||||
|
||||
pub fn target_cpu(sess: &Session) -> &str {
|
||||
let name = sess.opts.cg.target_cpu.as_ref().unwrap_or(&sess.target.cpu);
|
||||
handle_native(name)
|
||||
match sess.opts.cg.target_cpu {
|
||||
Some(ref name) => handle_native(name),
|
||||
None => handle_native(sess.target.cpu.as_ref()),
|
||||
}
|
||||
}
|
||||
|
||||
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.
|
||||
// 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(
|
||||
cx.llcx,
|
||||
|
@ -1452,7 +1452,7 @@ impl<'a, 'll, 'tcx> Builder<'a, 'll, 'tcx> {
|
||||
}
|
||||
|
||||
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
|
||||
"riscv64" => llvm_util::get_version() < (13, 0, 0),
|
||||
_ => false,
|
||||
|
@ -134,7 +134,7 @@ pub unsafe fn create_module<'ll>(
|
||||
let mod_name = SmallCStr::new(mod_name);
|
||||
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();
|
||||
if llvm_version < (13, 0, 0) {
|
||||
if sess.target.arch == "powerpc64" {
|
||||
@ -859,7 +859,7 @@ impl<'ll> CodegenCx<'ll, '_> {
|
||||
|
||||
// This isn't an "LLVM intrinsic", but LLVM's optimization passes
|
||||
// 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),
|
||||
_ => 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 n = self.const_usize(layout.size().bytes());
|
||||
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)),
|
||||
_ => 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("")
|
||||
}
|
||||
|
||||
let cg_opts = sess.opts.cg.llvm_args.iter();
|
||||
let tg_opts = sess.target.llvm_args.iter();
|
||||
let cg_opts = sess.opts.cg.llvm_args.iter().map(AsRef::as_ref);
|
||||
let tg_opts = sess.target.llvm_args.iter().map(AsRef::as_ref);
|
||||
let sess_args = cg_opts.chain(tg_opts);
|
||||
|
||||
let user_specified_args: FxHashSet<_> =
|
||||
@ -375,8 +375,10 @@ fn handle_native(name: &str) -> &str {
|
||||
}
|
||||
|
||||
pub fn target_cpu(sess: &Session) -> &str {
|
||||
let name = sess.opts.cg.target_cpu.as_ref().unwrap_or(&sess.target.cpu);
|
||||
handle_native(name)
|
||||
match sess.opts.cg.target_cpu {
|
||||
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`,
|
||||
|
@ -40,6 +40,7 @@ use std::ffi::OsString;
|
||||
use std::fs::{File, OpenOptions};
|
||||
use std::io::{BufWriter, Write};
|
||||
use std::lazy::OnceCell;
|
||||
use std::ops::Deref;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::process::{ExitStatus, Output, Stdio};
|
||||
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);
|
||||
|
||||
for &(ref k, ref v) in &sess.target.link_env {
|
||||
cmd.env(k, v);
|
||||
for &(ref k, ref v) in sess.target.link_env.as_ref() {
|
||||
cmd.env(k.as_ref(), v.as_ref());
|
||||
}
|
||||
for k in &sess.target.link_env_remove {
|
||||
cmd.env_remove(k);
|
||||
for k in sess.target.link_env_remove.as_ref() {
|
||||
cmd.env_remove(k.as_ref());
|
||||
}
|
||||
|
||||
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(
|
||||
sess,
|
||||
sess.target.linker.clone().map(PathBuf::from),
|
||||
sess.target.linker.as_deref().map(PathBuf::from),
|
||||
Some(sess.target.linker_flavor),
|
||||
) {
|
||||
return ret;
|
||||
@ -1586,7 +1587,7 @@ fn add_post_link_objects(
|
||||
/// FIXME: Determine where exactly these args need to be inserted.
|
||||
fn add_pre_link_args(cmd: &mut dyn Linker, sess: &Session, flavor: LinkerFlavor) {
|
||||
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);
|
||||
}
|
||||
@ -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 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));
|
||||
}
|
||||
|
||||
@ -1634,15 +1635,15 @@ fn add_late_link_args(
|
||||
});
|
||||
if any_dynamic_crate {
|
||||
if let Some(args) = sess.target.late_link_args_dynamic.get(&flavor) {
|
||||
cmd.args(args);
|
||||
cmd.args(args.iter().map(Deref::deref));
|
||||
}
|
||||
} else {
|
||||
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) {
|
||||
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.
|
||||
fn add_post_link_args(cmd: &mut dyn Linker, sess: &Session, flavor: LinkerFlavor) {
|
||||
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("--cpu-features");
|
||||
cmd.arg(match &sess.opts.cg.target_feature {
|
||||
feat if !feat.is_empty() => feat,
|
||||
_ => &sess.target.options.features,
|
||||
feat if !feat.is_empty() => feat.as_ref(),
|
||||
_ => 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 llvm_target = &sess.target.llvm_target;
|
||||
if sess.target.vendor != "apple"
|
||||
|| !matches!(os.as_str(), "ios" | "tvos")
|
||||
|| !matches!(os.as_ref(), "ios" | "tvos")
|
||||
|| flavor != LinkerFlavor::Gcc
|
||||
{
|
||||
return;
|
||||
}
|
||||
let sdk_name = match (arch.as_str(), os.as_str()) {
|
||||
let sdk_name = match (arch.as_ref(), os.as_ref()) {
|
||||
("aarch64", "tvos") => "appletvos",
|
||||
("x86_64", "tvos") => "appletvsimulator",
|
||||
("arm", "ios") => "iphoneos",
|
||||
|
@ -75,7 +75,7 @@ pub fn get_linker<'a>(
|
||||
if let Some(ref tool) = msvc_tool {
|
||||
let original_path = tool.path();
|
||||
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" => Some("x86"),
|
||||
"aarch64" => Some("arm64"),
|
||||
@ -1520,7 +1520,7 @@ impl<'a> L4Bender<'a> {
|
||||
|
||||
pub(crate) fn exported_symbols(tcx: TyCtxt<'_>, crate_type: CrateType) -> Vec<String> {
|
||||
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();
|
||||
|
@ -218,7 +218,7 @@ impl ModuleConfig {
|
||||
false
|
||||
),
|
||||
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(),
|
||||
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,
|
||||
target_can_use_split_dwarf: tcx.sess.target_can_use_split_dwarf(),
|
||||
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,
|
||||
split_debuginfo: tcx.sess.split_debuginfo(),
|
||||
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)
|
||||
} else if f.starts_with(rmeta_prefix) && f.ends_with(rmeta_suffix) {
|
||||
(&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)
|
||||
} 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 {
|
||||
path: spf.path.clone(),
|
||||
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"))
|
||||
|| file.starts_with(&self.target.dll_prefix)
|
||||
&& file.ends_with(&self.target.dll_suffix)
|
||||
|| file.starts_with(self.target.dll_prefix.as_ref())
|
||||
&& file.ends_with(self.target.dll_suffix.as_ref())
|
||||
{
|
||||
// Make sure there's at most one rlib and at most one dylib.
|
||||
// Note to take care and match against the non-canonicalized name:
|
||||
@ -733,8 +733,8 @@ impl<'a> CrateLocator<'a> {
|
||||
crate_name: self.crate_name,
|
||||
root,
|
||||
triple: self.triple,
|
||||
dll_prefix: self.target.dll_prefix.clone(),
|
||||
dll_suffix: self.target.dll_suffix.clone(),
|
||||
dll_prefix: self.target.dll_prefix.to_string(),
|
||||
dll_suffix: self.target.dll_suffix.to_string(),
|
||||
crate_rejections: self.crate_rejections,
|
||||
})
|
||||
}
|
||||
|
@ -147,7 +147,7 @@ impl<'tcx> Visitor<'tcx> for CheckParameters<'tcx> {
|
||||
fn check_asm<'tcx>(tcx: TyCtxt<'tcx>, body: &'tcx hir::Body<'tcx>, fn_span: Span) {
|
||||
let mut this = CheckInlineAssembly { tcx, items: Vec::new() };
|
||||
this.visit_body(body);
|
||||
if let [(ItemKind::Asm, _)] = this.items[..] {
|
||||
if let [(ItemKind::Asm | ItemKind::Err, _)] = this.items[..] {
|
||||
// Ok.
|
||||
} else {
|
||||
let mut diag = struct_span_err!(
|
||||
@ -156,19 +156,33 @@ fn check_asm<'tcx>(tcx: TyCtxt<'tcx>, body: &'tcx hir::Body<'tcx>, fn_span: Span
|
||||
E0787,
|
||||
"naked functions must contain a single asm block"
|
||||
);
|
||||
|
||||
let mut must_show_error = false;
|
||||
let mut has_asm = false;
|
||||
let mut has_err = false;
|
||||
for &(kind, span) in &this.items {
|
||||
match kind {
|
||||
ItemKind::Asm if has_asm => {
|
||||
must_show_error = true;
|
||||
diag.span_label(span, "multiple asm blocks are unsupported in naked functions");
|
||||
}
|
||||
ItemKind::Asm => has_asm = true,
|
||||
ItemKind::NonAsm => {
|
||||
must_show_error = true;
|
||||
diag.span_label(span, "non-asm is unsupported in naked functions");
|
||||
}
|
||||
ItemKind::Err => has_err = true,
|
||||
}
|
||||
}
|
||||
diag.emit();
|
||||
|
||||
// If the naked function only contains a single asm block and a non-zero number of
|
||||
// errors, then don't show an additional error. This allows for appending/prepending
|
||||
// `compile_error!("...")` statements and reduces error noise.
|
||||
if must_show_error || !has_err {
|
||||
diag.emit();
|
||||
} else {
|
||||
diag.cancel();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -181,6 +195,7 @@ struct CheckInlineAssembly<'tcx> {
|
||||
enum ItemKind {
|
||||
Asm,
|
||||
NonAsm,
|
||||
Err,
|
||||
}
|
||||
|
||||
impl<'tcx> CheckInlineAssembly<'tcx> {
|
||||
@ -222,9 +237,13 @@ impl<'tcx> CheckInlineAssembly<'tcx> {
|
||||
self.check_inline_asm(asm, span);
|
||||
}
|
||||
|
||||
ExprKind::DropTemps(..) | ExprKind::Block(..) | ExprKind::Err => {
|
||||
ExprKind::DropTemps(..) | ExprKind::Block(..) => {
|
||||
hir::intravisit::walk_expr(self, expr);
|
||||
}
|
||||
|
||||
ExprKind::Err => {
|
||||
self.items.push((ItemKind::Err, span));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -170,6 +170,7 @@ use self::JsonEvent::*;
|
||||
use self::ParserError::*;
|
||||
use self::ParserState::*;
|
||||
|
||||
use std::borrow::Cow;
|
||||
use std::collections::{BTreeMap, HashMap};
|
||||
use std::mem::swap;
|
||||
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 {
|
||||
// use variables to indicate the arity of the tuple
|
||||
($($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> {
|
||||
fn to_json(&self) -> Json {
|
||||
let mut d = BTreeMap::new();
|
||||
|
@ -956,7 +956,7 @@ fn default_configuration(sess: &Session) -> CrateConfig {
|
||||
ret.reserve(7); // the minimum number of insertions
|
||||
// Target bindings.
|
||||
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))));
|
||||
if fam == "windows" {
|
||||
ret.insert((sym::windows, None));
|
||||
|
@ -2,14 +2,14 @@ use crate::spec::{FramePointer, LinkerFlavor, SanitizerSet, Target, TargetOption
|
||||
|
||||
pub fn target() -> Target {
|
||||
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);
|
||||
|
||||
// FIXME: The leak sanitizer currently fails the tests, see #88132.
|
||||
base.supported_sanitizers = SanitizerSet::ADDRESS | SanitizerSet::CFI | SanitizerSet::THREAD;
|
||||
|
||||
base.pre_link_args.insert(LinkerFlavor::Gcc, vec!["-arch".to_string(), "arm64".to_string()]);
|
||||
base.link_env_remove.extend(super::apple_base::macos_link_env_remove());
|
||||
base.pre_link_args.insert(LinkerFlavor::Gcc, vec!["-arch".into(), "arm64".into()]);
|
||||
base.link_env_remove.to_mut().extend(super::apple_base::macos_link_env_remove());
|
||||
|
||||
// Clang automatically chooses a more specific target based on
|
||||
// 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");
|
||||
|
||||
Target {
|
||||
llvm_target,
|
||||
llvm_target: llvm_target.into(),
|
||||
pointer_width: 64,
|
||||
data_layout: "e-m:o-i64:64-i128:128-n32:64-S128".to_string(),
|
||||
arch: "aarch64".to_string(),
|
||||
data_layout: "e-m:o-i64:64-i128:128-n32:64-S128".into(),
|
||||
arch: "aarch64".into(),
|
||||
options: TargetOptions {
|
||||
mcount: "\u{1}mcount".to_string(),
|
||||
mcount: "\u{1}mcount".into(),
|
||||
frame_pointer: FramePointer::NonLeaf,
|
||||
..base
|
||||
},
|
||||
|
@ -10,12 +10,12 @@ pub fn target() -> Target {
|
||||
let llvm_target = super::apple_base::ios_llvm_target(arch);
|
||||
|
||||
Target {
|
||||
llvm_target,
|
||||
llvm_target: llvm_target.into(),
|
||||
pointer_width: 64,
|
||||
data_layout: "e-m:o-i64:64-i128:128-n32:64-S128".to_string(),
|
||||
arch: "aarch64".to_string(),
|
||||
data_layout: "e-m:o-i64:64-i128:128-n32:64-S128".into(),
|
||||
arch: "aarch64".into(),
|
||||
options: TargetOptions {
|
||||
features: "+neon,+fp-armv8,+apple-a7".to_string(),
|
||||
features: "+neon,+fp-armv8,+apple-a7".into(),
|
||||
max_atomic_width: Some(128),
|
||||
forces_embed_bitcode: true,
|
||||
frame_pointer: FramePointer::NonLeaf,
|
||||
@ -29,7 +29,7 @@ pub fn target() -> Target {
|
||||
-target-abi\0\
|
||||
darwinpcs\0\
|
||||
-Os\0"
|
||||
.to_string(),
|
||||
.into(),
|
||||
..opts("ios", Arch::Arm64)
|
||||
},
|
||||
}
|
||||
|
@ -3,12 +3,12 @@ use crate::spec::{FramePointer, Target, TargetOptions};
|
||||
|
||||
pub fn target() -> Target {
|
||||
Target {
|
||||
llvm_target: "arm64-apple-ios14.0-macabi".to_string(),
|
||||
llvm_target: "arm64-apple-ios14.0-macabi".into(),
|
||||
pointer_width: 64,
|
||||
data_layout: "e-m:o-i64:64-i128:128-n32:64-S128".to_string(),
|
||||
arch: "aarch64".to_string(),
|
||||
data_layout: "e-m:o-i64:64-i128:128-n32:64-S128".into(),
|
||||
arch: "aarch64".into(),
|
||||
options: TargetOptions {
|
||||
features: "+neon,+fp-armv8,+apple-a12".to_string(),
|
||||
features: "+neon,+fp-armv8,+apple-a12".into(),
|
||||
max_atomic_width: Some(128),
|
||||
forces_embed_bitcode: true,
|
||||
frame_pointer: FramePointer::NonLeaf,
|
||||
@ -20,7 +20,7 @@ pub fn target() -> Target {
|
||||
-emit-obj\0\
|
||||
-disable-llvm-passes\0\
|
||||
-Os\0"
|
||||
.to_string(),
|
||||
.into(),
|
||||
..opts("ios", Arch::Arm64_macabi)
|
||||
},
|
||||
}
|
||||
|
@ -12,12 +12,12 @@ pub fn target() -> Target {
|
||||
let llvm_target = super::apple_base::ios_sim_llvm_target(arch);
|
||||
|
||||
Target {
|
||||
llvm_target: llvm_target,
|
||||
llvm_target: llvm_target.into(),
|
||||
pointer_width: 64,
|
||||
data_layout: "e-m:o-i64:64-i128:128-n32:64-S128".to_string(),
|
||||
arch: "aarch64".to_string(),
|
||||
data_layout: "e-m:o-i64:64-i128:128-n32:64-S128".into(),
|
||||
arch: "aarch64".into(),
|
||||
options: TargetOptions {
|
||||
features: "+neon,+fp-armv8,+apple-a7".to_string(),
|
||||
features: "+neon,+fp-armv8,+apple-a7".into(),
|
||||
max_atomic_width: Some(128),
|
||||
forces_embed_bitcode: true,
|
||||
frame_pointer: FramePointer::NonLeaf,
|
||||
@ -31,7 +31,7 @@ pub fn target() -> Target {
|
||||
-target-abi\0\
|
||||
darwinpcs\0\
|
||||
-Os\0"
|
||||
.to_string(),
|
||||
.into(),
|
||||
..base
|
||||
},
|
||||
}
|
||||
|
@ -3,12 +3,12 @@ use crate::spec::{FramePointer, Target, TargetOptions};
|
||||
|
||||
pub fn target() -> Target {
|
||||
Target {
|
||||
llvm_target: "arm64-apple-tvos".to_string(),
|
||||
llvm_target: "arm64-apple-tvos".into(),
|
||||
pointer_width: 64,
|
||||
data_layout: "e-m:o-i64:64-i128:128-n32:64-S128".to_string(),
|
||||
arch: "aarch64".to_string(),
|
||||
data_layout: "e-m:o-i64:64-i128:128-n32:64-S128".into(),
|
||||
arch: "aarch64".into(),
|
||||
options: TargetOptions {
|
||||
features: "+neon,+fp-armv8,+apple-a7".to_string(),
|
||||
features: "+neon,+fp-armv8,+apple-a7".into(),
|
||||
max_atomic_width: Some(128),
|
||||
forces_embed_bitcode: true,
|
||||
frame_pointer: FramePointer::NonLeaf,
|
||||
|
@ -3,14 +3,14 @@ use crate::spec::{Target, TargetOptions};
|
||||
|
||||
pub fn target() -> Target {
|
||||
Target {
|
||||
llvm_target: "aarch64_be-unknown-linux-gnu".to_string(),
|
||||
llvm_target: "aarch64_be-unknown-linux-gnu".into(),
|
||||
pointer_width: 64,
|
||||
data_layout: "E-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".to_string(),
|
||||
arch: "aarch64".to_string(),
|
||||
data_layout: "E-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".into(),
|
||||
arch: "aarch64".into(),
|
||||
options: TargetOptions {
|
||||
features: "+outline-atomics".to_string(),
|
||||
features: "+outline-atomics".into(),
|
||||
max_atomic_width: Some(128),
|
||||
mcount: "\u{1}_mcount".to_string(),
|
||||
mcount: "\u{1}_mcount".into(),
|
||||
endian: Endian::Big,
|
||||
..super::linux_gnu_base::opts()
|
||||
},
|
||||
|
@ -6,14 +6,14 @@ pub fn target() -> Target {
|
||||
base.max_atomic_width = Some(128);
|
||||
|
||||
Target {
|
||||
llvm_target: "aarch64_be-unknown-linux-gnu_ilp32".to_string(),
|
||||
llvm_target: "aarch64_be-unknown-linux-gnu_ilp32".into(),
|
||||
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(),
|
||||
arch: "aarch64".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".into(),
|
||||
options: TargetOptions {
|
||||
abi: "ilp32".to_string(),
|
||||
features: "+outline-atomics".to_string(),
|
||||
mcount: "\u{1}_mcount".to_string(),
|
||||
abi: "ilp32".into(),
|
||||
features: "+outline-atomics".into(),
|
||||
mcount: "\u{1}_mcount".into(),
|
||||
endian: Endian::Big,
|
||||
..base
|
||||
},
|
||||
|
@ -2,10 +2,10 @@ use crate::spec::{SanitizerSet, Target, TargetOptions};
|
||||
|
||||
pub fn target() -> Target {
|
||||
Target {
|
||||
llvm_target: "aarch64-fuchsia".to_string(),
|
||||
llvm_target: "aarch64-fuchsia".into(),
|
||||
pointer_width: 64,
|
||||
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".to_string(),
|
||||
arch: "aarch64".to_string(),
|
||||
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".into(),
|
||||
arch: "aarch64".into(),
|
||||
options: TargetOptions {
|
||||
max_atomic_width: Some(128),
|
||||
supported_sanitizers: SanitizerSet::ADDRESS | SanitizerSet::CFI,
|
||||
|
@ -3,13 +3,13 @@ use super::{RelocModel, Target, TargetOptions};
|
||||
pub fn target() -> Target {
|
||||
let base = super::solid_base::opts("asp3");
|
||||
Target {
|
||||
llvm_target: "aarch64-unknown-none".to_string(),
|
||||
llvm_target: "aarch64-unknown-none".into(),
|
||||
pointer_width: 64,
|
||||
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".to_string(),
|
||||
arch: "aarch64".to_string(),
|
||||
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".into(),
|
||||
arch: "aarch64".into(),
|
||||
options: TargetOptions {
|
||||
linker: Some("aarch64-kmc-elf-gcc".to_owned()),
|
||||
features: "+neon,+fp-armv8".to_string(),
|
||||
linker: Some("aarch64-kmc-elf-gcc".into()),
|
||||
features: "+neon,+fp-armv8".into(),
|
||||
relocation_model: RelocModel::Static,
|
||||
disable_redzone: true,
|
||||
max_atomic_width: Some(128),
|
||||
|
@ -5,15 +5,15 @@ use crate::spec::{SanitizerSet, Target, TargetOptions};
|
||||
|
||||
pub fn target() -> Target {
|
||||
Target {
|
||||
llvm_target: "aarch64-linux-android".to_string(),
|
||||
llvm_target: "aarch64-linux-android".into(),
|
||||
pointer_width: 64,
|
||||
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".to_string(),
|
||||
arch: "aarch64".to_string(),
|
||||
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".into(),
|
||||
arch: "aarch64".into(),
|
||||
options: TargetOptions {
|
||||
max_atomic_width: Some(128),
|
||||
// As documented in https://developer.android.com/ndk/guides/cpu-features.html
|
||||
// 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
|
||||
| SanitizerSet::HWADDRESS
|
||||
| SanitizerSet::MEMTAG
|
||||
|
@ -3,13 +3,13 @@ use crate::spec::Target;
|
||||
pub fn target() -> Target {
|
||||
let mut base = super::windows_msvc_base::opts();
|
||||
base.max_atomic_width = Some(64);
|
||||
base.features = "+neon,+fp-armv8".to_string();
|
||||
base.features = "+neon,+fp-armv8".into();
|
||||
|
||||
Target {
|
||||
llvm_target: "aarch64-pc-windows-msvc".to_string(),
|
||||
llvm_target: "aarch64-pc-windows-msvc".into(),
|
||||
pointer_width: 64,
|
||||
data_layout: "e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128".to_string(),
|
||||
arch: "aarch64".to_string(),
|
||||
data_layout: "e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128".into(),
|
||||
arch: "aarch64".into(),
|
||||
options: base,
|
||||
}
|
||||
}
|
||||
|
@ -2,10 +2,10 @@ use crate::spec::{SanitizerSet, Target, TargetOptions};
|
||||
|
||||
pub fn target() -> Target {
|
||||
Target {
|
||||
llvm_target: "aarch64-unknown-freebsd".to_string(),
|
||||
llvm_target: "aarch64-unknown-freebsd".into(),
|
||||
pointer_width: 64,
|
||||
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".to_string(),
|
||||
arch: "aarch64".to_string(),
|
||||
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".into(),
|
||||
arch: "aarch64".into(),
|
||||
options: TargetOptions {
|
||||
max_atomic_width: Some(128),
|
||||
supported_sanitizers: SanitizerSet::ADDRESS
|
||||
|
@ -3,13 +3,13 @@ use crate::spec::Target;
|
||||
pub fn target() -> Target {
|
||||
let mut base = super::hermit_base::opts();
|
||||
base.max_atomic_width = Some(128);
|
||||
base.features = "+strict-align,+neon,+fp-armv8".to_string();
|
||||
base.features = "+strict-align,+neon,+fp-armv8".into();
|
||||
|
||||
Target {
|
||||
llvm_target: "aarch64-unknown-hermit".to_string(),
|
||||
llvm_target: "aarch64-unknown-hermit".into(),
|
||||
pointer_width: 64,
|
||||
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".to_string(),
|
||||
arch: "aarch64".to_string(),
|
||||
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".into(),
|
||||
arch: "aarch64".into(),
|
||||
options: base,
|
||||
}
|
||||
}
|
||||
|
@ -2,13 +2,13 @@ use crate::spec::{SanitizerSet, Target, TargetOptions};
|
||||
|
||||
pub fn target() -> Target {
|
||||
Target {
|
||||
llvm_target: "aarch64-unknown-linux-gnu".to_string(),
|
||||
llvm_target: "aarch64-unknown-linux-gnu".into(),
|
||||
pointer_width: 64,
|
||||
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".to_string(),
|
||||
arch: "aarch64".to_string(),
|
||||
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".into(),
|
||||
arch: "aarch64".into(),
|
||||
options: TargetOptions {
|
||||
features: "+outline-atomics".to_string(),
|
||||
mcount: "\u{1}_mcount".to_string(),
|
||||
features: "+outline-atomics".into(),
|
||||
mcount: "\u{1}_mcount".into(),
|
||||
max_atomic_width: Some(128),
|
||||
supported_sanitizers: SanitizerSet::ADDRESS
|
||||
| SanitizerSet::CFI
|
||||
|
@ -2,15 +2,15 @@ use crate::spec::{Target, TargetOptions};
|
||||
|
||||
pub fn target() -> Target {
|
||||
Target {
|
||||
llvm_target: "aarch64-unknown-linux-gnu_ilp32".to_string(),
|
||||
llvm_target: "aarch64-unknown-linux-gnu_ilp32".into(),
|
||||
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(),
|
||||
arch: "aarch64".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".into(),
|
||||
options: TargetOptions {
|
||||
abi: "ilp32".to_string(),
|
||||
features: "+outline-atomics".to_string(),
|
||||
abi: "ilp32".into(),
|
||||
features: "+outline-atomics".into(),
|
||||
max_atomic_width: Some(128),
|
||||
mcount: "\u{1}_mcount".to_string(),
|
||||
mcount: "\u{1}_mcount".into(),
|
||||
..super::linux_gnu_base::opts()
|
||||
},
|
||||
}
|
||||
|
@ -5,10 +5,10 @@ pub fn target() -> Target {
|
||||
base.max_atomic_width = Some(128);
|
||||
|
||||
Target {
|
||||
llvm_target: "aarch64-unknown-linux-musl".to_string(),
|
||||
llvm_target: "aarch64-unknown-linux-musl".into(),
|
||||
pointer_width: 64,
|
||||
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".to_string(),
|
||||
arch: "aarch64".to_string(),
|
||||
options: TargetOptions { mcount: "\u{1}_mcount".to_string(), ..base },
|
||||
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".into(),
|
||||
arch: "aarch64".into(),
|
||||
options: TargetOptions { mcount: "\u{1}_mcount".into(), ..base },
|
||||
}
|
||||
}
|
||||
|
@ -2,12 +2,12 @@ use crate::spec::{Target, TargetOptions};
|
||||
|
||||
pub fn target() -> Target {
|
||||
Target {
|
||||
llvm_target: "aarch64-unknown-netbsd".to_string(),
|
||||
llvm_target: "aarch64-unknown-netbsd".into(),
|
||||
pointer_width: 64,
|
||||
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".to_string(),
|
||||
arch: "aarch64".to_string(),
|
||||
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".into(),
|
||||
arch: "aarch64".into(),
|
||||
options: TargetOptions {
|
||||
mcount: "__mcount".to_string(),
|
||||
mcount: "__mcount".into(),
|
||||
max_atomic_width: Some(128),
|
||||
..super::netbsd_base::opts()
|
||||
},
|
||||
|
@ -11,8 +11,8 @@ use super::{LinkerFlavor, LldFlavor, PanicStrategy, RelocModel, Target, TargetOp
|
||||
pub fn target() -> Target {
|
||||
let opts = TargetOptions {
|
||||
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
|
||||
linker: Some("rust-lld".to_owned()),
|
||||
features: "+strict-align,+neon,+fp-armv8".to_string(),
|
||||
linker: Some("rust-lld".into()),
|
||||
features: "+strict-align,+neon,+fp-armv8".into(),
|
||||
executables: true,
|
||||
relocation_model: RelocModel::Static,
|
||||
disable_redzone: true,
|
||||
@ -21,10 +21,10 @@ pub fn target() -> Target {
|
||||
..Default::default()
|
||||
};
|
||||
Target {
|
||||
llvm_target: "aarch64-unknown-none".to_string(),
|
||||
llvm_target: "aarch64-unknown-none".into(),
|
||||
pointer_width: 64,
|
||||
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".to_string(),
|
||||
arch: "aarch64".to_string(),
|
||||
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".into(),
|
||||
arch: "aarch64".into(),
|
||||
options: opts,
|
||||
}
|
||||
}
|
||||
|
@ -10,10 +10,10 @@ use super::{LinkerFlavor, LldFlavor, PanicStrategy, RelocModel, Target, TargetOp
|
||||
|
||||
pub fn target() -> Target {
|
||||
let opts = TargetOptions {
|
||||
abi: "softfloat".to_string(),
|
||||
abi: "softfloat".into(),
|
||||
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
|
||||
linker: Some("rust-lld".to_owned()),
|
||||
features: "+strict-align,-neon,-fp-armv8".to_string(),
|
||||
linker: Some("rust-lld".into()),
|
||||
features: "+strict-align,-neon,-fp-armv8".into(),
|
||||
executables: true,
|
||||
relocation_model: RelocModel::Static,
|
||||
disable_redzone: true,
|
||||
@ -22,10 +22,10 @@ pub fn target() -> Target {
|
||||
..Default::default()
|
||||
};
|
||||
Target {
|
||||
llvm_target: "aarch64-unknown-none".to_string(),
|
||||
llvm_target: "aarch64-unknown-none".into(),
|
||||
pointer_width: 64,
|
||||
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".to_string(),
|
||||
arch: "aarch64".to_string(),
|
||||
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".into(),
|
||||
arch: "aarch64".into(),
|
||||
options: opts,
|
||||
}
|
||||
}
|
||||
|
@ -2,10 +2,10 @@ use crate::spec::{Target, TargetOptions};
|
||||
|
||||
pub fn target() -> Target {
|
||||
Target {
|
||||
llvm_target: "aarch64-unknown-openbsd".to_string(),
|
||||
llvm_target: "aarch64-unknown-openbsd".into(),
|
||||
pointer_width: 64,
|
||||
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".to_string(),
|
||||
arch: "aarch64".to_string(),
|
||||
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".into(),
|
||||
arch: "aarch64".into(),
|
||||
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);
|
||||
|
||||
Target {
|
||||
llvm_target: "aarch64-unknown-redox".to_string(),
|
||||
llvm_target: "aarch64-unknown-redox".into(),
|
||||
pointer_width: 64,
|
||||
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".to_string(),
|
||||
arch: "aarch64".to_string(),
|
||||
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".into(),
|
||||
arch: "aarch64".into(),
|
||||
options: base,
|
||||
}
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ pub fn target() -> Target {
|
||||
|
||||
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
|
||||
@ -18,10 +18,10 @@ pub fn target() -> Target {
|
||||
.extend(pre_link_args_msvc);
|
||||
|
||||
Target {
|
||||
llvm_target: "aarch64-unknown-windows".to_string(),
|
||||
llvm_target: "aarch64-unknown-windows".into(),
|
||||
pointer_width: 64,
|
||||
data_layout: "e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128".to_string(),
|
||||
arch: "aarch64".to_string(),
|
||||
data_layout: "e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128".into(),
|
||||
arch: "aarch64".into(),
|
||||
options: base,
|
||||
}
|
||||
}
|
||||
|
@ -5,10 +5,10 @@ pub fn target() -> Target {
|
||||
base.max_atomic_width = Some(64);
|
||||
|
||||
Target {
|
||||
llvm_target: "aarch64-pc-windows-msvc".to_string(),
|
||||
llvm_target: "aarch64-pc-windows-msvc".into(),
|
||||
pointer_width: 64,
|
||||
data_layout: "e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128".to_string(),
|
||||
arch: "aarch64".to_string(),
|
||||
data_layout: "e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128".into(),
|
||||
arch: "aarch64".into(),
|
||||
options: base,
|
||||
}
|
||||
}
|
||||
|
@ -2,10 +2,10 @@ use crate::spec::{Target, TargetOptions};
|
||||
|
||||
pub fn target() -> Target {
|
||||
Target {
|
||||
llvm_target: "aarch64-unknown-linux-gnu".to_string(),
|
||||
llvm_target: "aarch64-unknown-linux-gnu".into(),
|
||||
pointer_width: 64,
|
||||
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".to_string(),
|
||||
arch: "aarch64".to_string(),
|
||||
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".into(),
|
||||
arch: "aarch64".into(),
|
||||
options: TargetOptions { max_atomic_width: Some(128), ..super::vxworks_base::opts() },
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ use crate::spec::TargetOptions;
|
||||
|
||||
pub fn opts() -> TargetOptions {
|
||||
let mut base = super::linux_base::opts();
|
||||
base.os = "android".to_string();
|
||||
base.os = "android".into();
|
||||
base.dwarf_version = Some(2);
|
||||
base.position_independent_executables = true;
|
||||
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
|
||||
// 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
|
||||
@ -19,20 +19,20 @@ pub fn opts(os: &str) -> TargetOptions {
|
||||
let has_thread_local = macos_deployment_target("x86_64") >= (10, 7);
|
||||
|
||||
TargetOptions {
|
||||
os: os.to_string(),
|
||||
vendor: "apple".to_string(),
|
||||
os: os.into(),
|
||||
vendor: "apple".into(),
|
||||
// macOS has -dead_strip, which doesn't rely on function_sections
|
||||
function_sections: false,
|
||||
dynamic_linking: true,
|
||||
linker_is_gnu: false,
|
||||
executables: true,
|
||||
families: vec!["unix".to_string()],
|
||||
families: cvs!["unix"],
|
||||
is_like_osx: true,
|
||||
dwarf_version: Some(2),
|
||||
frame_pointer: FramePointer::Always,
|
||||
has_rpath: true,
|
||||
dll_suffix: ".dylib".to_string(),
|
||||
archive_format: "darwin".to_string(),
|
||||
dll_suffix: ".dylib".into(),
|
||||
archive_format: "darwin".into(),
|
||||
has_thread_local,
|
||||
abi_return_struct_as_int: true,
|
||||
emit_debug_gdb_scripts: false,
|
||||
@ -51,7 +51,7 @@ pub fn opts(os: &str) -> TargetOptions {
|
||||
// this environment variable too in recent versions.
|
||||
//
|
||||
// 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()
|
||||
}
|
||||
@ -79,19 +79,19 @@ pub fn macos_llvm_target(arch: &str) -> String {
|
||||
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);
|
||||
// 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.
|
||||
if let Ok(sdkroot) = env::var("SDKROOT") {
|
||||
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
|
||||
// "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/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
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
use crate::spec::TargetOptions;
|
||||
use crate::{spec::cvs, spec::TargetOptions};
|
||||
use std::borrow::Cow;
|
||||
|
||||
use Arch::*;
|
||||
#[allow(non_camel_case_types)]
|
||||
@ -14,16 +15,15 @@ pub enum Arch {
|
||||
Arm64_sim,
|
||||
}
|
||||
|
||||
fn target_abi(arch: Arch) -> String {
|
||||
fn target_abi(arch: Arch) -> &'static str {
|
||||
match arch {
|
||||
Armv7 | Armv7s | Arm64 | I386 | X86_64 => "",
|
||||
X86_64_macabi | Arm64_macabi => "macabi",
|
||||
Arm64_sim => "sim",
|
||||
}
|
||||
.to_string()
|
||||
}
|
||||
|
||||
fn target_cpu(arch: Arch) -> String {
|
||||
fn target_cpu(arch: Arch) -> &'static str {
|
||||
match arch {
|
||||
Armv7 => "cortex-a8", // iOS7 is supported on iPhone 4 and higher
|
||||
Armv7s => "cortex-a9",
|
||||
@ -34,22 +34,21 @@ fn target_cpu(arch: Arch) -> String {
|
||||
Arm64_macabi => "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 {
|
||||
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 {
|
||||
abi: target_abi(arch),
|
||||
cpu: target_cpu(arch),
|
||||
abi: target_abi(arch).into(),
|
||||
cpu: target_cpu(arch).into(),
|
||||
dynamic_linking: false,
|
||||
executables: true,
|
||||
link_env_remove: link_env_remove(arch),
|
||||
|
@ -2,14 +2,14 @@ use crate::spec::{SanitizerSet, Target, TargetOptions};
|
||||
|
||||
pub fn target() -> Target {
|
||||
Target {
|
||||
llvm_target: "arm-linux-androideabi".to_string(),
|
||||
llvm_target: "arm-linux-androideabi".into(),
|
||||
pointer_width: 32,
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
|
||||
arch: "arm".to_string(),
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
|
||||
arch: "arm".into(),
|
||||
options: TargetOptions {
|
||||
abi: "eabi".to_string(),
|
||||
abi: "eabi".into(),
|
||||
// https://developer.android.com/ndk/guides/abis.html#armeabi
|
||||
features: "+strict-align,+v5te".to_string(),
|
||||
features: "+strict-align,+v5te".into(),
|
||||
supported_sanitizers: SanitizerSet::ADDRESS,
|
||||
max_atomic_width: Some(32),
|
||||
..super::android_base::opts()
|
||||
|
@ -2,15 +2,15 @@ use crate::spec::{Target, TargetOptions};
|
||||
|
||||
pub fn target() -> Target {
|
||||
Target {
|
||||
llvm_target: "arm-unknown-linux-gnueabi".to_string(),
|
||||
llvm_target: "arm-unknown-linux-gnueabi".into(),
|
||||
pointer_width: 32,
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
|
||||
arch: "arm".to_string(),
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
|
||||
arch: "arm".into(),
|
||||
options: TargetOptions {
|
||||
abi: "eabi".to_string(),
|
||||
features: "+strict-align,+v6".to_string(),
|
||||
abi: "eabi".into(),
|
||||
features: "+strict-align,+v6".into(),
|
||||
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()
|
||||
},
|
||||
}
|
||||
|
@ -2,15 +2,15 @@ use crate::spec::{Target, TargetOptions};
|
||||
|
||||
pub fn target() -> Target {
|
||||
Target {
|
||||
llvm_target: "arm-unknown-linux-gnueabihf".to_string(),
|
||||
llvm_target: "arm-unknown-linux-gnueabihf".into(),
|
||||
pointer_width: 32,
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
|
||||
arch: "arm".to_string(),
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
|
||||
arch: "arm".into(),
|
||||
options: TargetOptions {
|
||||
abi: "eabihf".to_string(),
|
||||
features: "+strict-align,+v6,+vfp2,-d32".to_string(),
|
||||
abi: "eabihf".into(),
|
||||
features: "+strict-align,+v6,+vfp2,-d32".into(),
|
||||
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()
|
||||
},
|
||||
}
|
||||
|
@ -5,17 +5,17 @@ pub fn target() -> Target {
|
||||
// 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
|
||||
// support the "musleabi" value.
|
||||
llvm_target: "arm-unknown-linux-gnueabi".to_string(),
|
||||
llvm_target: "arm-unknown-linux-gnueabi".into(),
|
||||
pointer_width: 32,
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
|
||||
arch: "arm".to_string(),
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
|
||||
arch: "arm".into(),
|
||||
options: TargetOptions {
|
||||
abi: "eabi".to_string(),
|
||||
abi: "eabi".into(),
|
||||
// Most of these settings are copied from the arm_unknown_linux_gnueabi
|
||||
// target.
|
||||
features: "+strict-align,+v6".to_string(),
|
||||
features: "+strict-align,+v6".into(),
|
||||
max_atomic_width: Some(64),
|
||||
mcount: "\u{1}mcount".to_string(),
|
||||
mcount: "\u{1}mcount".into(),
|
||||
..super::linux_musl_base::opts()
|
||||
},
|
||||
}
|
||||
|
@ -5,17 +5,17 @@ pub fn target() -> Target {
|
||||
// It's important we use "gnueabihf" and not "musleabihf" here. LLVM
|
||||
// uses it to determine the calling convention and float ABI, and it
|
||||
// doesn't support the "musleabihf" value.
|
||||
llvm_target: "arm-unknown-linux-gnueabihf".to_string(),
|
||||
llvm_target: "arm-unknown-linux-gnueabihf".into(),
|
||||
pointer_width: 32,
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
|
||||
arch: "arm".to_string(),
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
|
||||
arch: "arm".into(),
|
||||
options: TargetOptions {
|
||||
abi: "eabihf".to_string(),
|
||||
abi: "eabihf".into(),
|
||||
// Most of these settings are copied from the arm_unknown_linux_gnueabihf
|
||||
// target.
|
||||
features: "+strict-align,+v6,+vfp2,-d32".to_string(),
|
||||
features: "+strict-align,+v6,+vfp2,-d32".into(),
|
||||
max_atomic_width: Some(64),
|
||||
mcount: "\u{1}mcount".to_string(),
|
||||
mcount: "\u{1}mcount".into(),
|
||||
..super::linux_musl_base::opts()
|
||||
},
|
||||
}
|
||||
|
@ -6,16 +6,16 @@ use crate::spec::{Target, TargetOptions};
|
||||
|
||||
pub fn target() -> Target {
|
||||
Target {
|
||||
llvm_target: "armebv7r-unknown-none-eabi".to_string(),
|
||||
llvm_target: "armebv7r-unknown-none-eabi".into(),
|
||||
pointer_width: 32,
|
||||
data_layout: "E-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
|
||||
arch: "arm".to_string(),
|
||||
data_layout: "E-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
|
||||
arch: "arm".into(),
|
||||
options: TargetOptions {
|
||||
abi: "eabi".to_string(),
|
||||
abi: "eabi".into(),
|
||||
endian: Endian::Big,
|
||||
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
|
||||
executables: true,
|
||||
linker: Some("rust-lld".to_owned()),
|
||||
linker: Some("rust-lld".into()),
|
||||
relocation_model: RelocModel::Static,
|
||||
panic_strategy: PanicStrategy::Abort,
|
||||
max_atomic_width: Some(32),
|
||||
|
@ -6,19 +6,19 @@ use crate::spec::{Target, TargetOptions};
|
||||
|
||||
pub fn target() -> Target {
|
||||
Target {
|
||||
llvm_target: "armebv7r-unknown-none-eabihf".to_string(),
|
||||
llvm_target: "armebv7r-unknown-none-eabihf".into(),
|
||||
pointer_width: 32,
|
||||
data_layout: "E-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
|
||||
arch: "arm".to_string(),
|
||||
data_layout: "E-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
|
||||
arch: "arm".into(),
|
||||
options: TargetOptions {
|
||||
abi: "eabihf".to_string(),
|
||||
abi: "eabihf".into(),
|
||||
endian: Endian::Big,
|
||||
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
|
||||
executables: true,
|
||||
linker: Some("rust-lld".to_owned()),
|
||||
linker: Some("rust-lld".into()),
|
||||
relocation_model: RelocModel::Static,
|
||||
panic_strategy: PanicStrategy::Abort,
|
||||
features: "+vfp3,-d32,-fp16".to_string(),
|
||||
features: "+vfp3,-d32,-fp16".into(),
|
||||
max_atomic_width: Some(32),
|
||||
emit_debug_gdb_scripts: false,
|
||||
// GCC and Clang default to 8 for arm-none here
|
||||
|
@ -2,16 +2,16 @@ use crate::spec::{Target, TargetOptions};
|
||||
|
||||
pub fn target() -> Target {
|
||||
Target {
|
||||
llvm_target: "armv4t-unknown-linux-gnueabi".to_string(),
|
||||
llvm_target: "armv4t-unknown-linux-gnueabi".into(),
|
||||
pointer_width: 32,
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
|
||||
arch: "arm".to_string(),
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
|
||||
arch: "arm".into(),
|
||||
options: TargetOptions {
|
||||
abi: "eabi".to_string(),
|
||||
features: "+soft-float,+strict-align".to_string(),
|
||||
abi: "eabi".into(),
|
||||
features: "+soft-float,+strict-align".into(),
|
||||
// Atomic operations provided by compiler-builtins
|
||||
max_atomic_width: Some(32),
|
||||
mcount: "\u{1}__gnu_mcount_nc".to_string(),
|
||||
mcount: "\u{1}__gnu_mcount_nc".into(),
|
||||
has_thumb_interworking: true,
|
||||
..super::linux_gnu_base::opts()
|
||||
},
|
||||
|
@ -2,16 +2,16 @@ use crate::spec::{Target, TargetOptions};
|
||||
|
||||
pub fn target() -> Target {
|
||||
Target {
|
||||
llvm_target: "armv5te-unknown-linux-gnueabi".to_string(),
|
||||
llvm_target: "armv5te-unknown-linux-gnueabi".into(),
|
||||
pointer_width: 32,
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
|
||||
arch: "arm".to_string(),
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
|
||||
arch: "arm".into(),
|
||||
options: TargetOptions {
|
||||
abi: "eabi".to_string(),
|
||||
features: "+soft-float,+strict-align".to_string(),
|
||||
abi: "eabi".into(),
|
||||
features: "+soft-float,+strict-align".into(),
|
||||
// Atomic operations provided by compiler-builtins
|
||||
max_atomic_width: Some(32),
|
||||
mcount: "\u{1}__gnu_mcount_nc".to_string(),
|
||||
mcount: "\u{1}__gnu_mcount_nc".into(),
|
||||
has_thumb_interworking: true,
|
||||
..super::linux_gnu_base::opts()
|
||||
},
|
||||
|
@ -6,16 +6,16 @@ pub fn target() -> Target {
|
||||
// It's important we use "gnueabihf" and not "musleabihf" here. LLVM
|
||||
// uses it to determine the calling convention and float ABI, and LLVM
|
||||
// doesn't support the "musleabihf" value.
|
||||
llvm_target: "armv5te-unknown-linux-gnueabi".to_string(),
|
||||
llvm_target: "armv5te-unknown-linux-gnueabi".into(),
|
||||
pointer_width: 32,
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
|
||||
arch: "arm".to_string(),
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
|
||||
arch: "arm".into(),
|
||||
options: TargetOptions {
|
||||
abi: "eabi".to_string(),
|
||||
features: "+soft-float,+strict-align".to_string(),
|
||||
abi: "eabi".into(),
|
||||
features: "+soft-float,+strict-align".into(),
|
||||
// Atomic operations provided by compiler-builtins
|
||||
max_atomic_width: Some(32),
|
||||
mcount: "\u{1}mcount".to_string(),
|
||||
mcount: "\u{1}mcount".into(),
|
||||
has_thumb_interworking: true,
|
||||
..super::linux_musl_base::opts()
|
||||
},
|
||||
|
@ -2,16 +2,16 @@ use crate::spec::{Target, TargetOptions};
|
||||
|
||||
pub fn target() -> Target {
|
||||
Target {
|
||||
llvm_target: "armv5te-unknown-linux-uclibcgnueabi".to_string(),
|
||||
llvm_target: "armv5te-unknown-linux-uclibcgnueabi".into(),
|
||||
pointer_width: 32,
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
|
||||
arch: "arm".to_string(),
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
|
||||
arch: "arm".into(),
|
||||
options: TargetOptions {
|
||||
abi: "eabi".to_string(),
|
||||
features: "+soft-float,+strict-align".to_string(),
|
||||
abi: "eabi".into(),
|
||||
features: "+soft-float,+strict-align".into(),
|
||||
// Atomic operations provided by compiler-builtins
|
||||
max_atomic_width: Some(32),
|
||||
mcount: "\u{1}__gnu_mcount_nc".to_string(),
|
||||
mcount: "\u{1}__gnu_mcount_nc".into(),
|
||||
has_thumb_interworking: true,
|
||||
..super::linux_uclibc_base::opts()
|
||||
},
|
||||
|
@ -2,17 +2,17 @@ use crate::spec::{Target, TargetOptions};
|
||||
|
||||
pub fn target() -> Target {
|
||||
Target {
|
||||
llvm_target: "armv6-unknown-freebsd-gnueabihf".to_string(),
|
||||
llvm_target: "armv6-unknown-freebsd-gnueabihf".into(),
|
||||
pointer_width: 32,
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
|
||||
arch: "arm".to_string(),
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
|
||||
arch: "arm".into(),
|
||||
options: TargetOptions {
|
||||
abi: "eabihf".to_string(),
|
||||
abi: "eabihf".into(),
|
||||
// FIXME: change env to "gnu" when cfg_target_abi becomes stable
|
||||
env: "gnueabihf".to_string(),
|
||||
features: "+v6,+vfp2,-d32".to_string(),
|
||||
env: "gnueabihf".into(),
|
||||
features: "+v6,+vfp2,-d32".into(),
|
||||
max_atomic_width: Some(64),
|
||||
mcount: "\u{1}__gnu_mcount_nc".to_string(),
|
||||
mcount: "\u{1}__gnu_mcount_nc".into(),
|
||||
..super::freebsd_base::opts()
|
||||
},
|
||||
}
|
||||
|
@ -2,17 +2,17 @@ use crate::spec::{Target, TargetOptions};
|
||||
|
||||
pub fn target() -> Target {
|
||||
Target {
|
||||
llvm_target: "armv6-unknown-netbsdelf-eabihf".to_string(),
|
||||
llvm_target: "armv6-unknown-netbsdelf-eabihf".into(),
|
||||
pointer_width: 32,
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
|
||||
arch: "arm".to_string(),
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
|
||||
arch: "arm".into(),
|
||||
options: TargetOptions {
|
||||
abi: "eabihf".to_string(),
|
||||
abi: "eabihf".into(),
|
||||
// FIXME: remove env when cfg_target_abi becomes stable
|
||||
env: "eabihf".to_string(),
|
||||
features: "+v6,+vfp2,-d32".to_string(),
|
||||
env: "eabihf".into(),
|
||||
features: "+v6,+vfp2,-d32".into(),
|
||||
max_atomic_width: Some(64),
|
||||
mcount: "__mcount".to_string(),
|
||||
mcount: "__mcount".into(),
|
||||
..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.
|
||||
///
|
||||
@ -9,33 +9,33 @@ pub fn target() -> Target {
|
||||
pre_link_args.insert(
|
||||
LinkerFlavor::Gcc,
|
||||
vec![
|
||||
"-specs=3dsx.specs".to_string(),
|
||||
"-mtune=mpcore".to_string(),
|
||||
"-mfloat-abi=hard".to_string(),
|
||||
"-mtp=soft".to_string(),
|
||||
"-specs=3dsx.specs".into(),
|
||||
"-mtune=mpcore".into(),
|
||||
"-mfloat-abi=hard".into(),
|
||||
"-mtp=soft".into(),
|
||||
],
|
||||
);
|
||||
|
||||
Target {
|
||||
llvm_target: "armv6k-none-eabihf".to_string(),
|
||||
llvm_target: "armv6k-none-eabihf".into(),
|
||||
pointer_width: 32,
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
|
||||
arch: "arm".to_string(),
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
|
||||
arch: "arm".into(),
|
||||
|
||||
options: TargetOptions {
|
||||
os: "horizon".to_string(),
|
||||
env: "newlib".to_string(),
|
||||
vendor: "nintendo".to_string(),
|
||||
abi: "eabihf".to_string(),
|
||||
os: "horizon".into(),
|
||||
env: "newlib".into(),
|
||||
vendor: "nintendo".into(),
|
||||
abi: "eabihf".into(),
|
||||
linker_flavor: LinkerFlavor::Gcc,
|
||||
cpu: "mpcore".to_string(),
|
||||
cpu: "mpcore".into(),
|
||||
executables: true,
|
||||
families: vec!["unix".to_string()],
|
||||
linker: Some("arm-none-eabi-gcc".to_string()),
|
||||
families: cvs!["unix"],
|
||||
linker: Some("arm-none-eabi-gcc".into()),
|
||||
relocation_model: RelocModel::Static,
|
||||
features: "+vfp2".to_string(),
|
||||
features: "+vfp2".into(),
|
||||
pre_link_args,
|
||||
exe_suffix: ".elf".to_string(),
|
||||
exe_suffix: ".elf".into(),
|
||||
no_default_libraries: false,
|
||||
has_thread_local: true,
|
||||
..Default::default()
|
||||
|
@ -2,13 +2,15 @@ use super::apple_sdk_base::{opts, Arch};
|
||||
use crate::spec::{Target, TargetOptions};
|
||||
|
||||
pub fn target() -> Target {
|
||||
let llvm_target = super::apple_base::ios_llvm_target("armv7");
|
||||
|
||||
Target {
|
||||
llvm_target: super::apple_base::ios_llvm_target("armv7"),
|
||||
llvm_target: llvm_target.into(),
|
||||
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(),
|
||||
arch: "arm".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".into(),
|
||||
options: TargetOptions {
|
||||
features: "+v7,+vfp3,+neon".to_string(),
|
||||
features: "+v7,+vfp3,+neon".into(),
|
||||
max_atomic_width: Some(64),
|
||||
..opts("ios", Arch::Armv7)
|
||||
},
|
||||
|
@ -10,15 +10,15 @@ use crate::spec::{LinkerFlavor, SanitizerSet, Target, TargetOptions};
|
||||
|
||||
pub fn target() -> Target {
|
||||
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 {
|
||||
llvm_target: "armv7-none-linux-android".to_string(),
|
||||
llvm_target: "armv7-none-linux-android".into(),
|
||||
pointer_width: 32,
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
|
||||
arch: "arm".to_string(),
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
|
||||
arch: "arm".into(),
|
||||
options: TargetOptions {
|
||||
abi: "eabi".to_string(),
|
||||
features: "+v7,+thumb-mode,+thumb2,+vfp3,-d32,-neon".to_string(),
|
||||
abi: "eabi".into(),
|
||||
features: "+v7,+thumb-mode,+thumb2,+vfp3,-d32,-neon".into(),
|
||||
supported_sanitizers: SanitizerSet::ADDRESS,
|
||||
max_atomic_width: Some(64),
|
||||
..base
|
||||
|
@ -2,17 +2,17 @@ use crate::spec::{Target, TargetOptions};
|
||||
|
||||
pub fn target() -> Target {
|
||||
Target {
|
||||
llvm_target: "armv7-unknown-freebsd-gnueabihf".to_string(),
|
||||
llvm_target: "armv7-unknown-freebsd-gnueabihf".into(),
|
||||
pointer_width: 32,
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
|
||||
arch: "arm".to_string(),
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
|
||||
arch: "arm".into(),
|
||||
options: TargetOptions {
|
||||
abi: "eabihf".to_string(),
|
||||
abi: "eabihf".into(),
|
||||
// FIXME: change env to "gnu" when cfg_target_abi becomes stable
|
||||
env: "gnueabihf".to_string(),
|
||||
features: "+v7,+vfp3,-d32,+thumb2,-neon".to_string(),
|
||||
env: "gnueabihf".into(),
|
||||
features: "+v7,+vfp3,-d32,+thumb2,-neon".into(),
|
||||
max_atomic_width: Some(64),
|
||||
mcount: "\u{1}__gnu_mcount_nc".to_string(),
|
||||
mcount: "\u{1}__gnu_mcount_nc".into(),
|
||||
..super::freebsd_base::opts()
|
||||
},
|
||||
}
|
||||
|
@ -5,15 +5,15 @@ use crate::spec::{Target, TargetOptions};
|
||||
|
||||
pub fn target() -> Target {
|
||||
Target {
|
||||
llvm_target: "armv7-unknown-linux-gnueabi".to_string(),
|
||||
llvm_target: "armv7-unknown-linux-gnueabi".into(),
|
||||
pointer_width: 32,
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
|
||||
arch: "arm".to_string(),
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
|
||||
arch: "arm".into(),
|
||||
options: TargetOptions {
|
||||
abi: "eabi".to_string(),
|
||||
features: "+v7,+thumb2,+soft-float,-neon".to_string(),
|
||||
abi: "eabi".into(),
|
||||
features: "+v7,+thumb2,+soft-float,-neon".into(),
|
||||
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()
|
||||
},
|
||||
}
|
||||
|
@ -5,16 +5,16 @@ use crate::spec::{Target, TargetOptions};
|
||||
|
||||
pub fn target() -> Target {
|
||||
Target {
|
||||
llvm_target: "armv7-unknown-linux-gnueabihf".to_string(),
|
||||
llvm_target: "armv7-unknown-linux-gnueabihf".into(),
|
||||
pointer_width: 32,
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
|
||||
arch: "arm".to_string(),
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
|
||||
arch: "arm".into(),
|
||||
options: TargetOptions {
|
||||
abi: "eabihf".to_string(),
|
||||
abi: "eabihf".into(),
|
||||
// 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),
|
||||
mcount: "\u{1}__gnu_mcount_nc".to_string(),
|
||||
mcount: "\u{1}__gnu_mcount_nc".into(),
|
||||
..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
|
||||
// to determine the calling convention and float ABI, and it doesn't
|
||||
// support the "musleabi" value.
|
||||
llvm_target: "armv7-unknown-linux-gnueabi".to_string(),
|
||||
llvm_target: "armv7-unknown-linux-gnueabi".into(),
|
||||
pointer_width: 32,
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
|
||||
arch: "arm".to_string(),
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
|
||||
arch: "arm".into(),
|
||||
|
||||
options: TargetOptions {
|
||||
abi: "eabi".to_string(),
|
||||
features: "+v7,+thumb2,+soft-float,-neon".to_string(),
|
||||
abi: "eabi".into(),
|
||||
features: "+v7,+thumb2,+soft-float,-neon".into(),
|
||||
max_atomic_width: Some(64),
|
||||
mcount: "\u{1}mcount".to_string(),
|
||||
mcount: "\u{1}mcount".into(),
|
||||
..super::linux_musl_base::opts()
|
||||
},
|
||||
}
|
||||
|
@ -7,18 +7,18 @@ pub fn target() -> Target {
|
||||
// It's important we use "gnueabihf" and not "musleabihf" here. LLVM
|
||||
// uses it to determine the calling convention and float ABI, and LLVM
|
||||
// doesn't support the "musleabihf" value.
|
||||
llvm_target: "armv7-unknown-linux-gnueabihf".to_string(),
|
||||
llvm_target: "armv7-unknown-linux-gnueabihf".into(),
|
||||
pointer_width: 32,
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
|
||||
arch: "arm".to_string(),
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
|
||||
arch: "arm".into(),
|
||||
|
||||
// Most of these settings are copied from the armv7_unknown_linux_gnueabihf
|
||||
// target.
|
||||
options: TargetOptions {
|
||||
abi: "eabihf".to_string(),
|
||||
features: "+v7,+vfp3,-d32,+thumb2,-neon".to_string(),
|
||||
abi: "eabihf".into(),
|
||||
features: "+v7,+vfp3,-d32,+thumb2,-neon".into(),
|
||||
max_atomic_width: Some(64),
|
||||
mcount: "\u{1}mcount".to_string(),
|
||||
mcount: "\u{1}mcount".into(),
|
||||
..super::linux_musl_base::opts()
|
||||
},
|
||||
}
|
||||
|
@ -6,17 +6,17 @@ use crate::spec::{Target, TargetOptions};
|
||||
pub fn target() -> Target {
|
||||
let base = super::linux_uclibc_base::opts();
|
||||
Target {
|
||||
llvm_target: "armv7-unknown-linux-gnueabi".to_string(),
|
||||
llvm_target: "armv7-unknown-linux-gnueabi".into(),
|
||||
pointer_width: 32,
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
|
||||
arch: "arm".to_string(),
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
|
||||
arch: "arm".into(),
|
||||
|
||||
options: TargetOptions {
|
||||
features: "+v7,+thumb2,+soft-float,-neon".to_string(),
|
||||
cpu: "generic".to_string(),
|
||||
features: "+v7,+thumb2,+soft-float,-neon".into(),
|
||||
cpu: "generic".into(),
|
||||
max_atomic_width: Some(64),
|
||||
mcount: "_mcount".to_string(),
|
||||
abi: "eabi".to_string(),
|
||||
mcount: "_mcount".into(),
|
||||
abi: "eabi".into(),
|
||||
..base
|
||||
},
|
||||
}
|
||||
|
@ -6,18 +6,18 @@ use crate::spec::{Target, TargetOptions};
|
||||
pub fn target() -> Target {
|
||||
let base = super::linux_uclibc_base::opts();
|
||||
Target {
|
||||
llvm_target: "armv7-unknown-linux-gnueabihf".to_string(),
|
||||
llvm_target: "armv7-unknown-linux-gnueabihf".into(),
|
||||
pointer_width: 32,
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
|
||||
arch: "arm".to_string(),
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
|
||||
arch: "arm".into(),
|
||||
|
||||
options: TargetOptions {
|
||||
// Info about features at https://wiki.debian.org/ArmHardFloatPort
|
||||
features: "+v7,+vfp3,-d32,+thumb2,-neon".to_string(),
|
||||
cpu: "generic".to_string(),
|
||||
features: "+v7,+vfp3,-d32,+thumb2,-neon".into(),
|
||||
cpu: "generic".into(),
|
||||
max_atomic_width: Some(64),
|
||||
mcount: "_mcount".to_string(),
|
||||
abi: "eabihf".to_string(),
|
||||
mcount: "_mcount".into(),
|
||||
abi: "eabihf".into(),
|
||||
..base
|
||||
},
|
||||
}
|
||||
|
@ -2,17 +2,17 @@ use crate::spec::{Target, TargetOptions};
|
||||
|
||||
pub fn target() -> Target {
|
||||
Target {
|
||||
llvm_target: "armv7-unknown-netbsdelf-eabihf".to_string(),
|
||||
llvm_target: "armv7-unknown-netbsdelf-eabihf".into(),
|
||||
pointer_width: 32,
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
|
||||
arch: "arm".to_string(),
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
|
||||
arch: "arm".into(),
|
||||
options: TargetOptions {
|
||||
abi: "eabihf".to_string(),
|
||||
abi: "eabihf".into(),
|
||||
// FIXME: remove env when cfg_target_abi becomes stable
|
||||
env: "eabihf".to_string(),
|
||||
features: "+v7,+vfp3,-d32,+thumb2,-neon".to_string(),
|
||||
env: "eabihf".into(),
|
||||
features: "+v7,+vfp3,-d32,+thumb2,-neon".into(),
|
||||
max_atomic_width: Some(64),
|
||||
mcount: "__mcount".to_string(),
|
||||
mcount: "__mcount".into(),
|
||||
..super::netbsd_base::opts()
|
||||
},
|
||||
}
|
||||
|
@ -2,14 +2,14 @@ use crate::spec::{Target, TargetOptions};
|
||||
|
||||
pub fn target() -> Target {
|
||||
Target {
|
||||
llvm_target: "armv7-unknown-linux-gnueabihf".to_string(),
|
||||
llvm_target: "armv7-unknown-linux-gnueabihf".into(),
|
||||
pointer_width: 32,
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
|
||||
arch: "arm".to_string(),
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
|
||||
arch: "arm".into(),
|
||||
options: TargetOptions {
|
||||
abi: "eabihf".to_string(),
|
||||
abi: "eabihf".into(),
|
||||
// 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),
|
||||
..super::vxworks_base::opts()
|
||||
},
|
||||
|
@ -3,13 +3,13 @@ use super::{RelocModel, Target, TargetOptions};
|
||||
pub fn target() -> Target {
|
||||
let base = super::solid_base::opts("asp3");
|
||||
Target {
|
||||
llvm_target: "armv7a-none-eabi".to_string(),
|
||||
llvm_target: "armv7a-none-eabi".into(),
|
||||
pointer_width: 32,
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
|
||||
arch: "arm".to_string(),
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
|
||||
arch: "arm".into(),
|
||||
options: TargetOptions {
|
||||
linker: Some("arm-kmc-eabi-gcc".to_owned()),
|
||||
features: "+v7,+soft-float,+thumb2,-neon".to_string(),
|
||||
linker: Some("arm-kmc-eabi-gcc".into()),
|
||||
features: "+v7,+soft-float,+thumb2,-neon".into(),
|
||||
relocation_model: RelocModel::Static,
|
||||
disable_redzone: true,
|
||||
max_atomic_width: Some(64),
|
||||
|
@ -3,13 +3,13 @@ use super::{RelocModel, Target, TargetOptions};
|
||||
pub fn target() -> Target {
|
||||
let base = super::solid_base::opts("asp3");
|
||||
Target {
|
||||
llvm_target: "armv7a-none-eabihf".to_string(),
|
||||
llvm_target: "armv7a-none-eabihf".into(),
|
||||
pointer_width: 32,
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
|
||||
arch: "arm".to_string(),
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
|
||||
arch: "arm".into(),
|
||||
options: TargetOptions {
|
||||
linker: Some("arm-kmc-eabi-gcc".to_owned()),
|
||||
features: "+v7,+vfp3,-d32,+thumb2,-neon".to_string(),
|
||||
linker: Some("arm-kmc-eabi-gcc".into()),
|
||||
features: "+v7,+vfp3,-d32,+thumb2,-neon".into(),
|
||||
relocation_model: RelocModel::Static,
|
||||
disable_redzone: true,
|
||||
max_atomic_width: Some(64),
|
||||
|
@ -18,10 +18,10 @@ use super::{LinkerFlavor, LldFlavor, PanicStrategy, RelocModel, Target, TargetOp
|
||||
|
||||
pub fn target() -> Target {
|
||||
let opts = TargetOptions {
|
||||
abi: "eabi".to_string(),
|
||||
abi: "eabi".into(),
|
||||
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
|
||||
linker: Some("rust-lld".to_owned()),
|
||||
features: "+v7,+thumb2,+soft-float,-neon,+strict-align".to_string(),
|
||||
linker: Some("rust-lld".into()),
|
||||
features: "+v7,+thumb2,+soft-float,-neon,+strict-align".into(),
|
||||
executables: true,
|
||||
relocation_model: RelocModel::Static,
|
||||
disable_redzone: true,
|
||||
@ -32,10 +32,10 @@ pub fn target() -> Target {
|
||||
..Default::default()
|
||||
};
|
||||
Target {
|
||||
llvm_target: "armv7a-none-eabi".to_string(),
|
||||
llvm_target: "armv7a-none-eabi".into(),
|
||||
pointer_width: 32,
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
|
||||
arch: "arm".to_string(),
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
|
||||
arch: "arm".into(),
|
||||
options: opts,
|
||||
}
|
||||
}
|
||||
|
@ -9,10 +9,10 @@ use super::{LinkerFlavor, LldFlavor, PanicStrategy, RelocModel, Target, TargetOp
|
||||
|
||||
pub fn target() -> Target {
|
||||
let opts = TargetOptions {
|
||||
abi: "eabihf".to_string(),
|
||||
abi: "eabihf".into(),
|
||||
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
|
||||
linker: Some("rust-lld".to_owned()),
|
||||
features: "+v7,+vfp3,-d32,+thumb2,-neon,+strict-align".to_string(),
|
||||
linker: Some("rust-lld".into()),
|
||||
features: "+v7,+vfp3,-d32,+thumb2,-neon,+strict-align".into(),
|
||||
executables: true,
|
||||
relocation_model: RelocModel::Static,
|
||||
disable_redzone: true,
|
||||
@ -24,10 +24,10 @@ pub fn target() -> Target {
|
||||
..Default::default()
|
||||
};
|
||||
Target {
|
||||
llvm_target: "armv7a-none-eabihf".to_string(),
|
||||
llvm_target: "armv7a-none-eabihf".into(),
|
||||
pointer_width: 32,
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
|
||||
arch: "arm".to_string(),
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
|
||||
arch: "arm".into(),
|
||||
options: opts,
|
||||
}
|
||||
}
|
||||
|
@ -5,16 +5,16 @@ use crate::spec::{Target, TargetOptions};
|
||||
|
||||
pub fn target() -> Target {
|
||||
Target {
|
||||
llvm_target: "armv7r-unknown-none-eabi".to_string(),
|
||||
llvm_target: "armv7r-unknown-none-eabi".into(),
|
||||
pointer_width: 32,
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
|
||||
arch: "arm".to_string(),
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
|
||||
arch: "arm".into(),
|
||||
|
||||
options: TargetOptions {
|
||||
abi: "eabi".to_string(),
|
||||
abi: "eabi".into(),
|
||||
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
|
||||
executables: true,
|
||||
linker: Some("rust-lld".to_owned()),
|
||||
linker: Some("rust-lld".into()),
|
||||
relocation_model: RelocModel::Static,
|
||||
panic_strategy: PanicStrategy::Abort,
|
||||
max_atomic_width: Some(32),
|
||||
|
@ -5,19 +5,19 @@ use crate::spec::{Target, TargetOptions};
|
||||
|
||||
pub fn target() -> Target {
|
||||
Target {
|
||||
llvm_target: "armv7r-unknown-none-eabihf".to_string(),
|
||||
llvm_target: "armv7r-unknown-none-eabihf".into(),
|
||||
pointer_width: 32,
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
|
||||
arch: "arm".to_string(),
|
||||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
|
||||
arch: "arm".into(),
|
||||
|
||||
options: TargetOptions {
|
||||
abi: "eabihf".to_string(),
|
||||
abi: "eabihf".into(),
|
||||
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
|
||||
executables: true,
|
||||
linker: Some("rust-lld".to_owned()),
|
||||
linker: Some("rust-lld".into()),
|
||||
relocation_model: RelocModel::Static,
|
||||
panic_strategy: PanicStrategy::Abort,
|
||||
features: "+vfp3,-d32,-fp16".to_string(),
|
||||
features: "+vfp3,-d32,-fp16".into(),
|
||||
max_atomic_width: Some(32),
|
||||
emit_debug_gdb_scripts: false,
|
||||
// GCC and Clang default to 8 for arm-none here
|
||||
|
@ -3,12 +3,12 @@ use crate::spec::{Target, TargetOptions};
|
||||
|
||||
pub fn target() -> Target {
|
||||
Target {
|
||||
llvm_target: "armv7s-apple-ios".to_string(),
|
||||
llvm_target: "armv7s-apple-ios".into(),
|
||||
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(),
|
||||
arch: "arm".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".into(),
|
||||
options: TargetOptions {
|
||||
features: "+v7,+vfp4,+neon".to_string(),
|
||||
features: "+v7,+vfp4,+neon".into(),
|
||||
max_atomic_width: Some(64),
|
||||
..opts("ios", Arch::Armv7s)
|
||||
},
|
||||
|
@ -6,6 +6,6 @@ pub fn target() -> Target {
|
||||
.post_link_args
|
||||
.entry(LinkerFlavor::Em)
|
||||
.or_default()
|
||||
.extend(vec!["-s".to_string(), "WASM=0".to_string()]);
|
||||
.extend(vec!["-s".into(), "WASM=0".into()]);
|
||||
target
|
||||
}
|
||||
|
@ -3,24 +3,24 @@ use crate::spec::{LinkerFlavor, Target, TargetOptions};
|
||||
/// A base target for AVR devices using the GNU toolchain.
|
||||
///
|
||||
/// 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 {
|
||||
arch: "avr".to_string(),
|
||||
data_layout: "e-P1-p:16:8-i8:8-i16:8-i32:8-i64:8-f32:8-f64:8-n8-a:8".to_string(),
|
||||
llvm_target: "avr-unknown-unknown".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".into(),
|
||||
llvm_target: "avr-unknown-unknown".into(),
|
||||
pointer_width: 16,
|
||||
options: TargetOptions {
|
||||
c_int_width: "16".to_string(),
|
||||
cpu: target_cpu.clone(),
|
||||
exe_suffix: ".elf".to_string(),
|
||||
c_int_width: "16".into(),
|
||||
cpu: target_cpu.into(),
|
||||
exe_suffix: ".elf".into(),
|
||||
|
||||
linker: Some("avr-gcc".to_owned()),
|
||||
linker: Some("avr-gcc".into()),
|
||||
executables: true,
|
||||
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()
|
||||
.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),
|
||||
atomic_cas: false,
|
||||
..TargetOptions::default()
|
||||
|
@ -1,5 +1,5 @@
|
||||
use crate::spec::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 {
|
||||
Target {
|
||||
llvm_target: "bpfeb".to_string(),
|
||||
data_layout: "E-m:e-p:64:64-i64:64-i128:128-n32:64-S128".to_string(),
|
||||
llvm_target: "bpfeb".into(),
|
||||
data_layout: "E-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
|
||||
pointer_width: 64,
|
||||
arch: "bpf".to_string(),
|
||||
arch: "bpf".into(),
|
||||
options: bpf_base::opts(Endian::Big),
|
||||
}
|
||||
}
|
||||
|
@ -3,10 +3,10 @@ use crate::{abi::Endian, spec::bpf_base};
|
||||
|
||||
pub fn target() -> Target {
|
||||
Target {
|
||||
llvm_target: "bpfel".to_string(),
|
||||
data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".to_string(),
|
||||
llvm_target: "bpfel".into(),
|
||||
data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
|
||||
pointer_width: 64,
|
||||
arch: "bpf".to_string(),
|
||||
arch: "bpf".into(),
|
||||
options: bpf_base::opts(Endian::Little),
|
||||
}
|
||||
}
|
||||
|
@ -42,16 +42,17 @@
|
||||
|
||||
use crate::spec::LinkOutputKind;
|
||||
use rustc_serialize::json::{Json, ToJson};
|
||||
use std::borrow::Cow;
|
||||
use std::collections::BTreeMap;
|
||||
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 {
|
||||
obj_table.iter().map(|(z, k)| (*z, k.iter().map(|b| b.to_string()).collect())).collect()
|
||||
pub(super) fn new(obj_table: &[(LinkOutputKind, &[&'static str])]) -> CrtObjects {
|
||||
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(&[
|
||||
(LinkOutputKind::DynamicNoPicExe, &[obj]),
|
||||
(LinkOutputKind::DynamicPicExe, &[obj]),
|
||||
|
@ -1,11 +1,11 @@
|
||||
use crate::spec::{RelroLevel, TargetOptions};
|
||||
use crate::spec::{cvs, RelroLevel, TargetOptions};
|
||||
|
||||
pub fn opts() -> TargetOptions {
|
||||
TargetOptions {
|
||||
os: "dragonfly".to_string(),
|
||||
os: "dragonfly".into(),
|
||||
dynamic_linking: true,
|
||||
executables: true,
|
||||
families: vec!["unix".to_string()],
|
||||
families: cvs!["unix"],
|
||||
has_rpath: true,
|
||||
position_independent_executables: true,
|
||||
relro_level: RelroLevel::Full,
|
||||
|
@ -1,11 +1,11 @@
|
||||
use crate::spec::{RelroLevel, TargetOptions};
|
||||
use crate::spec::{cvs, RelroLevel, TargetOptions};
|
||||
|
||||
pub fn opts() -> TargetOptions {
|
||||
TargetOptions {
|
||||
os: "freebsd".to_string(),
|
||||
os: "freebsd".into(),
|
||||
dynamic_linking: true,
|
||||
executables: true,
|
||||
families: vec!["unix".to_string()],
|
||||
families: cvs!["unix"],
|
||||
has_rpath: true,
|
||||
position_independent_executables: true,
|
||||
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 {
|
||||
let mut pre_link_args = LinkArgs::new();
|
||||
pre_link_args.insert(
|
||||
LinkerFlavor::Lld(LldFlavor::Ld),
|
||||
vec![
|
||||
"--build-id".to_string(),
|
||||
"--hash-style=gnu".to_string(),
|
||||
"-z".to_string(),
|
||||
"max-page-size=4096".to_string(),
|
||||
"-z".to_string(),
|
||||
"now".to_string(),
|
||||
"-z".to_string(),
|
||||
"rodynamic".to_string(),
|
||||
"-z".to_string(),
|
||||
"separate-loadable-segments".to_string(),
|
||||
"--pack-dyn-relocs=relr".to_string(),
|
||||
"--build-id".into(),
|
||||
"--hash-style=gnu".into(),
|
||||
"-z".into(),
|
||||
"max-page-size=4096".into(),
|
||||
"-z".into(),
|
||||
"now".into(),
|
||||
"-z".into(),
|
||||
"rodynamic".into(),
|
||||
"-z".into(),
|
||||
"separate-loadable-segments".into(),
|
||||
"--pack-dyn-relocs=relr".into(),
|
||||
],
|
||||
);
|
||||
|
||||
TargetOptions {
|
||||
os: "fuchsia".to_string(),
|
||||
os: "fuchsia".into(),
|
||||
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
|
||||
linker: Some("rust-lld".to_owned()),
|
||||
linker: Some("rust-lld".into()),
|
||||
dynamic_linking: true,
|
||||
executables: true,
|
||||
families: vec!["unix".to_string()],
|
||||
families: cvs!["unix"],
|
||||
is_like_fuchsia: true,
|
||||
pre_link_args,
|
||||
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 {
|
||||
TargetOptions {
|
||||
os: "haiku".to_string(),
|
||||
os: "haiku".into(),
|
||||
dynamic_linking: true,
|
||||
executables: true,
|
||||
families: vec!["unix".to_string()],
|
||||
families: cvs!["unix"],
|
||||
relro_level: RelroLevel::Full,
|
||||
..Default::default()
|
||||
}
|
||||
|
@ -4,13 +4,13 @@ pub fn opts() -> TargetOptions {
|
||||
let mut pre_link_args = LinkArgs::new();
|
||||
pre_link_args.insert(
|
||||
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 {
|
||||
os: "hermit".to_string(),
|
||||
os: "hermit".into(),
|
||||
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
|
||||
linker: Some("rust-lld".to_owned()),
|
||||
linker: Some("rust-lld".into()),
|
||||
executables: true,
|
||||
has_thread_local: true,
|
||||
pre_link_args,
|
||||
|
@ -2,10 +2,10 @@ use crate::spec::Target;
|
||||
|
||||
pub fn target() -> Target {
|
||||
let mut base = super::linux_musl_base::opts();
|
||||
base.cpu = "hexagonv60".to_string();
|
||||
base.cpu = "hexagonv60".into();
|
||||
base.max_atomic_width = Some(32);
|
||||
// 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.has_rpath = true;
|
||||
@ -16,7 +16,7 @@ pub fn target() -> Target {
|
||||
base.c_enum_min_bits = 8;
|
||||
|
||||
Target {
|
||||
llvm_target: "hexagon-unknown-linux-musl".to_string(),
|
||||
llvm_target: "hexagon-unknown-linux-musl".into(),
|
||||
pointer_width: 32,
|
||||
data_layout: concat!(
|
||||
"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",
|
||||
":2048:2048"
|
||||
)
|
||||
.to_string(),
|
||||
arch: "hexagon".to_string(),
|
||||
.into(),
|
||||
arch: "hexagon".into(),
|
||||
options: base,
|
||||
}
|
||||
}
|
||||
|
@ -3,13 +3,15 @@ use crate::spec::{StackProbeType, Target, TargetOptions};
|
||||
|
||||
pub fn target() -> Target {
|
||||
let base = opts("ios", Arch::I386);
|
||||
let llvm_target = super::apple_base::ios_sim_llvm_target("i386");
|
||||
|
||||
Target {
|
||||
llvm_target: super::apple_base::ios_sim_llvm_target("i386"),
|
||||
llvm_target: llvm_target.into(),
|
||||
pointer_width: 32,
|
||||
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"
|
||||
.to_string(),
|
||||
arch: "x86".to_string(),
|
||||
.into(),
|
||||
arch: "x86".into(),
|
||||
options: TargetOptions {
|
||||
max_atomic_width: Some(64),
|
||||
// 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 {
|
||||
let mut base = super::i686_unknown_linux_gnu::target();
|
||||
base.cpu = "i386".to_string();
|
||||
base.llvm_target = "i386-unknown-linux-gnu".to_string();
|
||||
base.cpu = "i386".into();
|
||||
base.llvm_target = "i386-unknown-linux-gnu".into();
|
||||
base
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ use crate::spec::Target;
|
||||
|
||||
pub fn target() -> Target {
|
||||
let mut base = super::i686_unknown_linux_gnu::target();
|
||||
base.cpu = "i486".to_string();
|
||||
base.llvm_target = "i486-unknown-linux-gnu".to_string();
|
||||
base.cpu = "i486".into();
|
||||
base.llvm_target = "i486-unknown-linux-gnu".into();
|
||||
base
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ use crate::spec::Target;
|
||||
|
||||
pub fn target() -> Target {
|
||||
let mut base = super::i686_pc_windows_msvc::target();
|
||||
base.cpu = "pentium".to_string();
|
||||
base.llvm_target = "i586-pc-windows-msvc".to_string();
|
||||
base.cpu = "pentium".into();
|
||||
base.llvm_target = "i586-pc-windows-msvc".into();
|
||||
base
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ use crate::spec::Target;
|
||||
|
||||
pub fn target() -> Target {
|
||||
let mut base = super::i686_unknown_linux_gnu::target();
|
||||
base.cpu = "pentium".to_string();
|
||||
base.llvm_target = "i586-unknown-linux-gnu".to_string();
|
||||
base.cpu = "pentium".into();
|
||||
base.llvm_target = "i586-unknown-linux-gnu".into();
|
||||
base
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ use crate::spec::Target;
|
||||
|
||||
pub fn target() -> Target {
|
||||
let mut base = super::i686_unknown_linux_musl::target();
|
||||
base.cpu = "pentium".to_string();
|
||||
base.llvm_target = "i586-unknown-linux-musl".to_string();
|
||||
base.cpu = "pentium".into();
|
||||
base.llvm_target = "i586-unknown-linux-musl".into();
|
||||
base
|
||||
}
|
||||
|
@ -2,10 +2,10 @@ use crate::spec::{FramePointer, LinkerFlavor, StackProbeType, Target, TargetOpti
|
||||
|
||||
pub fn target() -> Target {
|
||||
let mut base = super::apple_base::opts("macos");
|
||||
base.cpu = "yonah".to_string();
|
||||
base.cpu = "yonah".into();
|
||||
base.max_atomic_width = Some(64);
|
||||
base.pre_link_args.insert(LinkerFlavor::Gcc, vec!["-m32".to_string()]);
|
||||
base.link_env_remove.extend(super::apple_base::macos_link_env_remove());
|
||||
base.pre_link_args.insert(LinkerFlavor::Gcc, vec!["-m32".into()]);
|
||||
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
|
||||
base.stack_probes = StackProbeType::Call;
|
||||
base.frame_pointer = FramePointer::Always;
|
||||
@ -17,12 +17,12 @@ pub fn target() -> Target {
|
||||
let llvm_target = super::apple_base::macos_llvm_target(&arch);
|
||||
|
||||
Target {
|
||||
llvm_target,
|
||||
llvm_target: llvm_target.into(),
|
||||
pointer_width: 32,
|
||||
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"
|
||||
.to_string(),
|
||||
arch: "x86".to_string(),
|
||||
options: TargetOptions { mcount: "\u{1}mcount".to_string(), ..base },
|
||||
.into(),
|
||||
arch: "x86".into(),
|
||||
options: TargetOptions { mcount: "\u{1}mcount".into(), ..base },
|
||||
}
|
||||
}
|
||||
|
@ -9,18 +9,18 @@ pub fn target() -> Target {
|
||||
base.max_atomic_width = Some(64);
|
||||
|
||||
// https://developer.android.com/ndk/guides/abis.html#x86
|
||||
base.cpu = "pentiumpro".to_string();
|
||||
base.features = "+mmx,+sse,+sse2,+sse3,+ssse3".to_string();
|
||||
base.cpu = "pentiumpro".into();
|
||||
base.features = "+mmx,+sse,+sse2,+sse3,+ssse3".into();
|
||||
// don't use probe-stack=inline-asm until rust#83139 and rust#84667 are resolved
|
||||
base.stack_probes = StackProbeType::Call;
|
||||
|
||||
Target {
|
||||
llvm_target: "i686-linux-android".to_string(),
|
||||
llvm_target: "i686-linux-android".into(),
|
||||
pointer_width: 32,
|
||||
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"
|
||||
.to_string(),
|
||||
arch: "x86".to_string(),
|
||||
.into(),
|
||||
arch: "x86".into(),
|
||||
options: TargetOptions { supported_sanitizers: SanitizerSet::ADDRESS, ..base },
|
||||
}
|
||||
}
|
||||
|
@ -2,27 +2,26 @@ use crate::spec::{FramePointer, LinkerFlavor, LldFlavor, Target};
|
||||
|
||||
pub fn target() -> Target {
|
||||
let mut base = super::windows_gnu_base::opts();
|
||||
base.cpu = "pentium4".to_string();
|
||||
base.pre_link_args
|
||||
.insert(LinkerFlavor::Lld(LldFlavor::Ld), vec!["-m".to_string(), "i386pe".to_string()]);
|
||||
base.cpu = "pentium4".into();
|
||||
base.pre_link_args.insert(LinkerFlavor::Lld(LldFlavor::Ld), vec!["-m".into(), "i386pe".into()]);
|
||||
base.max_atomic_width = Some(64);
|
||||
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
|
||||
// space available to x86 Windows binaries on x86_64.
|
||||
base.pre_link_args
|
||||
.entry(LinkerFlavor::Gcc)
|
||||
.or_default()
|
||||
.push("-Wl,--large-address-aware".to_string());
|
||||
.push("-Wl,--large-address-aware".into());
|
||||
|
||||
Target {
|
||||
llvm_target: "i686-pc-windows-gnu".to_string(),
|
||||
llvm_target: "i686-pc-windows-gnu".into(),
|
||||
pointer_width: 32,
|
||||
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"
|
||||
.to_string(),
|
||||
arch: "x86".to_string(),
|
||||
.into(),
|
||||
arch: "x86".into(),
|
||||
options: base,
|
||||
}
|
||||
}
|
||||
|
@ -2,17 +2,17 @@ use crate::spec::{LinkerFlavor, LldFlavor, Target};
|
||||
|
||||
pub fn target() -> Target {
|
||||
let mut base = super::windows_msvc_base::opts();
|
||||
base.cpu = "pentium4".to_string();
|
||||
base.cpu = "pentium4".into();
|
||||
base.max_atomic_width = Some(64);
|
||||
|
||||
let pre_link_args_msvc = vec![
|
||||
// Mark all dynamic libraries and executables as compatible with the larger 4GiB address
|
||||
// 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
|
||||
// the image's 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
|
||||
@ -23,12 +23,12 @@ pub fn target() -> Target {
|
||||
base.has_thread_local = false;
|
||||
|
||||
Target {
|
||||
llvm_target: "i686-pc-windows-msvc".to_string(),
|
||||
llvm_target: "i686-pc-windows-msvc".into(),
|
||||
pointer_width: 32,
|
||||
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"
|
||||
.to_string(),
|
||||
arch: "x86".to_string(),
|
||||
.into(),
|
||||
arch: "x86".into(),
|
||||
options: base,
|
||||
}
|
||||
}
|
||||
|
@ -2,21 +2,21 @@ use crate::spec::{LinkerFlavor, StackProbeType, Target};
|
||||
|
||||
pub fn target() -> Target {
|
||||
let mut base = super::freebsd_base::opts();
|
||||
base.cpu = "pentium4".to_string();
|
||||
base.cpu = "pentium4".into();
|
||||
base.max_atomic_width = Some(64);
|
||||
let pre_link_args = base.pre_link_args.entry(LinkerFlavor::Gcc).or_default();
|
||||
pre_link_args.push("-m32".to_string());
|
||||
pre_link_args.push("-Wl,-znotext".to_string());
|
||||
pre_link_args.push("-m32".into());
|
||||
pre_link_args.push("-Wl,-znotext".into());
|
||||
// don't use probe-stack=inline-asm until rust#83139 and rust#84667 are resolved
|
||||
base.stack_probes = StackProbeType::Call;
|
||||
|
||||
Target {
|
||||
llvm_target: "i686-unknown-freebsd".to_string(),
|
||||
llvm_target: "i686-unknown-freebsd".into(),
|
||||
pointer_width: 32,
|
||||
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"
|
||||
.to_string(),
|
||||
arch: "x86".to_string(),
|
||||
.into(),
|
||||
arch: "x86".into(),
|
||||
options: base,
|
||||
}
|
||||
}
|
||||
|
@ -2,19 +2,19 @@ use crate::spec::{LinkerFlavor, StackProbeType, Target};
|
||||
|
||||
pub fn target() -> Target {
|
||||
let mut base = super::haiku_base::opts();
|
||||
base.cpu = "pentium4".to_string();
|
||||
base.cpu = "pentium4".into();
|
||||
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
|
||||
base.stack_probes = StackProbeType::Call;
|
||||
|
||||
Target {
|
||||
llvm_target: "i686-unknown-haiku".to_string(),
|
||||
llvm_target: "i686-unknown-haiku".into(),
|
||||
pointer_width: 32,
|
||||
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"
|
||||
.to_string(),
|
||||
arch: "x86".to_string(),
|
||||
.into(),
|
||||
arch: "x86".into(),
|
||||
options: base,
|
||||
}
|
||||
}
|
||||
|
@ -2,19 +2,19 @@ use crate::spec::{LinkerFlavor, StackProbeType, Target};
|
||||
|
||||
pub fn target() -> Target {
|
||||
let mut base = super::linux_gnu_base::opts();
|
||||
base.cpu = "pentium4".to_string();
|
||||
base.cpu = "pentium4".into();
|
||||
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
|
||||
base.stack_probes = StackProbeType::Call;
|
||||
|
||||
Target {
|
||||
llvm_target: "i686-unknown-linux-gnu".to_string(),
|
||||
llvm_target: "i686-unknown-linux-gnu".into(),
|
||||
pointer_width: 32,
|
||||
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"
|
||||
.to_string(),
|
||||
arch: "x86".to_string(),
|
||||
.into(),
|
||||
arch: "x86".into(),
|
||||
options: base,
|
||||
}
|
||||
}
|
||||
|
@ -2,10 +2,10 @@ use crate::spec::{FramePointer, LinkerFlavor, StackProbeType, Target};
|
||||
|
||||
pub fn target() -> Target {
|
||||
let mut base = super::linux_musl_base::opts();
|
||||
base.cpu = "pentium4".to_string();
|
||||
base.cpu = "pentium4".into();
|
||||
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("-Wl,-melf_i386".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".into());
|
||||
// don't use probe-stack=inline-asm until rust#83139 and rust#84667 are resolved
|
||||
base.stack_probes = StackProbeType::Call;
|
||||
|
||||
@ -24,12 +24,12 @@ pub fn target() -> Target {
|
||||
base.frame_pointer = FramePointer::Always;
|
||||
|
||||
Target {
|
||||
llvm_target: "i686-unknown-linux-musl".to_string(),
|
||||
llvm_target: "i686-unknown-linux-musl".into(),
|
||||
pointer_width: 32,
|
||||
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"
|
||||
.to_string(),
|
||||
arch: "x86".to_string(),
|
||||
.into(),
|
||||
arch: "x86".into(),
|
||||
options: base,
|
||||
}
|
||||
}
|
||||
|
@ -2,19 +2,19 @@ use crate::spec::{LinkerFlavor, StackProbeType, Target, TargetOptions};
|
||||
|
||||
pub fn target() -> Target {
|
||||
let mut base = super::netbsd_base::opts();
|
||||
base.cpu = "pentium4".to_string();
|
||||
base.cpu = "pentium4".into();
|
||||
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
|
||||
base.stack_probes = StackProbeType::Call;
|
||||
|
||||
Target {
|
||||
llvm_target: "i686-unknown-netbsdelf".to_string(),
|
||||
llvm_target: "i686-unknown-netbsdelf".into(),
|
||||
pointer_width: 32,
|
||||
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"
|
||||
.to_string(),
|
||||
arch: "x86".to_string(),
|
||||
options: TargetOptions { mcount: "__mcount".to_string(), ..base },
|
||||
.into(),
|
||||
arch: "x86".into(),
|
||||
options: TargetOptions { mcount: "__mcount".into(), ..base },
|
||||
}
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user