Always specify llvm_abiname
for RISC-V targets
This commit is contained in:
parent
7342830c05
commit
3ea91c05db
16 changed files with 71 additions and 1 deletions
|
@ -20,6 +20,7 @@ pub(crate) fn target() -> Target {
|
|||
max_atomic_width: Some(32),
|
||||
atomic_cas: false,
|
||||
features: "+forced-atomics".into(),
|
||||
llvm_abiname: "ilp32".into(),
|
||||
panic_strategy: PanicStrategy::Abort,
|
||||
relocation_model: RelocModel::Static,
|
||||
emit_debug_gdb_scripts: false,
|
||||
|
|
|
@ -29,6 +29,7 @@ pub(crate) fn target() -> Target {
|
|||
atomic_cas: true,
|
||||
|
||||
features: "+m".into(),
|
||||
llvm_abiname: "ilp32".into(),
|
||||
executables: true,
|
||||
panic_strategy: PanicStrategy::Abort,
|
||||
relocation_model: RelocModel::Static,
|
||||
|
|
|
@ -20,6 +20,7 @@ pub(crate) fn target() -> Target {
|
|||
max_atomic_width: Some(32),
|
||||
atomic_cas: false,
|
||||
features: "+m,+forced-atomics".into(),
|
||||
llvm_abiname: "ilp32".into(),
|
||||
panic_strategy: PanicStrategy::Abort,
|
||||
relocation_model: RelocModel::Static,
|
||||
emit_debug_gdb_scripts: false,
|
||||
|
|
|
@ -19,6 +19,7 @@ pub(crate) fn target() -> Target {
|
|||
cpu: "generic-rv32".into(),
|
||||
max_atomic_width: Some(32),
|
||||
features: "+m,+a".into(),
|
||||
llvm_abiname: "ilp32".into(),
|
||||
panic_strategy: PanicStrategy::Abort,
|
||||
relocation_model: RelocModel::Static,
|
||||
emit_debug_gdb_scripts: false,
|
||||
|
|
|
@ -27,6 +27,7 @@ pub(crate) fn target() -> Target {
|
|||
atomic_cas: true,
|
||||
|
||||
features: "+m,+a,+c".into(),
|
||||
llvm_abiname: "ilp32".into(),
|
||||
panic_strategy: PanicStrategy::Abort,
|
||||
relocation_model: RelocModel::Static,
|
||||
emit_debug_gdb_scripts: false,
|
||||
|
|
|
@ -19,6 +19,7 @@ pub(crate) fn target() -> Target {
|
|||
cpu: "generic-rv32".into(),
|
||||
max_atomic_width: Some(32),
|
||||
features: "+m,+a,+c".into(),
|
||||
llvm_abiname: "ilp32".into(),
|
||||
panic_strategy: PanicStrategy::Abort,
|
||||
relocation_model: RelocModel::Static,
|
||||
emit_debug_gdb_scripts: false,
|
||||
|
|
|
@ -21,6 +21,7 @@ pub(crate) fn target() -> Target {
|
|||
cpu: "generic-rv32".into(),
|
||||
max_atomic_width: Some(32),
|
||||
features: "+m,+a,+c".into(),
|
||||
llvm_abiname: "ilp32".into(),
|
||||
panic_strategy: PanicStrategy::Unwind,
|
||||
relocation_model: RelocModel::Static,
|
||||
..Default::default()
|
||||
|
|
|
@ -20,6 +20,7 @@ pub(crate) fn target() -> Target {
|
|||
cpu: "generic-rv32".into(),
|
||||
max_atomic_width: Some(32),
|
||||
features: "+m,+a,+c".into(),
|
||||
llvm_abiname: "ilp32".into(),
|
||||
panic_strategy: PanicStrategy::Unwind,
|
||||
relocation_model: RelocModel::Static,
|
||||
..Default::default()
|
||||
|
|
|
@ -30,6 +30,7 @@ pub(crate) fn target() -> Target {
|
|||
atomic_cas: true,
|
||||
|
||||
features: "+m,+c".into(),
|
||||
llvm_abiname: "ilp32".into(),
|
||||
panic_strategy: PanicStrategy::Abort,
|
||||
relocation_model: RelocModel::Static,
|
||||
emit_debug_gdb_scripts: false,
|
||||
|
|
|
@ -20,6 +20,7 @@ pub(crate) fn target() -> Target {
|
|||
max_atomic_width: Some(32),
|
||||
atomic_cas: false,
|
||||
features: "+m,+c,+forced-atomics".into(),
|
||||
llvm_abiname: "ilp32".into(),
|
||||
panic_strategy: PanicStrategy::Abort,
|
||||
relocation_model: RelocModel::Static,
|
||||
emit_debug_gdb_scripts: false,
|
||||
|
|
|
@ -21,6 +21,7 @@ pub(crate) fn target() -> Target {
|
|||
cpu: "generic-rv32".into(),
|
||||
max_atomic_width: Some(32),
|
||||
features: "+m,+c".into(),
|
||||
llvm_abiname: "ilp32".into(),
|
||||
panic_strategy: PanicStrategy::Unwind,
|
||||
relocation_model: RelocModel::Static,
|
||||
..Default::default()
|
||||
|
|
|
@ -22,6 +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(),
|
||||
panic_strategy: PanicStrategy::Abort,
|
||||
relocation_model: RelocModel::Static,
|
||||
code_model: Some(CodeModel::Medium),
|
||||
|
|
|
@ -24,6 +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(),
|
||||
panic_strategy: PanicStrategy::Abort,
|
||||
relocation_model: RelocModel::Static,
|
||||
code_model: Some(CodeModel::Medium),
|
||||
|
|
|
@ -152,6 +152,17 @@ impl Target {
|
|||
if self.crt_static_default || self.crt_static_allows_dylibs {
|
||||
assert!(self.crt_static_respected);
|
||||
}
|
||||
|
||||
// Check that RISC-V targets always specify which ABI they use.
|
||||
match &*self.arch {
|
||||
"riscv32" => {
|
||||
assert_matches!(&*self.llvm_abiname, "ilp32" | "ilp32f" | "ilp32d" | "ilp32e")
|
||||
}
|
||||
"riscv64" => {
|
||||
assert_matches!(&*self.llvm_abiname, "lp64" | "lp64f" | "lp64d" | "lp64q")
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
// Add your target to the whitelist if it has `std` library
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue