1
Fork 0

compiler: Set target_abi = "ilp32e" on all riscv32e targets

This allows compile-time configuration based on this.
In the near future we should do this across all RISCV targets, probably,
but this cfg is essential for building software usable on these targets.
This commit is contained in:
Jubilee Young 2024-12-15 15:28:17 -08:00
parent c26db435bf
commit 9a81dc97fb
4 changed files with 10 additions and 4 deletions

View file

@ -1,6 +1,7 @@
use crate::spec::{Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetOptions};
pub(crate) fn target() -> Target {
let abi = "ilp32e";
Target {
// The below `data_layout` is explicitly specified by the ilp32e ABI in LLVM. See also
// `options.llvm_abiname`.
@ -16,11 +17,12 @@ pub(crate) fn target() -> Target {
arch: "riscv32".into(),
options: TargetOptions {
abi: abi.into(),
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
linker: Some("rust-lld".into()),
cpu: "generic-rv32".into(),
// The ilp32e ABI specifies the `data_layout`
llvm_abiname: "ilp32e".into(),
llvm_abiname: abi.into(),
max_atomic_width: Some(32),
atomic_cas: false,
features: "+e,+forced-atomics".into(),

View file

@ -1,6 +1,7 @@
use crate::spec::{Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetOptions};
pub(crate) fn target() -> Target {
let abi = "ilp32e";
Target {
// The below `data_layout` is explicitly specified by the ilp32e ABI in LLVM. See also
// `options.llvm_abiname`.
@ -16,11 +17,12 @@ pub(crate) fn target() -> Target {
arch: "riscv32".into(),
options: TargetOptions {
abi: abi.into(),
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
linker: Some("rust-lld".into()),
cpu: "generic-rv32".into(),
// The ilp32e ABI specifies the `data_layout`
llvm_abiname: "ilp32e".into(),
llvm_abiname: abi.into(),
max_atomic_width: Some(32),
atomic_cas: false,
features: "+e,+m,+forced-atomics".into(),

View file

@ -1,6 +1,7 @@
use crate::spec::{Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetOptions};
pub(crate) fn target() -> Target {
let abi = "ilp32e";
Target {
// The below `data_layout` is explicitly specified by the ilp32e ABI in LLVM. See also
// `options.llvm_abiname`.
@ -16,11 +17,12 @@ pub(crate) fn target() -> Target {
arch: "riscv32".into(),
options: TargetOptions {
abi: abi.into(),
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
linker: Some("rust-lld".into()),
cpu: "generic-rv32".into(),
// The ilp32e ABI specifies the `data_layout`
llvm_abiname: "ilp32e".into(),
llvm_abiname: abi.into(),
max_atomic_width: Some(32),
atomic_cas: false,
features: "+e,+m,+c,+forced-atomics".into(),