-
Notifications
You must be signed in to change notification settings - Fork 12.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial support for riscv32{e|em|emc}_unknown_none_elf #130555
base: master
Are you sure you want to change the base?
Changes from all commits
22b8aca
567c27a
7b8e249
789ddc1
2d6cc54
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
use crate::spec::{Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetOptions}; | ||
|
||
pub(crate) fn target() -> Target { | ||
Target { | ||
data_layout: "e-m:e-p:32:32-i64:64-n32-S128".into(), | ||
llvm_target: "riscv32".into(), | ||
metadata: crate::spec::TargetMetadata { | ||
description: Some("Bare RISC-V (RV32E ISA)".into()), | ||
tier: Some(3), | ||
host_tools: Some(false), | ||
std: Some(false), | ||
}, | ||
pointer_width: 32, | ||
arch: "riscv32".into(), | ||
|
||
options: TargetOptions { | ||
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes), | ||
linker: Some("rust-lld".into()), | ||
cpu: "generic-rv32".into(), | ||
max_atomic_width: Some(32), | ||
atomic_cas: false, | ||
features: "+e,+forced-atomics".into(), | ||
panic_strategy: PanicStrategy::Abort, | ||
relocation_model: RelocModel::Static, | ||
emit_debug_gdb_scripts: false, | ||
eh_frame_header: false, | ||
..Default::default() | ||
}, | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
use crate::spec::{Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetOptions}; | ||
|
||
pub(crate) fn target() -> Target { | ||
Target { | ||
data_layout: "e-m:e-p:32:32-i64:64-n32-S128".into(), | ||
llvm_target: "riscv32".into(), | ||
metadata: crate::spec::TargetMetadata { | ||
description: Some("Bare RISC-V (RV32EM ISA)".into()), | ||
tier: Some(3), | ||
host_tools: Some(false), | ||
std: Some(false), | ||
}, | ||
pointer_width: 32, | ||
arch: "riscv32".into(), | ||
|
||
options: TargetOptions { | ||
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes), | ||
linker: Some("rust-lld".into()), | ||
cpu: "generic-rv32".into(), | ||
max_atomic_width: Some(32), | ||
atomic_cas: false, | ||
features: "+e,+m,+forced-atomics".into(), | ||
panic_strategy: PanicStrategy::Abort, | ||
relocation_model: RelocModel::Static, | ||
emit_debug_gdb_scripts: false, | ||
eh_frame_header: false, | ||
..Default::default() | ||
}, | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
use crate::spec::{Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetOptions}; | ||
|
||
pub(crate) fn target() -> Target { | ||
Target { | ||
data_layout: "e-m:e-p:32:32-i64:64-n32-S128".into(), | ||
llvm_target: "riscv32".into(), | ||
metadata: crate::spec::TargetMetadata { | ||
description: Some("Bare RISC-V (RV32EMC ISA)".into()), | ||
tier: Some(3), | ||
host_tools: Some(false), | ||
std: Some(false), | ||
}, | ||
pointer_width: 32, | ||
arch: "riscv32".into(), | ||
|
||
options: TargetOptions { | ||
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes), | ||
linker: Some("rust-lld".into()), | ||
cpu: "generic-rv32".into(), | ||
max_atomic_width: Some(32), | ||
atomic_cas: false, | ||
features: "+e,+m,+c,+forced-atomics".into(), | ||
panic_strategy: PanicStrategy::Abort, | ||
relocation_model: RelocModel::Static, | ||
emit_debug_gdb_scripts: false, | ||
eh_frame_header: false, | ||
..Default::default() | ||
}, | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
# `riscv32{i,im,ima,imc,imac,imafc}-unknown-none-elf` | ||
# `riscv32{i,im,ima,imc,imac,imafc,e,em,emc}-unknown-none-elf` | ||
|
||
**Tier: 2** | ||
|
||
Bare-metal target for RISC-V CPUs with the RV32I, RV32IM, RV32IMC, RV32IMAFC and RV32IMAC ISAs. | ||
|
||
**Tier: 3** | ||
|
||
Bare-metal target for RISC-V CPUs with the RV32IMA ISA. | ||
Bare-metal target for RISC-V CPUs with the RV32IMA, RV32E, RV32EM and RV32EMC ISAs. | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or we can add documentation that we don't actually generate code with a 4-byte stack alignment, but rather to a 16-byte stack alignment, which is I guess technically acceptable even if it is incorrect. |
||
## Target maintainers | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did the RISC-V team agree to provide maintenance for the RV32E* targets? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oops, I did not mean to imply that 🙂 I'll remove the mention from this file. |
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -441,6 +441,15 @@ | |
//@ revisions: riscv64imac_unknown_none_elf | ||
//@ [riscv64imac_unknown_none_elf] compile-flags: --target riscv64imac-unknown-none-elf | ||
//@ [riscv64imac_unknown_none_elf] needs-llvm-components: riscv | ||
//@ revisions: riscv32e_unknown_none_elf | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It might be a good idea to move these new comments above so that the list is ordered. |
||
//@ [riscv32e_unknown_none_elf] compile-flags: --target riscv32e-unknown-none-elf | ||
//@ [riscv32e_unknown_none_elf] needs-llvm-components: riscv | ||
//@ revisions: riscv32em_unknown_none_elf | ||
//@ [riscv32em_unknown_none_elf] compile-flags: --target riscv32em-unknown-none-elf | ||
//@ [riscv32em_unknown_none_elf] needs-llvm-components: riscv | ||
//@ revisions: riscv32emc_unknown_none_elf | ||
//@ [riscv32emc_unknown_none_elf] compile-flags: --target riscv32emc-unknown-none-elf | ||
//@ [riscv32emc_unknown_none_elf] needs-llvm-components: riscv | ||
//@ revisions: s390x_unknown_linux_gnu | ||
//@ [s390x_unknown_linux_gnu] compile-flags: --target s390x-unknown-linux-gnu | ||
//@ [s390x_unknown_linux_gnu] needs-llvm-components: systemz | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can either fix this to be correct for the RV32E targets...