mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
enum-ify llvm_abiname
This commit is contained in:
@@ -233,7 +233,7 @@ pub(crate) fn target_machine_factory(
|
||||
let triple = SmallCStr::new(&versioned_llvm_target(sess));
|
||||
let cpu = SmallCStr::new(llvm_util::target_cpu(sess));
|
||||
let features = CString::new(target_features.join(",")).unwrap();
|
||||
let abi = SmallCStr::new(&sess.target.llvm_abiname);
|
||||
let abi = SmallCStr::new(sess.target.llvm_abiname.desc());
|
||||
let trap_unreachable =
|
||||
sess.opts.unstable_opts.trap_unreachable.unwrap_or(sess.target.trap_unreachable);
|
||||
let emit_stack_size_section = sess.opts.unstable_opts.emit_stack_sizes;
|
||||
|
||||
@@ -509,14 +509,13 @@ pub(crate) unsafe fn create_module<'ll>(
|
||||
// to workaround lld as the LTO plugin not
|
||||
// correctly setting target-abi for the LTO object
|
||||
// FIXME: https://github.com/llvm/llvm-project/issues/50591
|
||||
// If llvm_abiname is empty, emit nothing.
|
||||
let llvm_abiname = &sess.target.options.llvm_abiname;
|
||||
if matches!(sess.target.arch, Arch::RiscV32 | Arch::RiscV64) && !llvm_abiname.is_empty() {
|
||||
if matches!(sess.target.arch, Arch::RiscV32 | Arch::RiscV64) {
|
||||
llvm::add_module_flag_str(
|
||||
llmod,
|
||||
llvm::ModuleFlagMergeBehavior::Error,
|
||||
"target-abi",
|
||||
llvm_abiname,
|
||||
llvm_abiname.desc(),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
use rustc_middle::bug;
|
||||
use rustc_middle::ty::Ty;
|
||||
use rustc_middle::ty::layout::{HasTyCtxt, LayoutOf, TyAndLayout};
|
||||
use rustc_target::spec::{Arch, Env, RustcAbi};
|
||||
use rustc_target::spec::{Arch, Env, LlvmAbi, RustcAbi};
|
||||
|
||||
use crate::builder::Builder;
|
||||
use crate::llvm::{Type, Value};
|
||||
@@ -1077,7 +1077,7 @@ pub(super) fn emit_va_arg<'ll, 'tcx>(
|
||||
AllowHigherAlign::Yes,
|
||||
ForceRightAdjust::Yes,
|
||||
),
|
||||
Arch::RiscV32 if target.llvm_abiname == "ilp32e" => {
|
||||
Arch::RiscV32 if target.llvm_abiname == LlvmAbi::Ilp32e => {
|
||||
// FIXME: clang manually adjusts the alignment for this ABI. It notes:
|
||||
//
|
||||
// > To be compatible with GCC's behaviors, we force arguments with
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
use rustc_middle::bug;
|
||||
use rustc_session::Session;
|
||||
use rustc_span::sym;
|
||||
use rustc_target::spec::{CfgAbi, Os, RelocModel, Target, ef_avr_arch};
|
||||
use rustc_target::spec::{CfgAbi, LlvmAbi, Os, RelocModel, Target, ef_avr_arch};
|
||||
use tracing::debug;
|
||||
|
||||
use super::apple;
|
||||
@@ -295,10 +295,10 @@ pub(super) fn elf_e_flags(architecture: Architecture, sess: &Session) -> u32 {
|
||||
};
|
||||
|
||||
// Use the explicitly given ABI.
|
||||
match sess.target.options.llvm_abiname.as_ref() {
|
||||
"o32" if is_32bit => e_flags |= elf::EF_MIPS_ABI_O32,
|
||||
"n32" if !is_32bit => e_flags |= elf::EF_MIPS_ABI2,
|
||||
"n64" if !is_32bit => {}
|
||||
match &sess.target.options.llvm_abiname {
|
||||
LlvmAbi::O32 if is_32bit => e_flags |= elf::EF_MIPS_ABI_O32,
|
||||
LlvmAbi::N32 if !is_32bit => e_flags |= elf::EF_MIPS_ABI2,
|
||||
LlvmAbi::N64 if !is_32bit => {}
|
||||
// The rest is invalid (which is already ensured by the target spec check).
|
||||
s => bug!("invalid LLVM ABI `{}` for MIPS target", s),
|
||||
};
|
||||
@@ -336,12 +336,12 @@ pub(super) fn elf_e_flags(architecture: Architecture, sess: &Session) -> u32 {
|
||||
|
||||
// Set the appropriate flag based on ABI
|
||||
// This needs to match LLVM `RISCVELFStreamer.cpp`
|
||||
match &*sess.target.llvm_abiname {
|
||||
"ilp32" | "lp64" => (),
|
||||
"ilp32f" | "lp64f" => e_flags |= elf::EF_RISCV_FLOAT_ABI_SINGLE,
|
||||
"ilp32d" | "lp64d" => e_flags |= elf::EF_RISCV_FLOAT_ABI_DOUBLE,
|
||||
match &sess.target.llvm_abiname {
|
||||
LlvmAbi::Ilp32 | LlvmAbi::Lp64 => (),
|
||||
LlvmAbi::Ilp32f | LlvmAbi::Lp64f => e_flags |= elf::EF_RISCV_FLOAT_ABI_SINGLE,
|
||||
LlvmAbi::Ilp32d | LlvmAbi::Lp64d => e_flags |= elf::EF_RISCV_FLOAT_ABI_DOUBLE,
|
||||
// Note that the `lp64e` is still unstable as it's not (yet) part of the ELF psABI.
|
||||
"ilp32e" | "lp64e" => e_flags |= elf::EF_RISCV_RVE,
|
||||
LlvmAbi::Ilp32e | LlvmAbi::Lp64e => e_flags |= elf::EF_RISCV_RVE,
|
||||
_ => bug!("unknown RISC-V ABI name"),
|
||||
}
|
||||
|
||||
@@ -353,10 +353,10 @@ pub(super) fn elf_e_flags(architecture: Architecture, sess: &Session) -> u32 {
|
||||
|
||||
// Set the appropriate flag based on ABI
|
||||
// This needs to match LLVM `LoongArchELFStreamer.cpp`
|
||||
match &*sess.target.llvm_abiname {
|
||||
"ilp32s" | "lp64s" => e_flags |= elf::EF_LARCH_ABI_SOFT_FLOAT,
|
||||
"ilp32f" | "lp64f" => e_flags |= elf::EF_LARCH_ABI_SINGLE_FLOAT,
|
||||
"ilp32d" | "lp64d" => e_flags |= elf::EF_LARCH_ABI_DOUBLE_FLOAT,
|
||||
match &sess.target.llvm_abiname {
|
||||
LlvmAbi::Ilp32s | LlvmAbi::Lp64s => e_flags |= elf::EF_LARCH_ABI_SOFT_FLOAT,
|
||||
LlvmAbi::Ilp32f | LlvmAbi::Lp64f => e_flags |= elf::EF_LARCH_ABI_SINGLE_FLOAT,
|
||||
LlvmAbi::Ilp32d | LlvmAbi::Lp64d => e_flags |= elf::EF_LARCH_ABI_DOUBLE_FLOAT,
|
||||
_ => bug!("unknown LoongArch ABI name"),
|
||||
}
|
||||
|
||||
@@ -383,14 +383,14 @@ pub(super) fn elf_e_flags(architecture: Architecture, sess: &Session) -> u32 {
|
||||
const EF_PPC64_ABI_ELF_V1: u32 = 1;
|
||||
const EF_PPC64_ABI_ELF_V2: u32 = 2;
|
||||
|
||||
match sess.target.options.llvm_abiname.as_ref() {
|
||||
match sess.target.options.llvm_abiname {
|
||||
// If the flags do not correctly indicate the ABI,
|
||||
// linkers such as ld.lld assume that the ppc64 object files are always ELFv2
|
||||
// which leads to broken binaries if ELFv1 is used for the object files.
|
||||
"elfv1" => EF_PPC64_ABI_ELF_V1,
|
||||
"elfv2" => EF_PPC64_ABI_ELF_V2,
|
||||
"" if sess.target.options.binary_format.to_object() == BinaryFormat::Elf => {
|
||||
bug!("No ABI specified for this PPC64 ELF target");
|
||||
LlvmAbi::ElfV1 => EF_PPC64_ABI_ELF_V1,
|
||||
LlvmAbi::ElfV2 => EF_PPC64_ABI_ELF_V2,
|
||||
_ if sess.target.options.binary_format.to_object() == BinaryFormat::Elf => {
|
||||
bug!("invalid ABI specified for this PPC64 ELF target");
|
||||
}
|
||||
// Fall back
|
||||
_ => EF_PPC64_ABI_UNKNOWN,
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
};
|
||||
|
||||
use crate::callconv::{ArgAbi, ArgExtension, CastTarget, FnAbi, PassMode, Uniform};
|
||||
use crate::spec::HasTargetSpec;
|
||||
use crate::spec::{HasTargetSpec, LlvmAbi};
|
||||
|
||||
#[derive(Copy, Clone)]
|
||||
enum RegPassKind {
|
||||
@@ -415,9 +415,9 @@ pub(crate) fn compute_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>)
|
||||
C: HasDataLayout + HasTargetSpec,
|
||||
{
|
||||
let xlen = cx.data_layout().pointer_size().bits();
|
||||
let flen = match &cx.target_spec().llvm_abiname[..] {
|
||||
"ilp32f" | "lp64f" => 32,
|
||||
"ilp32d" | "lp64d" => 64,
|
||||
let flen = match &cx.target_spec().llvm_abiname {
|
||||
LlvmAbi::Ilp32f | LlvmAbi::Lp64f => 32,
|
||||
LlvmAbi::Ilp32d | LlvmAbi::Lp64d => 64,
|
||||
_ => 0,
|
||||
};
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
use rustc_abi::{Endian, HasDataLayout, TyAbiInterface};
|
||||
|
||||
use crate::callconv::{Align, ArgAbi, FnAbi, Reg, RegKind, Uniform};
|
||||
use crate::spec::{HasTargetSpec, Os};
|
||||
use crate::spec::{HasTargetSpec, LlvmAbi, Os};
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||
enum ABI {
|
||||
@@ -106,9 +106,9 @@ pub(crate) fn compute_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>)
|
||||
Ty: TyAbiInterface<'a, C> + Copy,
|
||||
C: HasDataLayout + HasTargetSpec,
|
||||
{
|
||||
let abi = if cx.target_spec().options.llvm_abiname == "elfv2" {
|
||||
let abi = if cx.target_spec().options.llvm_abiname == LlvmAbi::ElfV2 {
|
||||
ELFv2
|
||||
} else if cx.target_spec().options.llvm_abiname == "elfv1" {
|
||||
} else if cx.target_spec().options.llvm_abiname == LlvmAbi::ElfV1 {
|
||||
ELFv1
|
||||
} else if cx.target_spec().os == Os::Aix {
|
||||
AIX
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
};
|
||||
|
||||
use crate::callconv::{ArgAbi, ArgExtension, CastTarget, FnAbi, PassMode, Uniform};
|
||||
use crate::spec::HasTargetSpec;
|
||||
use crate::spec::{HasTargetSpec, LlvmAbi};
|
||||
|
||||
#[derive(Copy, Clone)]
|
||||
enum RegPassKind {
|
||||
@@ -419,9 +419,9 @@ pub(crate) fn compute_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>)
|
||||
Ty: TyAbiInterface<'a, C> + Copy,
|
||||
C: HasDataLayout + HasTargetSpec,
|
||||
{
|
||||
let flen = match &cx.target_spec().llvm_abiname[..] {
|
||||
"ilp32f" | "lp64f" => 32,
|
||||
"ilp32d" | "lp64d" => 64,
|
||||
let flen = match &cx.target_spec().llvm_abiname {
|
||||
LlvmAbi::Ilp32f | LlvmAbi::Lp64f => 32,
|
||||
LlvmAbi::Ilp32d | LlvmAbi::Lp64d => 64,
|
||||
_ => 0,
|
||||
};
|
||||
let xlen = cx.data_layout().pointer_size().bits();
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
TargetKind, TargetOptions, TargetWarnings, TlsModel,
|
||||
};
|
||||
use crate::json::{Json, ToJson};
|
||||
use crate::spec::AbiMap;
|
||||
use crate::spec::{AbiMap, LlvmAbi};
|
||||
|
||||
impl Target {
|
||||
/// Loads a target descriptor from a JSON object.
|
||||
@@ -611,7 +611,7 @@ struct TargetSpecJson {
|
||||
#[serde(rename = "target-mcount")]
|
||||
mcount: Option<StaticCow<str>>,
|
||||
llvm_mcount_intrinsic: Option<StaticCow<str>>,
|
||||
llvm_abiname: Option<StaticCow<str>>,
|
||||
llvm_abiname: Option<LlvmAbi>,
|
||||
llvm_floatabi: Option<FloatAbi>,
|
||||
rustc_abi: Option<RustcAbi>,
|
||||
relax_elf_relocations: Option<bool>,
|
||||
|
||||
@@ -2099,6 +2099,34 @@ pub fn desc_symbol(&self) -> Symbol {
|
||||
}
|
||||
}
|
||||
|
||||
crate::target_spec_enum! {
|
||||
/// An enum representing possible values for the `llvm_abiname` field of [`TargetOptions`].
|
||||
/// This field is used by LLVM on some targets to control which ABI to use.
|
||||
pub enum LlvmAbi {
|
||||
// RISC-V and LoongArch
|
||||
Ilp32 = "ilp32",
|
||||
Ilp32f = "ilp32f",
|
||||
Ilp32d = "ilp32d",
|
||||
Ilp32e = "ilp32e",
|
||||
Ilp32s = "ilp32s",
|
||||
Lp64 = "lp64",
|
||||
Lp64f = "lp64f",
|
||||
Lp64d = "lp64d",
|
||||
Lp64e = "lp64e",
|
||||
Lp64s = "lp64s",
|
||||
// MIPS
|
||||
O32 = "o32",
|
||||
N32 = "n32",
|
||||
N64 = "n64",
|
||||
// PowerPC
|
||||
ElfV1 = "elfv1",
|
||||
ElfV2 = "elfv2",
|
||||
|
||||
Unspecified = "",
|
||||
}
|
||||
other_variant = Other;
|
||||
}
|
||||
|
||||
/// Everything `rustc` knows about how to compile for a specific target.
|
||||
///
|
||||
/// Every field here must be specified, and has no default value.
|
||||
@@ -2545,7 +2573,7 @@ pub struct TargetOptions {
|
||||
|
||||
/// LLVM ABI name, corresponds to the '-mabi' parameter available in multilib C compilers
|
||||
/// and the `-target-abi` flag in llc. In the LLVM API this is `MCOptions.ABIName`.
|
||||
pub llvm_abiname: StaticCow<str>,
|
||||
pub llvm_abiname: LlvmAbi,
|
||||
|
||||
/// Control the float ABI to use, for architectures that support it. The only architecture we
|
||||
/// currently use this for is ARM. Corresponds to the `-float-abi` flag in llc. In the LLVM API
|
||||
@@ -2842,7 +2870,7 @@ fn default() -> TargetOptions {
|
||||
merge_functions: MergeFunctions::Aliases,
|
||||
mcount: "mcount".into(),
|
||||
llvm_mcount_intrinsic: None,
|
||||
llvm_abiname: "".into(),
|
||||
llvm_abiname: LlvmAbi::Unspecified,
|
||||
llvm_floatabi: None,
|
||||
rustc_abi: None,
|
||||
relax_elf_relocations: false,
|
||||
@@ -3195,7 +3223,10 @@ macro_rules! check_matches {
|
||||
// new cases.
|
||||
match self.arch {
|
||||
Arch::X86 => {
|
||||
check!(self.llvm_abiname.is_empty(), "`llvm_abiname` is unused on x86-32");
|
||||
check!(
|
||||
self.llvm_abiname == LlvmAbi::Unspecified,
|
||||
"`llvm_abiname` is unused on x86-32"
|
||||
);
|
||||
check!(self.llvm_floatabi.is_none(), "`llvm_floatabi` is unused on x86-32");
|
||||
check_matches!(
|
||||
(&self.rustc_abi, &self.cfg_abi),
|
||||
@@ -3220,7 +3251,10 @@ macro_rules! check_matches {
|
||||
);
|
||||
}
|
||||
Arch::X86_64 => {
|
||||
check!(self.llvm_abiname.is_empty(), "`llvm_abiname` is unused on x86-64");
|
||||
check!(
|
||||
self.llvm_abiname == LlvmAbi::Unspecified,
|
||||
"`llvm_abiname` is unused on x86-64"
|
||||
);
|
||||
check!(self.llvm_floatabi.is_none(), "`llvm_floatabi` is unused on x86-64");
|
||||
// FIXME: we do not currently set a target_abi for softfloat targets here, but we
|
||||
// probably should, so we already allow it.
|
||||
@@ -3253,11 +3287,11 @@ macro_rules! check_matches {
|
||||
check!(self.llvm_floatabi.is_none(), "`llvm_floatabi` is unused on RISC-V");
|
||||
check!(self.rustc_abi.is_none(), "`rustc_abi` is unused on RISC-V");
|
||||
check_matches!(
|
||||
(&*self.llvm_abiname, &self.cfg_abi),
|
||||
("ilp32", CfgAbi::Unspecified | CfgAbi::Other(_))
|
||||
| ("ilp32f", CfgAbi::Unspecified | CfgAbi::Other(_))
|
||||
| ("ilp32d", CfgAbi::Unspecified | CfgAbi::Other(_))
|
||||
| ("ilp32e", CfgAbi::Ilp32e),
|
||||
(&self.llvm_abiname, &self.cfg_abi),
|
||||
(LlvmAbi::Ilp32, CfgAbi::Unspecified | CfgAbi::Other(_))
|
||||
| (LlvmAbi::Ilp32f, CfgAbi::Unspecified | CfgAbi::Other(_))
|
||||
| (LlvmAbi::Ilp32d, CfgAbi::Unspecified | CfgAbi::Other(_))
|
||||
| (LlvmAbi::Ilp32e, CfgAbi::Ilp32e),
|
||||
"invalid RISC-V ABI name and `cfg(target_abi)` combination:\n\
|
||||
ABI name: {}\n\
|
||||
cfg(target_abi): {}",
|
||||
@@ -3270,11 +3304,11 @@ macro_rules! check_matches {
|
||||
check!(self.llvm_floatabi.is_none(), "`llvm_floatabi` is unused on RISC-V");
|
||||
check!(self.rustc_abi.is_none(), "`rustc_abi` is unused on RISC-V");
|
||||
check_matches!(
|
||||
(&*self.llvm_abiname, &self.cfg_abi),
|
||||
("lp64", CfgAbi::Unspecified | CfgAbi::Other(_))
|
||||
| ("lp64f", CfgAbi::Unspecified | CfgAbi::Other(_))
|
||||
| ("lp64d", CfgAbi::Unspecified | CfgAbi::Other(_))
|
||||
| ("lp64e", CfgAbi::Unspecified | CfgAbi::Other(_)),
|
||||
(&self.llvm_abiname, &self.cfg_abi),
|
||||
(LlvmAbi::Lp64, CfgAbi::Unspecified | CfgAbi::Other(_))
|
||||
| (LlvmAbi::Lp64f, CfgAbi::Unspecified | CfgAbi::Other(_))
|
||||
| (LlvmAbi::Lp64d, CfgAbi::Unspecified | CfgAbi::Other(_))
|
||||
| (LlvmAbi::Lp64e, CfgAbi::Unspecified | CfgAbi::Other(_)),
|
||||
"invalid RISC-V ABI name and `cfg(target_abi)` combination:\n\
|
||||
ABI name: {}\n\
|
||||
cfg(target_abi): {}",
|
||||
@@ -3283,7 +3317,10 @@ macro_rules! check_matches {
|
||||
);
|
||||
}
|
||||
Arch::Arm => {
|
||||
check!(self.llvm_abiname.is_empty(), "`llvm_abiname` is unused on ARM");
|
||||
check!(
|
||||
self.llvm_abiname == LlvmAbi::Unspecified,
|
||||
"`llvm_abiname` is unused on ARM"
|
||||
);
|
||||
check!(self.rustc_abi.is_none(), "`rustc_abi` is unused on ARM");
|
||||
check_matches!(
|
||||
(&self.llvm_floatabi, &self.cfg_abi),
|
||||
@@ -3299,7 +3336,10 @@ macro_rules! check_matches {
|
||||
)
|
||||
}
|
||||
Arch::AArch64 => {
|
||||
check!(self.llvm_abiname.is_empty(), "`llvm_abiname` is unused on aarch64");
|
||||
check!(
|
||||
self.llvm_abiname == LlvmAbi::Unspecified,
|
||||
"`llvm_abiname` is unused on aarch64"
|
||||
);
|
||||
check!(self.llvm_floatabi.is_none(), "`llvm_floatabi` is unused on aarch64");
|
||||
// FIXME: Ensure that target_abi = "ilp32" correlates with actually using that ABI.
|
||||
// Do any of the others need a similar check?
|
||||
@@ -3324,7 +3364,10 @@ macro_rules! check_matches {
|
||||
);
|
||||
}
|
||||
Arch::PowerPC => {
|
||||
check!(self.llvm_abiname.is_empty(), "`llvm_abiname` is unused on PowerPC");
|
||||
check!(
|
||||
self.llvm_abiname == LlvmAbi::Unspecified,
|
||||
"`llvm_abiname` is unused on PowerPC"
|
||||
);
|
||||
check!(self.llvm_floatabi.is_none(), "`llvm_floatabi` is unused on PowerPC");
|
||||
check!(self.rustc_abi.is_none(), "`rustc_abi` is unused on PowerPC");
|
||||
// FIXME: Check that `target_abi` matches the actually configured ABI (with or
|
||||
@@ -3343,8 +3386,8 @@ macro_rules! check_matches {
|
||||
// FIXME: Check that `target_abi` matches the actually configured ABI
|
||||
// (vec-default vs vec-ext).
|
||||
check_matches!(
|
||||
(&*self.llvm_abiname, &self.cfg_abi),
|
||||
("", CfgAbi::VecDefault | CfgAbi::VecExtAbi),
|
||||
(&self.llvm_abiname, &self.cfg_abi),
|
||||
(LlvmAbi::Unspecified, CfgAbi::VecDefault | CfgAbi::VecExtAbi),
|
||||
"invalid PowerPC64 AIX ABI name and `cfg(target_abi)` combination:\n\
|
||||
ABI name: {}\n\
|
||||
cfg(target_abi): {}",
|
||||
@@ -3353,8 +3396,8 @@ macro_rules! check_matches {
|
||||
);
|
||||
} else if self.endian == Endian::Big {
|
||||
check_matches!(
|
||||
(&*self.llvm_abiname, &self.cfg_abi),
|
||||
("elfv1", CfgAbi::ElfV1) | ("elfv2", CfgAbi::ElfV2),
|
||||
(&self.llvm_abiname, &self.cfg_abi),
|
||||
(LlvmAbi::ElfV1, CfgAbi::ElfV1) | (LlvmAbi::ElfV2, CfgAbi::ElfV2),
|
||||
"invalid PowerPC64 big-endian ABI name and `cfg(target_abi)` combination:\n\
|
||||
ABI name: {}\n\
|
||||
cfg(target_abi): {}",
|
||||
@@ -3363,8 +3406,8 @@ macro_rules! check_matches {
|
||||
);
|
||||
} else {
|
||||
check_matches!(
|
||||
(&*self.llvm_abiname, &self.cfg_abi),
|
||||
("elfv2", CfgAbi::ElfV2),
|
||||
(&self.llvm_abiname, &self.cfg_abi),
|
||||
(LlvmAbi::ElfV2, CfgAbi::ElfV2),
|
||||
"invalid PowerPC64 little-endian ABI name and `cfg(target_abi)` combination:\n\
|
||||
ABI name: {}\n\
|
||||
cfg(target_abi): {}",
|
||||
@@ -3374,7 +3417,10 @@ macro_rules! check_matches {
|
||||
}
|
||||
}
|
||||
Arch::S390x => {
|
||||
check!(self.llvm_abiname.is_empty(), "`llvm_abiname` is unused on s390x");
|
||||
check!(
|
||||
self.llvm_abiname == LlvmAbi::Unspecified,
|
||||
"`llvm_abiname` is unused on s390x"
|
||||
);
|
||||
check!(self.llvm_floatabi.is_none(), "`llvm_floatabi` is unused on s390x");
|
||||
check_matches!(
|
||||
(&self.rustc_abi, &self.cfg_abi),
|
||||
@@ -3391,10 +3437,10 @@ macro_rules! check_matches {
|
||||
check!(self.llvm_floatabi.is_none(), "`llvm_floatabi` is unused on LoongArch");
|
||||
check!(self.rustc_abi.is_none(), "`rustc_abi` is unused on LoongArch");
|
||||
check_matches!(
|
||||
(&*self.llvm_abiname, &self.cfg_abi),
|
||||
("ilp32s", CfgAbi::SoftFloat)
|
||||
| ("ilp32f", CfgAbi::Unspecified | CfgAbi::Other(_))
|
||||
| ("ilp32d", CfgAbi::Unspecified | CfgAbi::Other(_)),
|
||||
(&self.llvm_abiname, &self.cfg_abi),
|
||||
(LlvmAbi::Ilp32s, CfgAbi::SoftFloat)
|
||||
| (LlvmAbi::Ilp32f, CfgAbi::Unspecified | CfgAbi::Other(_))
|
||||
| (LlvmAbi::Ilp32d, CfgAbi::Unspecified | CfgAbi::Other(_)),
|
||||
"invalid LoongArch ABI name and `cfg(target_abi)` combination:\n\
|
||||
ABI name: {}\n\
|
||||
cfg(target_abi): {}",
|
||||
@@ -3406,10 +3452,10 @@ macro_rules! check_matches {
|
||||
check!(self.llvm_floatabi.is_none(), "`llvm_floatabi` is unused on LoongArch");
|
||||
check!(self.rustc_abi.is_none(), "`rustc_abi` is unused on LoongArch");
|
||||
check_matches!(
|
||||
(&*self.llvm_abiname, &self.cfg_abi),
|
||||
("lp64s", CfgAbi::SoftFloat)
|
||||
| ("lp64f", CfgAbi::Unspecified | CfgAbi::Other(_))
|
||||
| ("lp64d", CfgAbi::Unspecified | CfgAbi::Other(_)),
|
||||
(&self.llvm_abiname, &self.cfg_abi),
|
||||
(LlvmAbi::Lp64s, CfgAbi::SoftFloat)
|
||||
| (LlvmAbi::Lp64f, CfgAbi::Unspecified | CfgAbi::Other(_))
|
||||
| (LlvmAbi::Lp64d, CfgAbi::Unspecified | CfgAbi::Other(_)),
|
||||
"invalid LoongArch ABI name and `cfg(target_abi)` combination:\n\
|
||||
ABI name: {}\n\
|
||||
cfg(target_abi): {}",
|
||||
@@ -3421,8 +3467,8 @@ macro_rules! check_matches {
|
||||
check!(self.llvm_floatabi.is_none(), "`llvm_floatabi` is unused on MIPS");
|
||||
check!(self.rustc_abi.is_none(), "`rustc_abi` is unused on MIPS");
|
||||
check_matches!(
|
||||
(&*self.llvm_abiname, &self.cfg_abi),
|
||||
("o32", CfgAbi::Unspecified | CfgAbi::Other(_)),
|
||||
(&self.llvm_abiname, &self.cfg_abi),
|
||||
(LlvmAbi::O32, CfgAbi::Unspecified | CfgAbi::Other(_)),
|
||||
"invalid MIPS ABI name and `cfg(target_abi)` combination:\n\
|
||||
ABI name: {}\n\
|
||||
cfg(target_abi): {}",
|
||||
@@ -3434,10 +3480,11 @@ macro_rules! check_matches {
|
||||
check!(self.llvm_floatabi.is_none(), "`llvm_floatabi` is unused on MIPS");
|
||||
check!(self.rustc_abi.is_none(), "`rustc_abi` is unused on MIPS");
|
||||
check_matches!(
|
||||
(&*self.llvm_abiname, &self.cfg_abi),
|
||||
(&self.llvm_abiname, &self.cfg_abi),
|
||||
// No in-tree targets use "n32" but at least for now we let out-of-tree targets
|
||||
// experiment with that.
|
||||
("n64", CfgAbi::Abi64) | ("n32", CfgAbi::Unspecified | CfgAbi::Other(_)),
|
||||
(LlvmAbi::N64, CfgAbi::Abi64)
|
||||
| (LlvmAbi::N32, CfgAbi::Unspecified | CfgAbi::Other(_)),
|
||||
"invalid MIPS ABI name and `cfg(target_abi)` combination:\n\
|
||||
ABI name: {}\n\
|
||||
cfg(target_abi): {}",
|
||||
@@ -3446,7 +3493,10 @@ macro_rules! check_matches {
|
||||
);
|
||||
}
|
||||
Arch::CSky => {
|
||||
check!(self.llvm_abiname.is_empty(), "`llvm_abiname` is unused on CSky");
|
||||
check!(
|
||||
self.llvm_abiname == LlvmAbi::Unspecified,
|
||||
"`llvm_abiname` is unused on CSky"
|
||||
);
|
||||
check!(self.llvm_floatabi.is_none(), "`llvm_floatabi` is unused on CSky");
|
||||
check!(self.rustc_abi.is_none(), "`rustc_abi` is unused on CSky");
|
||||
// FIXME: Check that `target_abi` matches the actually configured ABI (v2 vs v2hf).
|
||||
@@ -3461,7 +3511,10 @@ macro_rules! check_matches {
|
||||
// Ensure consistency among built-in targets, but give JSON targets the opportunity
|
||||
// to experiment with these.
|
||||
if kind == TargetKind::Builtin {
|
||||
check!(self.llvm_abiname.is_empty(), "`llvm_abiname` is unused on {arch}");
|
||||
check!(
|
||||
self.llvm_abiname == LlvmAbi::Unspecified,
|
||||
"`llvm_abiname` is unused on {arch}"
|
||||
);
|
||||
check!(self.llvm_floatabi.is_none(), "`llvm_floatabi` is unused on {arch}");
|
||||
check_matches!(
|
||||
self.cfg_abi,
|
||||
@@ -3680,7 +3733,7 @@ pub fn object_architecture(
|
||||
// it using a custom target specification. N32
|
||||
// is an ILP32 ABI like the Aarch64_Ilp32
|
||||
// and X86_64_X32 cases above and below this one.
|
||||
if self.options.llvm_abiname.as_ref() == "n32" {
|
||||
if self.options.llvm_abiname == LlvmAbi::N32 {
|
||||
Architecture::Mips64_N32
|
||||
} else {
|
||||
Architecture::Mips64
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
use crate::spec::{
|
||||
Arch, Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
|
||||
Arch, Cc, LinkerFlavor, Lld, LlvmAbi, PanicStrategy, RelocModel, Target, TargetMetadata,
|
||||
TargetOptions,
|
||||
};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
@@ -19,7 +20,7 @@ pub(crate) fn target() -> Target {
|
||||
features: "+f,+d".into(),
|
||||
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
|
||||
linker: Some("rust-lld".into()),
|
||||
llvm_abiname: "ilp32d".into(),
|
||||
llvm_abiname: LlvmAbi::Ilp32d,
|
||||
max_atomic_width: Some(32),
|
||||
relocation_model: RelocModel::Static,
|
||||
panic_strategy: PanicStrategy::Abort,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use crate::spec::{
|
||||
Arch, Cc, CfgAbi, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata,
|
||||
TargetOptions,
|
||||
Arch, Cc, CfgAbi, LinkerFlavor, Lld, LlvmAbi, PanicStrategy, RelocModel, Target,
|
||||
TargetMetadata, TargetOptions,
|
||||
};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
@@ -21,7 +21,7 @@ pub(crate) fn target() -> Target {
|
||||
cfg_abi: CfgAbi::SoftFloat,
|
||||
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
|
||||
linker: Some("rust-lld".into()),
|
||||
llvm_abiname: "ilp32s".into(),
|
||||
llvm_abiname: LlvmAbi::Ilp32s,
|
||||
max_atomic_width: Some(32),
|
||||
relocation_model: RelocModel::Static,
|
||||
panic_strategy: PanicStrategy::Abort,
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
use crate::spec::{Arch, CodeModel, SanitizerSet, Target, TargetMetadata, TargetOptions, base};
|
||||
use crate::spec::{
|
||||
Arch, CodeModel, LlvmAbi, SanitizerSet, Target, TargetMetadata, TargetOptions, base,
|
||||
};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
Target {
|
||||
@@ -16,7 +18,7 @@ pub(crate) fn target() -> Target {
|
||||
code_model: Some(CodeModel::Medium),
|
||||
cpu: "generic".into(),
|
||||
features: "+f,+d,+lsx,+relax".into(),
|
||||
llvm_abiname: "lp64d".into(),
|
||||
llvm_abiname: LlvmAbi::Lp64d,
|
||||
max_atomic_width: Some(64),
|
||||
supported_sanitizers: SanitizerSet::ADDRESS
|
||||
| SanitizerSet::CFI
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
use crate::spec::{Arch, CodeModel, SanitizerSet, Target, TargetMetadata, TargetOptions, base};
|
||||
use crate::spec::{
|
||||
Arch, CodeModel, LlvmAbi, SanitizerSet, Target, TargetMetadata, TargetOptions, base,
|
||||
};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
Target {
|
||||
@@ -16,7 +18,7 @@ pub(crate) fn target() -> Target {
|
||||
code_model: Some(CodeModel::Medium),
|
||||
cpu: "generic".into(),
|
||||
features: "+f,+d,+lsx,+relax".into(),
|
||||
llvm_abiname: "lp64d".into(),
|
||||
llvm_abiname: LlvmAbi::Lp64d,
|
||||
max_atomic_width: Some(64),
|
||||
crt_static_default: false,
|
||||
supported_sanitizers: SanitizerSet::ADDRESS
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
use crate::spec::{Arch, CodeModel, SanitizerSet, Target, TargetMetadata, TargetOptions, base};
|
||||
use crate::spec::{
|
||||
Arch, CodeModel, LlvmAbi, SanitizerSet, Target, TargetMetadata, TargetOptions, base,
|
||||
};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
Target {
|
||||
@@ -16,7 +18,7 @@ pub(crate) fn target() -> Target {
|
||||
code_model: Some(CodeModel::Medium),
|
||||
cpu: "generic".into(),
|
||||
features: "+f,+d,+lsx,+relax".into(),
|
||||
llvm_abiname: "lp64d".into(),
|
||||
llvm_abiname: LlvmAbi::Lp64d,
|
||||
max_atomic_width: Some(64),
|
||||
supported_sanitizers: SanitizerSet::ADDRESS
|
||||
| SanitizerSet::CFI
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use crate::spec::{
|
||||
Arch, Cc, CodeModel, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata,
|
||||
TargetOptions,
|
||||
Arch, Cc, CodeModel, LinkerFlavor, Lld, LlvmAbi, PanicStrategy, RelocModel, Target,
|
||||
TargetMetadata, TargetOptions,
|
||||
};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
@@ -20,7 +20,7 @@ pub(crate) fn target() -> Target {
|
||||
features: "+f,+d,-lsx".into(),
|
||||
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
|
||||
linker: Some("rust-lld".into()),
|
||||
llvm_abiname: "lp64d".into(),
|
||||
llvm_abiname: LlvmAbi::Lp64d,
|
||||
max_atomic_width: Some(64),
|
||||
relocation_model: RelocModel::Static,
|
||||
panic_strategy: PanicStrategy::Abort,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use crate::spec::{
|
||||
Arch, Cc, CfgAbi, CodeModel, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target,
|
||||
Arch, Cc, CfgAbi, CodeModel, LinkerFlavor, Lld, LlvmAbi, PanicStrategy, RelocModel, Target,
|
||||
TargetMetadata, TargetOptions,
|
||||
};
|
||||
|
||||
@@ -21,7 +21,7 @@ pub(crate) fn target() -> Target {
|
||||
cfg_abi: CfgAbi::SoftFloat,
|
||||
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
|
||||
linker: Some("rust-lld".into()),
|
||||
llvm_abiname: "lp64s".into(),
|
||||
llvm_abiname: LlvmAbi::Lp64s,
|
||||
max_atomic_width: Some(64),
|
||||
relocation_model: RelocModel::Static,
|
||||
panic_strategy: PanicStrategy::Abort,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
use rustc_abi::Endian;
|
||||
|
||||
use crate::spec::{Arch, CfgAbi, Target, TargetMetadata, TargetOptions, base};
|
||||
use crate::spec::{Arch, CfgAbi, LlvmAbi, Target, TargetMetadata, TargetOptions, base};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
let mut base = base::linux_musl::opts();
|
||||
@@ -27,7 +27,7 @@ pub(crate) fn target() -> Target {
|
||||
cfg_abi: CfgAbi::Abi64,
|
||||
endian: Endian::Big,
|
||||
mcount: "_mcount".into(),
|
||||
llvm_abiname: "n64".into(),
|
||||
llvm_abiname: LlvmAbi::N64,
|
||||
..base
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use rustc_abi::Endian;
|
||||
|
||||
use crate::spec::{Arch, CfgAbi, Target, TargetMetadata, TargetOptions, base};
|
||||
use crate::spec::{Arch, CfgAbi, LlvmAbi, Target, TargetMetadata, TargetOptions, base};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
Target {
|
||||
@@ -22,7 +22,7 @@ pub(crate) fn target() -> Target {
|
||||
features: "+mips64r2,+xgot".into(),
|
||||
max_atomic_width: Some(64),
|
||||
mcount: "_mcount".into(),
|
||||
llvm_abiname: "n64".into(),
|
||||
llvm_abiname: LlvmAbi::N64,
|
||||
|
||||
..base::linux_gnu::opts()
|
||||
},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use rustc_abi::Endian;
|
||||
|
||||
use crate::spec::{Arch, CfgAbi, Target, TargetMetadata, TargetOptions, base};
|
||||
use crate::spec::{Arch, CfgAbi, LlvmAbi, Target, TargetMetadata, TargetOptions, base};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
let mut base = base::linux_musl::opts();
|
||||
@@ -23,7 +23,7 @@ pub(crate) fn target() -> Target {
|
||||
cfg_abi: CfgAbi::Abi64,
|
||||
endian: Endian::Big,
|
||||
mcount: "_mcount".into(),
|
||||
llvm_abiname: "n64".into(),
|
||||
llvm_abiname: LlvmAbi::N64,
|
||||
..base
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use crate::spec::{Arch, CfgAbi, Target, TargetMetadata, TargetOptions, base};
|
||||
use crate::spec::{Arch, CfgAbi, LlvmAbi, Target, TargetMetadata, TargetOptions, base};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
Target {
|
||||
@@ -19,7 +19,7 @@ pub(crate) fn target() -> Target {
|
||||
features: "+mips64r2,+xgot".into(),
|
||||
max_atomic_width: Some(64),
|
||||
mcount: "_mcount".into(),
|
||||
llvm_abiname: "n64".into(),
|
||||
llvm_abiname: LlvmAbi::N64,
|
||||
|
||||
..base::linux_gnu::opts()
|
||||
},
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use crate::spec::{Arch, CfgAbi, Target, TargetMetadata, TargetOptions, base};
|
||||
use crate::spec::{Arch, CfgAbi, LlvmAbi, Target, TargetMetadata, TargetOptions, base};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
let mut base = base::linux_musl::opts();
|
||||
@@ -20,7 +20,7 @@ pub(crate) fn target() -> Target {
|
||||
options: TargetOptions {
|
||||
cfg_abi: CfgAbi::Abi64,
|
||||
mcount: "_mcount".into(),
|
||||
llvm_abiname: "n64".into(),
|
||||
llvm_abiname: LlvmAbi::N64,
|
||||
..base
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
use rustc_abi::Endian;
|
||||
|
||||
use crate::spec::{
|
||||
Arch, Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
|
||||
Arch, Cc, LinkerFlavor, Lld, LlvmAbi, PanicStrategy, RelocModel, Target, TargetMetadata,
|
||||
TargetOptions,
|
||||
};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
@@ -24,7 +25,7 @@ pub(crate) fn target() -> Target {
|
||||
endian: Endian::Big,
|
||||
cpu: "mips32r2".into(),
|
||||
|
||||
llvm_abiname: "o32".into(),
|
||||
llvm_abiname: LlvmAbi::O32,
|
||||
max_atomic_width: Some(32),
|
||||
|
||||
features: "+mips32r2,+soft-float,+noabicalls".into(),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use rustc_abi::Endian;
|
||||
|
||||
use crate::spec::{Arch, Target, TargetMetadata, TargetOptions, base};
|
||||
use crate::spec::{Arch, LlvmAbi, Target, TargetMetadata, TargetOptions, base};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
Target {
|
||||
@@ -18,7 +18,7 @@ pub(crate) fn target() -> Target {
|
||||
endian: Endian::Big,
|
||||
cpu: "mips32r2".into(),
|
||||
features: "+mips32r2,+fpxx,+nooddspreg".into(),
|
||||
llvm_abiname: "o32".into(),
|
||||
llvm_abiname: LlvmAbi::O32,
|
||||
max_atomic_width: Some(32),
|
||||
mcount: "_mcount".into(),
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use rustc_abi::Endian;
|
||||
|
||||
use crate::spec::{Arch, Target, TargetMetadata, TargetOptions, base};
|
||||
use crate::spec::{Arch, LlvmAbi, Target, TargetMetadata, TargetOptions, base};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
let mut base = base::linux_musl::opts();
|
||||
@@ -20,7 +20,7 @@ pub(crate) fn target() -> Target {
|
||||
arch: Arch::Mips,
|
||||
options: TargetOptions {
|
||||
endian: Endian::Big,
|
||||
llvm_abiname: "o32".into(),
|
||||
llvm_abiname: LlvmAbi::O32,
|
||||
mcount: "_mcount".into(),
|
||||
..base
|
||||
},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use rustc_abi::Endian;
|
||||
|
||||
use crate::spec::{Arch, Target, TargetMetadata, TargetOptions, base};
|
||||
use crate::spec::{Arch, LlvmAbi, Target, TargetMetadata, TargetOptions, base};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
Target {
|
||||
@@ -18,7 +18,7 @@ pub(crate) fn target() -> Target {
|
||||
endian: Endian::Big,
|
||||
cpu: "mips32r2".into(),
|
||||
features: "+mips32r2,+soft-float".into(),
|
||||
llvm_abiname: "o32".into(),
|
||||
llvm_abiname: LlvmAbi::O32,
|
||||
max_atomic_width: Some(32),
|
||||
mcount: "_mcount".into(),
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
use rustc_abi::Endian;
|
||||
|
||||
use crate::spec::{
|
||||
Arch, Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
|
||||
Arch, Cc, LinkerFlavor, Lld, LlvmAbi, PanicStrategy, RelocModel, Target, TargetMetadata,
|
||||
TargetOptions,
|
||||
};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
@@ -24,7 +25,7 @@ pub(crate) fn target() -> Target {
|
||||
endian: Endian::Little,
|
||||
cpu: "mips32r2".into(),
|
||||
|
||||
llvm_abiname: "o32".into(),
|
||||
llvm_abiname: LlvmAbi::O32,
|
||||
max_atomic_width: Some(32),
|
||||
|
||||
features: "+mips32r2,+soft-float,+noabicalls".into(),
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
use crate::spec::{
|
||||
Arch, Cc, LinkerFlavor, Lld, Os, RelocModel, Target, TargetMetadata, TargetOptions, cvs,
|
||||
Arch, Cc, LinkerFlavor, Lld, LlvmAbi, Os, RelocModel, Target, TargetMetadata, TargetOptions,
|
||||
cvs,
|
||||
};
|
||||
|
||||
// The PSP has custom linker requirements.
|
||||
@@ -36,7 +37,7 @@ pub(crate) fn target() -> Target {
|
||||
|
||||
// PSP does not support trap-on-condition instructions.
|
||||
llvm_args: cvs!["-mno-check-zero-division"],
|
||||
llvm_abiname: "o32".into(),
|
||||
llvm_abiname: LlvmAbi::O32,
|
||||
pre_link_args,
|
||||
link_script: Some(LINKER_SCRIPT.into()),
|
||||
..Default::default()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use crate::spec::{
|
||||
Arch, Cc, LinkerFlavor, Lld, Os, PanicStrategy, RelocModel, Target, TargetMetadata,
|
||||
Arch, Cc, LinkerFlavor, Lld, LlvmAbi, Os, PanicStrategy, RelocModel, Target, TargetMetadata,
|
||||
TargetOptions, cvs,
|
||||
};
|
||||
|
||||
@@ -41,7 +41,7 @@ pub(crate) fn target() -> Target {
|
||||
|
||||
// PSX does not support trap-on-condition instructions.
|
||||
llvm_args: cvs!["-mno-check-zero-division"],
|
||||
llvm_abiname: "o32".into(),
|
||||
llvm_abiname: LlvmAbi::O32,
|
||||
panic_strategy: PanicStrategy::Abort,
|
||||
..Default::default()
|
||||
},
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use crate::spec::{Arch, Target, TargetMetadata, TargetOptions, base};
|
||||
use crate::spec::{Arch, LlvmAbi, Target, TargetMetadata, TargetOptions, base};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
Target {
|
||||
@@ -16,7 +16,7 @@ pub(crate) fn target() -> Target {
|
||||
options: TargetOptions {
|
||||
cpu: "mips32r2".into(),
|
||||
features: "+mips32r2,+fpxx,+nooddspreg".into(),
|
||||
llvm_abiname: "o32".into(),
|
||||
llvm_abiname: LlvmAbi::O32,
|
||||
max_atomic_width: Some(32),
|
||||
mcount: "_mcount".into(),
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use crate::spec::{Arch, Target, TargetMetadata, TargetOptions, base};
|
||||
use crate::spec::{Arch, LlvmAbi, Target, TargetMetadata, TargetOptions, base};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
let mut base = base::linux_musl::opts();
|
||||
@@ -16,6 +16,6 @@ pub(crate) fn target() -> Target {
|
||||
pointer_width: 32,
|
||||
data_layout: "e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".into(),
|
||||
arch: Arch::Mips,
|
||||
options: TargetOptions { llvm_abiname: "o32".into(), mcount: "_mcount".into(), ..base },
|
||||
options: TargetOptions { llvm_abiname: LlvmAbi::O32, mcount: "_mcount".into(), ..base },
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use crate::spec::{Arch, Target, TargetMetadata, TargetOptions, base};
|
||||
use crate::spec::{Arch, LlvmAbi, Target, TargetMetadata, TargetOptions, base};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
Target {
|
||||
@@ -16,7 +16,7 @@ pub(crate) fn target() -> Target {
|
||||
options: TargetOptions {
|
||||
cpu: "mips32r2".into(),
|
||||
features: "+mips32r2,+soft-float".into(),
|
||||
llvm_abiname: "o32".into(),
|
||||
llvm_abiname: LlvmAbi::O32,
|
||||
max_atomic_width: Some(32),
|
||||
mcount: "_mcount".into(),
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use rustc_abi::Endian;
|
||||
|
||||
use crate::spec::{Arch, Target, TargetMetadata, TargetOptions, base};
|
||||
use crate::spec::{Arch, LlvmAbi, Target, TargetMetadata, TargetOptions, base};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
let mut base = base::netbsd::opts();
|
||||
@@ -20,7 +20,7 @@ pub(crate) fn target() -> Target {
|
||||
arch: Arch::Mips,
|
||||
options: TargetOptions {
|
||||
features: "+soft-float".into(),
|
||||
llvm_abiname: "o32".into(),
|
||||
llvm_abiname: LlvmAbi::O32,
|
||||
mcount: "__mcount".into(),
|
||||
endian: Endian::Little,
|
||||
..base
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
//! Can be used for MIPS M4K core (e.g. on PIC32MX devices)
|
||||
|
||||
use crate::spec::{
|
||||
Arch, Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
|
||||
Arch, Cc, LinkerFlavor, Lld, LlvmAbi, PanicStrategy, RelocModel, Target, TargetMetadata,
|
||||
TargetOptions,
|
||||
};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
@@ -23,7 +24,7 @@ pub(crate) fn target() -> Target {
|
||||
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
|
||||
cpu: "mips32r2".into(),
|
||||
features: "+mips32r2,+soft-float,+noabicalls".into(),
|
||||
llvm_abiname: "o32".into(),
|
||||
llvm_abiname: LlvmAbi::O32,
|
||||
max_atomic_width: Some(32),
|
||||
linker: Some("rust-lld".into()),
|
||||
panic_strategy: PanicStrategy::Abort,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use rustc_abi::Endian;
|
||||
|
||||
use crate::spec::{Arch, Target, TargetMetadata, TargetOptions, base};
|
||||
use crate::spec::{Arch, LlvmAbi, Target, TargetMetadata, TargetOptions, base};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
Target {
|
||||
@@ -18,7 +18,7 @@ pub(crate) fn target() -> Target {
|
||||
endian: Endian::Big,
|
||||
cpu: "mips32r6".into(),
|
||||
features: "+mips32r6".into(),
|
||||
llvm_abiname: "o32".into(),
|
||||
llvm_abiname: LlvmAbi::O32,
|
||||
max_atomic_width: Some(32),
|
||||
mcount: "_mcount".into(),
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use crate::spec::{Arch, Target, TargetMetadata, TargetOptions, base};
|
||||
use crate::spec::{Arch, LlvmAbi, Target, TargetMetadata, TargetOptions, base};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
Target {
|
||||
@@ -16,7 +16,7 @@ pub(crate) fn target() -> Target {
|
||||
options: TargetOptions {
|
||||
cpu: "mips32r6".into(),
|
||||
features: "+mips32r6".into(),
|
||||
llvm_abiname: "o32".into(),
|
||||
llvm_abiname: LlvmAbi::O32,
|
||||
max_atomic_width: Some(32),
|
||||
mcount: "_mcount".into(),
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use rustc_abi::Endian;
|
||||
|
||||
use crate::spec::{Arch, CfgAbi, Target, TargetMetadata, TargetOptions, base};
|
||||
use crate::spec::{Arch, CfgAbi, LlvmAbi, Target, TargetMetadata, TargetOptions, base};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
Target {
|
||||
@@ -22,7 +22,7 @@ pub(crate) fn target() -> Target {
|
||||
features: "+mips64r6".into(),
|
||||
max_atomic_width: Some(64),
|
||||
mcount: "_mcount".into(),
|
||||
llvm_abiname: "n64".into(),
|
||||
llvm_abiname: LlvmAbi::N64,
|
||||
|
||||
..base::linux_gnu::opts()
|
||||
},
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use crate::spec::{Arch, CfgAbi, Target, TargetMetadata, TargetOptions, base};
|
||||
use crate::spec::{Arch, CfgAbi, LlvmAbi, Target, TargetMetadata, TargetOptions, base};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
Target {
|
||||
@@ -19,7 +19,7 @@ pub(crate) fn target() -> Target {
|
||||
features: "+mips64r6".into(),
|
||||
max_atomic_width: Some(64),
|
||||
mcount: "_mcount".into(),
|
||||
llvm_abiname: "n64".into(),
|
||||
llvm_abiname: LlvmAbi::N64,
|
||||
|
||||
..base::linux_gnu::opts()
|
||||
},
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
use rustc_abi::Endian;
|
||||
|
||||
use crate::spec::{
|
||||
Arch, Cc, CfgAbi, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, TargetOptions,
|
||||
base,
|
||||
Arch, Cc, CfgAbi, LinkerFlavor, Lld, LlvmAbi, StackProbeType, Target, TargetMetadata,
|
||||
TargetOptions, base,
|
||||
};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
@@ -12,7 +12,7 @@ pub(crate) fn target() -> Target {
|
||||
base.max_atomic_width = Some(64);
|
||||
base.stack_probes = StackProbeType::Inline;
|
||||
base.cfg_abi = CfgAbi::ElfV2;
|
||||
base.llvm_abiname = "elfv2".into();
|
||||
base.llvm_abiname = LlvmAbi::ElfV2;
|
||||
|
||||
Target {
|
||||
llvm_target: "powerpc64-unknown-freebsd".into(),
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
use rustc_abi::Endian;
|
||||
|
||||
use crate::spec::{
|
||||
Arch, Cc, CfgAbi, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, TargetOptions,
|
||||
base,
|
||||
Arch, Cc, CfgAbi, LinkerFlavor, Lld, LlvmAbi, StackProbeType, Target, TargetMetadata,
|
||||
TargetOptions, base,
|
||||
};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
@@ -12,7 +12,7 @@ pub(crate) fn target() -> Target {
|
||||
base.max_atomic_width = Some(64);
|
||||
base.stack_probes = StackProbeType::Inline;
|
||||
base.cfg_abi = CfgAbi::ElfV1;
|
||||
base.llvm_abiname = "elfv1".into();
|
||||
base.llvm_abiname = LlvmAbi::ElfV1;
|
||||
|
||||
Target {
|
||||
llvm_target: "powerpc64-unknown-linux-gnu".into(),
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
use rustc_abi::Endian;
|
||||
|
||||
use crate::spec::{
|
||||
Arch, Cc, CfgAbi, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, TargetOptions,
|
||||
base,
|
||||
Arch, Cc, CfgAbi, LinkerFlavor, Lld, LlvmAbi, StackProbeType, Target, TargetMetadata,
|
||||
TargetOptions, base,
|
||||
};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
@@ -12,7 +12,7 @@ pub(crate) fn target() -> Target {
|
||||
base.max_atomic_width = Some(64);
|
||||
base.stack_probes = StackProbeType::Inline;
|
||||
base.cfg_abi = CfgAbi::ElfV2;
|
||||
base.llvm_abiname = "elfv2".into();
|
||||
base.llvm_abiname = LlvmAbi::ElfV2;
|
||||
|
||||
Target {
|
||||
llvm_target: "powerpc64-unknown-linux-musl".into(),
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
use rustc_abi::Endian;
|
||||
|
||||
use crate::spec::{
|
||||
Arch, Cc, CfgAbi, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, TargetOptions,
|
||||
base,
|
||||
Arch, Cc, CfgAbi, LinkerFlavor, Lld, LlvmAbi, StackProbeType, Target, TargetMetadata,
|
||||
TargetOptions, base,
|
||||
};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
@@ -12,7 +12,7 @@ pub(crate) fn target() -> Target {
|
||||
base.max_atomic_width = Some(64);
|
||||
base.stack_probes = StackProbeType::Inline;
|
||||
base.cfg_abi = CfgAbi::ElfV2;
|
||||
base.llvm_abiname = "elfv2".into();
|
||||
base.llvm_abiname = LlvmAbi::ElfV2;
|
||||
|
||||
Target {
|
||||
llvm_target: "powerpc64-unknown-openbsd".into(),
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
use rustc_abi::Endian;
|
||||
|
||||
use crate::spec::{
|
||||
Arch, Cc, CfgAbi, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, TargetOptions,
|
||||
base,
|
||||
Arch, Cc, CfgAbi, LinkerFlavor, Lld, LlvmAbi, StackProbeType, Target, TargetMetadata,
|
||||
TargetOptions, base,
|
||||
};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
@@ -12,7 +12,7 @@ pub(crate) fn target() -> Target {
|
||||
base.max_atomic_width = Some(64);
|
||||
base.stack_probes = StackProbeType::Inline;
|
||||
base.cfg_abi = CfgAbi::ElfV1;
|
||||
base.llvm_abiname = "elfv1".into();
|
||||
base.llvm_abiname = LlvmAbi::ElfV1;
|
||||
|
||||
Target {
|
||||
llvm_target: "powerpc64-unknown-linux-gnu".into(),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use crate::spec::{
|
||||
Arch, Cc, CfgAbi, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, TargetOptions,
|
||||
base,
|
||||
Arch, Cc, CfgAbi, LinkerFlavor, Lld, LlvmAbi, StackProbeType, Target, TargetMetadata,
|
||||
TargetOptions, base,
|
||||
};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
@@ -10,7 +10,7 @@ pub(crate) fn target() -> Target {
|
||||
base.max_atomic_width = Some(64);
|
||||
base.stack_probes = StackProbeType::Inline;
|
||||
base.cfg_abi = CfgAbi::ElfV2;
|
||||
base.llvm_abiname = "elfv2".into();
|
||||
base.llvm_abiname = LlvmAbi::ElfV2;
|
||||
|
||||
Target {
|
||||
llvm_target: "powerpc64le-unknown-freebsd".into(),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use crate::spec::{
|
||||
Arch, Cc, CfgAbi, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, TargetOptions,
|
||||
base,
|
||||
Arch, Cc, CfgAbi, LinkerFlavor, Lld, LlvmAbi, StackProbeType, Target, TargetMetadata,
|
||||
TargetOptions, base,
|
||||
};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
@@ -10,7 +10,7 @@ pub(crate) fn target() -> Target {
|
||||
base.max_atomic_width = Some(64);
|
||||
base.stack_probes = StackProbeType::Inline;
|
||||
base.cfg_abi = CfgAbi::ElfV2;
|
||||
base.llvm_abiname = "elfv2".into();
|
||||
base.llvm_abiname = LlvmAbi::ElfV2;
|
||||
|
||||
Target {
|
||||
llvm_target: "powerpc64le-unknown-linux-gnu".into(),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use crate::spec::{
|
||||
Arch, Cc, CfgAbi, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, TargetOptions,
|
||||
base,
|
||||
Arch, Cc, CfgAbi, LinkerFlavor, Lld, LlvmAbi, StackProbeType, Target, TargetMetadata,
|
||||
TargetOptions, base,
|
||||
};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
@@ -12,7 +12,7 @@ pub(crate) fn target() -> Target {
|
||||
// FIXME(compiler-team#422): musl targets should be dynamically linked by default.
|
||||
base.crt_static_default = true;
|
||||
base.cfg_abi = CfgAbi::ElfV2;
|
||||
base.llvm_abiname = "elfv2".into();
|
||||
base.llvm_abiname = LlvmAbi::ElfV2;
|
||||
|
||||
Target {
|
||||
llvm_target: "powerpc64le-unknown-linux-musl".into(),
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use crate::spec::{Arch, StackProbeType, Target, TargetMetadata, TargetOptions, base};
|
||||
use crate::spec::{Arch, LlvmAbi, StackProbeType, Target, TargetMetadata, TargetOptions, base};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
Target {
|
||||
@@ -14,7 +14,7 @@ pub(crate) fn target() -> Target {
|
||||
arch: Arch::RiscV32,
|
||||
options: TargetOptions {
|
||||
cpu: "generic-rv32".into(),
|
||||
llvm_abiname: "ilp32d".into(),
|
||||
llvm_abiname: LlvmAbi::Ilp32d,
|
||||
max_atomic_width: Some(32),
|
||||
features: "+m,+a,+f,+d,+c,+zicsr,+zifencei".into(),
|
||||
stack_probes: StackProbeType::Inline,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use crate::spec::{
|
||||
Arch, Cc, CfgAbi, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata,
|
||||
TargetOptions,
|
||||
Arch, Cc, CfgAbi, LinkerFlavor, Lld, LlvmAbi, PanicStrategy, RelocModel, Target,
|
||||
TargetMetadata, TargetOptions,
|
||||
};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
@@ -24,7 +24,7 @@ pub(crate) fn target() -> Target {
|
||||
linker: Some("rust-lld".into()),
|
||||
cpu: "generic-rv32".into(),
|
||||
// The ilp32e ABI specifies the `data_layout`
|
||||
llvm_abiname: "ilp32e".into(),
|
||||
llvm_abiname: LlvmAbi::Ilp32e,
|
||||
max_atomic_width: Some(32),
|
||||
atomic_cas: false,
|
||||
features: "+e,+forced-atomics".into(),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use crate::spec::{
|
||||
Arch, Cc, CfgAbi, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata,
|
||||
TargetOptions,
|
||||
Arch, Cc, CfgAbi, LinkerFlavor, Lld, LlvmAbi, PanicStrategy, RelocModel, Target,
|
||||
TargetMetadata, TargetOptions,
|
||||
};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
@@ -24,7 +24,7 @@ pub(crate) fn target() -> Target {
|
||||
linker: Some("rust-lld".into()),
|
||||
cpu: "generic-rv32".into(),
|
||||
// The ilp32e ABI specifies the `data_layout`
|
||||
llvm_abiname: "ilp32e".into(),
|
||||
llvm_abiname: LlvmAbi::Ilp32e,
|
||||
max_atomic_width: Some(32),
|
||||
atomic_cas: false,
|
||||
features: "+e,+m,+forced-atomics".into(),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use crate::spec::{
|
||||
Arch, Cc, CfgAbi, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata,
|
||||
TargetOptions,
|
||||
Arch, Cc, CfgAbi, LinkerFlavor, Lld, LlvmAbi, PanicStrategy, RelocModel, Target,
|
||||
TargetMetadata, TargetOptions,
|
||||
};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
@@ -24,7 +24,7 @@ pub(crate) fn target() -> Target {
|
||||
linker: Some("rust-lld".into()),
|
||||
cpu: "generic-rv32".into(),
|
||||
// The ilp32e ABI specifies the `data_layout`
|
||||
llvm_abiname: "ilp32e".into(),
|
||||
llvm_abiname: LlvmAbi::Ilp32e,
|
||||
max_atomic_width: Some(32),
|
||||
atomic_cas: false,
|
||||
features: "+e,+m,+c,+forced-atomics".into(),
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
use std::borrow::Cow;
|
||||
|
||||
use crate::spec::{Arch, CodeModel, SplitDebuginfo, Target, TargetMetadata, TargetOptions, base};
|
||||
use crate::spec::{
|
||||
Arch, CodeModel, LlvmAbi, SplitDebuginfo, Target, TargetMetadata, TargetOptions, base,
|
||||
};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
Target {
|
||||
@@ -18,7 +20,7 @@ pub(crate) fn target() -> Target {
|
||||
code_model: Some(CodeModel::Medium),
|
||||
cpu: "generic-rv32".into(),
|
||||
features: "+m,+a,+f,+d,+c,+zicsr,+zifencei".into(),
|
||||
llvm_abiname: "ilp32d".into(),
|
||||
llvm_abiname: LlvmAbi::Ilp32d,
|
||||
max_atomic_width: Some(32),
|
||||
supported_split_debuginfo: Cow::Borrowed(&[SplitDebuginfo::Off]),
|
||||
..base::linux_gnu::opts()
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
use std::borrow::Cow;
|
||||
|
||||
use crate::spec::{Arch, CodeModel, SplitDebuginfo, Target, TargetMetadata, TargetOptions, base};
|
||||
use crate::spec::{
|
||||
Arch, CodeModel, LlvmAbi, SplitDebuginfo, Target, TargetMetadata, TargetOptions, base,
|
||||
};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
Target {
|
||||
@@ -18,7 +20,7 @@ pub(crate) fn target() -> Target {
|
||||
code_model: Some(CodeModel::Medium),
|
||||
cpu: "generic-rv32".into(),
|
||||
features: "+m,+a,+f,+d,+c,+zicsr,+zifencei".into(),
|
||||
llvm_abiname: "ilp32d".into(),
|
||||
llvm_abiname: LlvmAbi::Ilp32d,
|
||||
max_atomic_width: Some(32),
|
||||
supported_split_debuginfo: Cow::Borrowed(&[SplitDebuginfo::Off]),
|
||||
..base::linux_musl::opts()
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
use crate::spec::{
|
||||
Arch, Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
|
||||
Arch, Cc, LinkerFlavor, Lld, LlvmAbi, PanicStrategy, RelocModel, Target, TargetMetadata,
|
||||
TargetOptions,
|
||||
};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
@@ -22,7 +23,7 @@ pub(crate) fn target() -> Target {
|
||||
max_atomic_width: Some(32),
|
||||
atomic_cas: false,
|
||||
features: "+forced-atomics".into(),
|
||||
llvm_abiname: "ilp32".into(),
|
||||
llvm_abiname: LlvmAbi::Ilp32,
|
||||
panic_strategy: PanicStrategy::Abort,
|
||||
relocation_model: RelocModel::Static,
|
||||
emit_debug_gdb_scripts: false,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use crate::spec::{
|
||||
Arch, Cc, LinkerFlavor, Lld, Os, PanicStrategy, RelocModel, Target, TargetMetadata,
|
||||
Arch, Cc, LinkerFlavor, Lld, LlvmAbi, Os, PanicStrategy, RelocModel, Target, TargetMetadata,
|
||||
TargetOptions,
|
||||
};
|
||||
|
||||
@@ -32,7 +32,7 @@ pub(crate) fn target() -> Target {
|
||||
atomic_cas: true,
|
||||
|
||||
features: "+m".into(),
|
||||
llvm_abiname: "ilp32".into(),
|
||||
llvm_abiname: LlvmAbi::Ilp32,
|
||||
executables: true,
|
||||
panic_strategy: PanicStrategy::Abort,
|
||||
relocation_model: RelocModel::Static,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
use crate::spec::{
|
||||
Arch, Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
|
||||
Arch, Cc, LinkerFlavor, Lld, LlvmAbi, PanicStrategy, RelocModel, Target, TargetMetadata,
|
||||
TargetOptions,
|
||||
};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
@@ -22,7 +23,7 @@ pub(crate) fn target() -> Target {
|
||||
max_atomic_width: Some(32),
|
||||
atomic_cas: false,
|
||||
features: "+m,+forced-atomics".into(),
|
||||
llvm_abiname: "ilp32".into(),
|
||||
llvm_abiname: LlvmAbi::Ilp32,
|
||||
panic_strategy: PanicStrategy::Abort,
|
||||
relocation_model: RelocModel::Static,
|
||||
emit_debug_gdb_scripts: false,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
use crate::spec::{
|
||||
Arch, Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
|
||||
Arch, Cc, LinkerFlavor, Lld, LlvmAbi, PanicStrategy, RelocModel, Target, TargetMetadata,
|
||||
TargetOptions,
|
||||
};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
@@ -21,7 +22,7 @@ pub(crate) fn target() -> Target {
|
||||
cpu: "generic-rv32".into(),
|
||||
max_atomic_width: Some(32),
|
||||
features: "+m,+a".into(),
|
||||
llvm_abiname: "ilp32".into(),
|
||||
llvm_abiname: LlvmAbi::Ilp32,
|
||||
panic_strategy: PanicStrategy::Abort,
|
||||
relocation_model: RelocModel::Static,
|
||||
emit_debug_gdb_scripts: false,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use crate::spec::{
|
||||
Arch, Env, Os, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions, cvs,
|
||||
Arch, Env, LlvmAbi, Os, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions, cvs,
|
||||
};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
@@ -29,7 +29,7 @@ pub(crate) fn target() -> Target {
|
||||
atomic_cas: true,
|
||||
|
||||
features: "+m,+a,+c".into(),
|
||||
llvm_abiname: "ilp32".into(),
|
||||
llvm_abiname: LlvmAbi::Ilp32,
|
||||
panic_strategy: PanicStrategy::Abort,
|
||||
relocation_model: RelocModel::Static,
|
||||
emit_debug_gdb_scripts: false,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
use crate::spec::{
|
||||
Arch, Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
|
||||
Arch, Cc, LinkerFlavor, Lld, LlvmAbi, PanicStrategy, RelocModel, Target, TargetMetadata,
|
||||
TargetOptions,
|
||||
};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
@@ -21,7 +22,7 @@ pub(crate) fn target() -> Target {
|
||||
cpu: "generic-rv32".into(),
|
||||
max_atomic_width: Some(32),
|
||||
features: "+m,+a,+c".into(),
|
||||
llvm_abiname: "ilp32".into(),
|
||||
llvm_abiname: LlvmAbi::Ilp32,
|
||||
panic_strategy: PanicStrategy::Abort,
|
||||
relocation_model: RelocModel::Static,
|
||||
emit_debug_gdb_scripts: false,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use crate::spec::{
|
||||
Arch, Cc, LinkerFlavor, Lld, Os, PanicStrategy, RelocModel, Target, TargetMetadata,
|
||||
Arch, Cc, LinkerFlavor, Lld, LlvmAbi, Os, PanicStrategy, RelocModel, Target, TargetMetadata,
|
||||
TargetOptions, cvs,
|
||||
};
|
||||
|
||||
@@ -24,7 +24,7 @@ pub(crate) fn target() -> Target {
|
||||
cpu: "generic-rv32".into(),
|
||||
max_atomic_width: Some(32),
|
||||
features: "+m,+a,+c".into(),
|
||||
llvm_abiname: "ilp32".into(),
|
||||
llvm_abiname: LlvmAbi::Ilp32,
|
||||
panic_strategy: PanicStrategy::Unwind,
|
||||
relocation_model: RelocModel::Static,
|
||||
..Default::default()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use crate::spec::{
|
||||
Arch, Cc, LinkerFlavor, Lld, Os, PanicStrategy, RelocModel, Target, TargetMetadata,
|
||||
Arch, Cc, LinkerFlavor, Lld, LlvmAbi, Os, PanicStrategy, RelocModel, Target, TargetMetadata,
|
||||
TargetOptions,
|
||||
};
|
||||
|
||||
@@ -23,7 +23,7 @@ pub(crate) fn target() -> Target {
|
||||
cpu: "generic-rv32".into(),
|
||||
max_atomic_width: Some(32),
|
||||
features: "+m,+a,+c".into(),
|
||||
llvm_abiname: "ilp32".into(),
|
||||
llvm_abiname: LlvmAbi::Ilp32,
|
||||
panic_strategy: PanicStrategy::Unwind,
|
||||
relocation_model: RelocModel::Static,
|
||||
..Default::default()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use crate::spec::{
|
||||
Arch, Env, Os, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions, cvs,
|
||||
Arch, Env, LlvmAbi, Os, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions, cvs,
|
||||
};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
@@ -26,7 +26,7 @@ pub(crate) fn target() -> Target {
|
||||
max_atomic_width: Some(32),
|
||||
atomic_cas: true,
|
||||
|
||||
llvm_abiname: "ilp32f".into(),
|
||||
llvm_abiname: LlvmAbi::Ilp32f,
|
||||
features: "+m,+a,+c,+f".into(),
|
||||
panic_strategy: PanicStrategy::Abort,
|
||||
relocation_model: RelocModel::Static,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
use crate::spec::{
|
||||
Arch, Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
|
||||
Arch, Cc, LinkerFlavor, Lld, LlvmAbi, PanicStrategy, RelocModel, Target, TargetMetadata,
|
||||
TargetOptions,
|
||||
};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
@@ -20,7 +21,7 @@ pub(crate) fn target() -> Target {
|
||||
linker: Some("rust-lld".into()),
|
||||
cpu: "generic-rv32".into(),
|
||||
max_atomic_width: Some(32),
|
||||
llvm_abiname: "ilp32f".into(),
|
||||
llvm_abiname: LlvmAbi::Ilp32f,
|
||||
features: "+m,+a,+c,+f".into(),
|
||||
panic_strategy: PanicStrategy::Abort,
|
||||
relocation_model: RelocModel::Static,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use crate::spec::{
|
||||
Arch, Cc, LinkerFlavor, Lld, Os, PanicStrategy, RelocModel, Target, TargetMetadata,
|
||||
Arch, Cc, LinkerFlavor, Lld, LlvmAbi, Os, PanicStrategy, RelocModel, Target, TargetMetadata,
|
||||
TargetOptions, cvs,
|
||||
};
|
||||
|
||||
@@ -23,7 +23,7 @@ pub(crate) fn target() -> Target {
|
||||
linker: Some("rust-lld".into()),
|
||||
cpu: "generic-rv32".into(),
|
||||
max_atomic_width: Some(32),
|
||||
llvm_abiname: "ilp32f".into(),
|
||||
llvm_abiname: LlvmAbi::Ilp32f,
|
||||
features: "+m,+a,+c,+f".into(),
|
||||
panic_strategy: PanicStrategy::Abort,
|
||||
relocation_model: RelocModel::Static,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use crate::spec::{
|
||||
Arch, Env, Os, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions, cvs,
|
||||
Arch, Env, LlvmAbi, Os, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions, cvs,
|
||||
};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
@@ -32,7 +32,7 @@ pub(crate) fn target() -> Target {
|
||||
atomic_cas: true,
|
||||
|
||||
features: "+m,+c".into(),
|
||||
llvm_abiname: "ilp32".into(),
|
||||
llvm_abiname: LlvmAbi::Ilp32,
|
||||
panic_strategy: PanicStrategy::Abort,
|
||||
relocation_model: RelocModel::Static,
|
||||
emit_debug_gdb_scripts: false,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
use crate::spec::{
|
||||
Arch, Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
|
||||
Arch, Cc, LinkerFlavor, Lld, LlvmAbi, PanicStrategy, RelocModel, Target, TargetMetadata,
|
||||
TargetOptions,
|
||||
};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
@@ -22,7 +23,7 @@ pub(crate) fn target() -> Target {
|
||||
max_atomic_width: Some(32),
|
||||
atomic_cas: false,
|
||||
features: "+m,+c,+forced-atomics".into(),
|
||||
llvm_abiname: "ilp32".into(),
|
||||
llvm_abiname: LlvmAbi::Ilp32,
|
||||
panic_strategy: PanicStrategy::Abort,
|
||||
relocation_model: RelocModel::Static,
|
||||
emit_debug_gdb_scripts: false,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use crate::spec::{
|
||||
Arch, Cc, LinkerFlavor, Lld, Os, PanicStrategy, RelocModel, Target, TargetMetadata,
|
||||
Arch, Cc, LinkerFlavor, Lld, LlvmAbi, Os, PanicStrategy, RelocModel, Target, TargetMetadata,
|
||||
TargetOptions, cvs,
|
||||
};
|
||||
|
||||
@@ -24,7 +24,7 @@ pub(crate) fn target() -> Target {
|
||||
cpu: "generic-rv32".into(),
|
||||
max_atomic_width: Some(32),
|
||||
features: "+m,+c".into(),
|
||||
llvm_abiname: "ilp32".into(),
|
||||
llvm_abiname: LlvmAbi::Ilp32,
|
||||
panic_strategy: PanicStrategy::Unwind,
|
||||
relocation_model: RelocModel::Static,
|
||||
..Default::default()
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
use std::borrow::Cow;
|
||||
|
||||
use crate::spec::{
|
||||
Arch, CodeModel, SanitizerSet, SplitDebuginfo, Target, TargetMetadata, TargetOptions, base,
|
||||
Arch, CodeModel, LlvmAbi, SanitizerSet, SplitDebuginfo, Target, TargetMetadata, TargetOptions,
|
||||
base,
|
||||
};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
@@ -20,7 +21,7 @@ pub(crate) fn target() -> Target {
|
||||
code_model: Some(CodeModel::Medium),
|
||||
cpu: "generic-rv64".into(),
|
||||
features: "+m,+a,+f,+d,+c,+b,+v,+zicsr,+zifencei".into(),
|
||||
llvm_abiname: "lp64d".into(),
|
||||
llvm_abiname: LlvmAbi::Lp64d,
|
||||
supported_sanitizers: SanitizerSet::ADDRESS,
|
||||
max_atomic_width: Some(64),
|
||||
supported_split_debuginfo: Cow::Borrowed(&[SplitDebuginfo::Off]),
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use crate::spec::{Arch, StackProbeType, Target, TargetMetadata, TargetOptions, base};
|
||||
use crate::spec::{Arch, LlvmAbi, StackProbeType, Target, TargetMetadata, TargetOptions, base};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
Target {
|
||||
@@ -14,7 +14,7 @@ pub(crate) fn target() -> Target {
|
||||
arch: Arch::RiscV64,
|
||||
options: TargetOptions {
|
||||
cpu: "generic-rv64".into(),
|
||||
llvm_abiname: "lp64d".into(),
|
||||
llvm_abiname: LlvmAbi::Lp64d,
|
||||
max_atomic_width: Some(64),
|
||||
features: "+m,+a,+f,+d,+c,+zicsr,+zifencei".into(),
|
||||
stack_probes: StackProbeType::Inline,
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
use std::borrow::Cow;
|
||||
|
||||
use crate::spec::{Arch, CodeModel, SplitDebuginfo, Target, TargetMetadata, TargetOptions, base};
|
||||
use crate::spec::{
|
||||
Arch, CodeModel, LlvmAbi, SplitDebuginfo, Target, TargetMetadata, TargetOptions, base,
|
||||
};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
Target {
|
||||
@@ -18,7 +20,7 @@ pub(crate) fn target() -> Target {
|
||||
code_model: Some(CodeModel::Medium),
|
||||
cpu: "generic-rv64".into(),
|
||||
features: "+rva23u64".into(),
|
||||
llvm_abiname: "lp64d".into(),
|
||||
llvm_abiname: LlvmAbi::Lp64d,
|
||||
max_atomic_width: Some(64),
|
||||
supported_split_debuginfo: Cow::Borrowed(&[SplitDebuginfo::Off]),
|
||||
..base::linux_gnu::opts()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use crate::spec::{Arch, CodeModel, Target, TargetMetadata, TargetOptions, base};
|
||||
use crate::spec::{Arch, CodeModel, LlvmAbi, Target, TargetMetadata, TargetOptions, base};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
Target {
|
||||
@@ -16,7 +16,7 @@ pub(crate) fn target() -> Target {
|
||||
code_model: Some(CodeModel::Medium),
|
||||
cpu: "generic-rv64".into(),
|
||||
features: "+m,+a,+f,+d,+c,+zicsr,+zifencei".into(),
|
||||
llvm_abiname: "lp64d".into(),
|
||||
llvm_abiname: LlvmAbi::Lp64d,
|
||||
max_atomic_width: Some(64),
|
||||
..base::freebsd::opts()
|
||||
},
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
use crate::spec::{Arch, CodeModel, SanitizerSet, StackProbeType, Target, TargetMetadata, base};
|
||||
use crate::spec::{
|
||||
Arch, CodeModel, LlvmAbi, SanitizerSet, StackProbeType, Target, TargetMetadata, base,
|
||||
};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
let mut base = base::fuchsia::opts();
|
||||
base.code_model = Some(CodeModel::Medium);
|
||||
base.cpu = "generic-rv64".into();
|
||||
base.features = "+m,+a,+f,+d,+c,+zicsr,+zifencei".into();
|
||||
base.llvm_abiname = "lp64d".into();
|
||||
base.llvm_abiname = LlvmAbi::Lp64d;
|
||||
base.max_atomic_width = Some(64);
|
||||
base.stack_probes = StackProbeType::Inline;
|
||||
base.supported_sanitizers = SanitizerSet::SHADOWCALLSTACK;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use crate::spec::{
|
||||
Arch, CodeModel, RelocModel, Target, TargetMetadata, TargetOptions, TlsModel, base,
|
||||
Arch, CodeModel, LlvmAbi, RelocModel, Target, TargetMetadata, TargetOptions, TlsModel, base,
|
||||
};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
@@ -21,7 +21,7 @@ pub(crate) fn target() -> Target {
|
||||
code_model: Some(CodeModel::Medium),
|
||||
tls_model: TlsModel::LocalExec,
|
||||
max_atomic_width: Some(64),
|
||||
llvm_abiname: "lp64d".into(),
|
||||
llvm_abiname: LlvmAbi::Lp64d,
|
||||
..base::hermit::opts()
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
use std::borrow::Cow;
|
||||
|
||||
use crate::spec::{Arch, CodeModel, SplitDebuginfo, Target, TargetMetadata, TargetOptions, base};
|
||||
use crate::spec::{
|
||||
Arch, CodeModel, LlvmAbi, SplitDebuginfo, Target, TargetMetadata, TargetOptions, base,
|
||||
};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
Target {
|
||||
@@ -18,7 +20,7 @@ pub(crate) fn target() -> Target {
|
||||
code_model: Some(CodeModel::Medium),
|
||||
cpu: "generic-rv64".into(),
|
||||
features: "+m,+a,+f,+d,+c,+zicsr,+zifencei".into(),
|
||||
llvm_abiname: "lp64d".into(),
|
||||
llvm_abiname: LlvmAbi::Lp64d,
|
||||
max_atomic_width: Some(64),
|
||||
supported_split_debuginfo: Cow::Borrowed(&[SplitDebuginfo::Off]),
|
||||
..base::linux_gnu::opts()
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
use std::borrow::Cow;
|
||||
|
||||
use crate::spec::{Arch, CodeModel, SplitDebuginfo, Target, TargetMetadata, TargetOptions, base};
|
||||
use crate::spec::{
|
||||
Arch, CodeModel, LlvmAbi, SplitDebuginfo, Target, TargetMetadata, TargetOptions, base,
|
||||
};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
Target {
|
||||
@@ -18,7 +20,7 @@ pub(crate) fn target() -> Target {
|
||||
code_model: Some(CodeModel::Medium),
|
||||
cpu: "generic-rv64".into(),
|
||||
features: "+m,+a,+f,+d,+c,+zicsr,+zifencei".into(),
|
||||
llvm_abiname: "lp64d".into(),
|
||||
llvm_abiname: LlvmAbi::Lp64d,
|
||||
max_atomic_width: Some(64),
|
||||
supported_split_debuginfo: Cow::Borrowed(&[SplitDebuginfo::Off]),
|
||||
..base::linux_musl::opts()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use crate::spec::{Arch, CodeModel, Target, TargetOptions, base};
|
||||
use crate::spec::{Arch, CodeModel, LlvmAbi, Target, TargetOptions, base};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
Target {
|
||||
@@ -16,7 +16,7 @@ pub(crate) fn target() -> Target {
|
||||
code_model: Some(CodeModel::Medium),
|
||||
cpu: "generic-rv64".into(),
|
||||
features: "+m,+a,+f,+d,+c".into(),
|
||||
llvm_abiname: "lp64d".into(),
|
||||
llvm_abiname: LlvmAbi::Lp64d,
|
||||
max_atomic_width: Some(64),
|
||||
..base::managarm_mlibc::opts()
|
||||
},
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use crate::spec::{Arch, CodeModel, Target, TargetMetadata, TargetOptions, base};
|
||||
use crate::spec::{Arch, CodeModel, LlvmAbi, Target, TargetMetadata, TargetOptions, base};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
Target {
|
||||
@@ -16,7 +16,7 @@ pub(crate) fn target() -> Target {
|
||||
code_model: Some(CodeModel::Medium),
|
||||
cpu: "generic-rv64".into(),
|
||||
features: "+m,+a,+f,+d,+c,+zicsr,+zifencei".into(),
|
||||
llvm_abiname: "lp64d".into(),
|
||||
llvm_abiname: LlvmAbi::Lp64d,
|
||||
max_atomic_width: Some(64),
|
||||
mcount: "__mcount".into(),
|
||||
..base::netbsd::opts()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use crate::spec::{
|
||||
Arch, Cc, CodeModel, LinkerFlavor, Lld, PanicStrategy, RelocModel, SanitizerSet, Target,
|
||||
TargetMetadata, TargetOptions,
|
||||
Arch, Cc, CodeModel, LinkerFlavor, Lld, LlvmAbi, PanicStrategy, RelocModel, SanitizerSet,
|
||||
Target, TargetMetadata, TargetOptions,
|
||||
};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
@@ -19,7 +19,7 @@ pub(crate) fn target() -> Target {
|
||||
options: TargetOptions {
|
||||
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
|
||||
linker: Some("rust-lld".into()),
|
||||
llvm_abiname: "lp64d".into(),
|
||||
llvm_abiname: LlvmAbi::Lp64d,
|
||||
cpu: "generic-rv64".into(),
|
||||
max_atomic_width: Some(64),
|
||||
features: "+m,+a,+f,+d,+c,+zicsr,+zifencei".into(),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use crate::spec::{
|
||||
Arch, Cc, CodeModel, LinkerFlavor, Lld, Os, PanicStrategy, RelocModel, SanitizerSet, Target,
|
||||
TargetMetadata, TargetOptions, cvs,
|
||||
Arch, Cc, CodeModel, LinkerFlavor, Lld, LlvmAbi, Os, PanicStrategy, RelocModel, SanitizerSet,
|
||||
Target, TargetMetadata, TargetOptions, cvs,
|
||||
};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
@@ -21,7 +21,7 @@ pub(crate) fn target() -> Target {
|
||||
os: Os::NuttX,
|
||||
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
|
||||
linker: Some("rust-lld".into()),
|
||||
llvm_abiname: "lp64d".into(),
|
||||
llvm_abiname: LlvmAbi::Lp64d,
|
||||
cpu: "generic-rv64".into(),
|
||||
max_atomic_width: Some(64),
|
||||
features: "+m,+a,+f,+d,+c,+zicsr,+zifencei".into(),
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use crate::spec::{Arch, CodeModel, Target, TargetMetadata, TargetOptions, base};
|
||||
use crate::spec::{Arch, CodeModel, LlvmAbi, Target, TargetMetadata, TargetOptions, base};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
Target {
|
||||
@@ -16,7 +16,7 @@ pub(crate) fn target() -> Target {
|
||||
code_model: Some(CodeModel::Medium),
|
||||
cpu: "generic-rv64".into(),
|
||||
features: "+m,+a,+f,+d,+c,+zicsr,+zifencei".into(),
|
||||
llvm_abiname: "lp64d".into(),
|
||||
llvm_abiname: LlvmAbi::Lp64d,
|
||||
max_atomic_width: Some(64),
|
||||
..base::openbsd::opts()
|
||||
},
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
use crate::spec::{Arch, CodeModel, Target, TargetMetadata, base};
|
||||
use crate::spec::{Arch, CodeModel, LlvmAbi, Target, TargetMetadata, base};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
let mut base = base::redox::opts();
|
||||
base.code_model = Some(CodeModel::Medium);
|
||||
base.cpu = "generic-rv64".into();
|
||||
base.features = "+m,+a,+f,+d,+c".into();
|
||||
base.llvm_abiname = "lp64d".into();
|
||||
base.llvm_abiname = LlvmAbi::Lp64d;
|
||||
base.plt_by_default = false;
|
||||
base.max_atomic_width = Some(64);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use crate::spec::{
|
||||
Arch, Cc, CodeModel, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata,
|
||||
TargetOptions,
|
||||
Arch, Cc, CodeModel, LinkerFlavor, Lld, LlvmAbi, PanicStrategy, RelocModel, Target,
|
||||
TargetMetadata, TargetOptions,
|
||||
};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
@@ -23,7 +23,7 @@ pub(crate) fn target() -> Target {
|
||||
max_atomic_width: Some(64),
|
||||
atomic_cas: false,
|
||||
features: "+m,+forced-atomics".into(),
|
||||
llvm_abiname: "lp64".into(),
|
||||
llvm_abiname: LlvmAbi::Lp64,
|
||||
panic_strategy: PanicStrategy::Abort,
|
||||
relocation_model: RelocModel::Static,
|
||||
code_model: Some(CodeModel::Medium),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use crate::spec::{
|
||||
Arch, Cc, CodeModel, LinkerFlavor, Lld, PanicStrategy, RelocModel, SanitizerSet, Target,
|
||||
TargetMetadata, TargetOptions,
|
||||
Arch, Cc, CodeModel, LinkerFlavor, Lld, LlvmAbi, PanicStrategy, RelocModel, SanitizerSet,
|
||||
Target, TargetMetadata, TargetOptions,
|
||||
};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
@@ -22,7 +22,7 @@ pub(crate) fn target() -> Target {
|
||||
cpu: "generic-rv64".into(),
|
||||
max_atomic_width: Some(64),
|
||||
features: "+m,+a,+c".into(),
|
||||
llvm_abiname: "lp64".into(),
|
||||
llvm_abiname: LlvmAbi::Lp64,
|
||||
panic_strategy: PanicStrategy::Abort,
|
||||
relocation_model: RelocModel::Static,
|
||||
code_model: Some(CodeModel::Medium),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use crate::spec::{
|
||||
Arch, Cc, CodeModel, LinkerFlavor, Lld, Os, PanicStrategy, RelocModel, SanitizerSet, Target,
|
||||
TargetMetadata, TargetOptions, cvs,
|
||||
Arch, Cc, CodeModel, LinkerFlavor, Lld, LlvmAbi, Os, PanicStrategy, RelocModel, SanitizerSet,
|
||||
Target, TargetMetadata, TargetOptions, cvs,
|
||||
};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
@@ -24,7 +24,7 @@ pub(crate) fn target() -> Target {
|
||||
cpu: "generic-rv64".into(),
|
||||
max_atomic_width: Some(64),
|
||||
features: "+m,+a,+c".into(),
|
||||
llvm_abiname: "lp64".into(),
|
||||
llvm_abiname: LlvmAbi::Lp64,
|
||||
panic_strategy: PanicStrategy::Abort,
|
||||
relocation_model: RelocModel::Static,
|
||||
code_model: Some(CodeModel::Medium),
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
use rustc_macros::HashStable_Generic;
|
||||
use rustc_span::{Symbol, sym};
|
||||
|
||||
use crate::spec::{Arch, FloatAbi, RustcAbi, Target};
|
||||
use crate::spec::{Arch, FloatAbi, LlvmAbi, RustcAbi, Target};
|
||||
|
||||
/// Features that control behaviour of rustc, rather than the codegen.
|
||||
/// These exist globally and are not in the target-specific lists below.
|
||||
@@ -1174,20 +1174,20 @@ pub fn abi_required_features(&self) -> FeatureConstraints {
|
||||
Arch::RiscV32 | Arch::RiscV64 => {
|
||||
// RISC-V handles ABI in a very sane way, being fully explicit via `llvm_abiname`
|
||||
// about what the intended ABI is.
|
||||
match &*self.llvm_abiname {
|
||||
"ilp32d" | "lp64d" => {
|
||||
match &self.llvm_abiname {
|
||||
LlvmAbi::Ilp32d | LlvmAbi::Lp64d => {
|
||||
// Requires d (which implies f), incompatible with e and zfinx.
|
||||
FeatureConstraints { required: &["d"], incompatible: &["e", "zfinx"] }
|
||||
}
|
||||
"ilp32f" | "lp64f" => {
|
||||
LlvmAbi::Ilp32f | LlvmAbi::Lp64f => {
|
||||
// Requires f, incompatible with e and zfinx.
|
||||
FeatureConstraints { required: &["f"], incompatible: &["e", "zfinx"] }
|
||||
}
|
||||
"ilp32" | "lp64" => {
|
||||
LlvmAbi::Ilp32 | LlvmAbi::Lp64 => {
|
||||
// Requires nothing, incompatible with e.
|
||||
FeatureConstraints { required: &[], incompatible: &["e"] }
|
||||
}
|
||||
"ilp32e" => {
|
||||
LlvmAbi::Ilp32e => {
|
||||
// ilp32e is documented to be incompatible with features that need aligned
|
||||
// load/stores > 32 bits, like `d`. (One could also just generate more
|
||||
// complicated code to align the stack when needed, but the RISCV
|
||||
@@ -1198,7 +1198,7 @@ pub fn abi_required_features(&self) -> FeatureConstraints {
|
||||
// a program while the rest doesn't know they even exist.
|
||||
FeatureConstraints { required: &[], incompatible: &["d"] }
|
||||
}
|
||||
"lp64e" => {
|
||||
LlvmAbi::Lp64e => {
|
||||
// As above, `e` is not required.
|
||||
NOTHING
|
||||
}
|
||||
@@ -1208,16 +1208,16 @@ pub fn abi_required_features(&self) -> FeatureConstraints {
|
||||
Arch::LoongArch32 | Arch::LoongArch64 => {
|
||||
// LoongArch handles ABI in a very sane way, being fully explicit via `llvm_abiname`
|
||||
// about what the intended ABI is.
|
||||
match &*self.llvm_abiname {
|
||||
"ilp32d" | "lp64d" => {
|
||||
match &self.llvm_abiname {
|
||||
LlvmAbi::Ilp32d | LlvmAbi::Lp64d => {
|
||||
// Requires d (which implies f), incompatible with nothing.
|
||||
FeatureConstraints { required: &["d"], incompatible: &[] }
|
||||
}
|
||||
"ilp32f" | "lp64f" => {
|
||||
LlvmAbi::Ilp32f | LlvmAbi::Lp64f => {
|
||||
// Requires f, incompatible with nothing.
|
||||
FeatureConstraints { required: &["f"], incompatible: &[] }
|
||||
}
|
||||
"ilp32s" | "lp64s" => {
|
||||
LlvmAbi::Ilp32s | LlvmAbi::Lp64s => {
|
||||
// The soft-float ABI does not require any features and is also not
|
||||
// incompatible with any features. Rust targets explicitly specify the
|
||||
// LLVM ABI names, which allows for enabling hard-float support even on
|
||||
|
||||
Reference in New Issue
Block a user