forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#131302 - matthiaskrgr:rollup-56kbpzx, r=matth…
…iaskrgr Rollup of 5 pull requests Successful merges: - rust-lang#130555 ( Initial support for riscv32{e|em|emc}_unknown_none_elf) - rust-lang#131280 (Handle `rustc_interface` cases of `rustc::potential_query_instability` lint) - rust-lang#131281 (make Cell unstably const) - rust-lang#131285 (clarify semantics of ConstantIndex MIR projection) - rust-lang#131299 (fix typo in 'lang item with track_caller' message) r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
19 changed files
with
847 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
compiler/rustc_target/src/spec/targets/riscv32e_unknown_none_elf.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
use crate::spec::{Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetOptions}; | ||
|
||
pub(crate) fn target() -> Target { | ||
Target { | ||
// The below `data_layout` is explicitly specified by the ilp32e ABI in LLVM. See also | ||
// `options.llvm_abiname`. | ||
data_layout: "e-m:e-p:32:32-i64:64-n32-S32".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(), | ||
// The ilp32e ABI specifies the `data_layout` | ||
llvm_abiname: "ilp32e".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() | ||
}, | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
compiler/rustc_target/src/spec/targets/riscv32em_unknown_none_elf.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
use crate::spec::{Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetOptions}; | ||
|
||
pub(crate) fn target() -> Target { | ||
Target { | ||
// The below `data_layout` is explicitly specified by the ilp32e ABI in LLVM. See also | ||
// `options.llvm_abiname`. | ||
data_layout: "e-m:e-p:32:32-i64:64-n32-S32".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(), | ||
// The ilp32e ABI specifies the `data_layout` | ||
llvm_abiname: "ilp32e".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() | ||
}, | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
compiler/rustc_target/src/spec/targets/riscv32emc_unknown_none_elf.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
use crate::spec::{Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetOptions}; | ||
|
||
pub(crate) fn target() -> Target { | ||
Target { | ||
// The below `data_layout` is explicitly specified by the ilp32e ABI in LLVM. See also | ||
// `options.llvm_abiname`. | ||
data_layout: "e-m:e-p:32:32-i64:64-n32-S32".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(), | ||
// The ilp32e ABI specifies the `data_layout` | ||
llvm_abiname: "ilp32e".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() | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/doc/rustc/src/platform-support/riscv32e-unknown-none-elf.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# `riscv32{e,em,emc}-unknown-none-elf` | ||
|
||
**Tier: 3** | ||
|
||
Bare-metal target for RISC-V CPUs with the RV32E, RV32EM and RV32EMC ISAs. | ||
|
||
## Target maintainers | ||
|
||
* Henri Lunnikivi, <[email protected]>, [@hegza](https://github.com/hegza) | ||
|
||
## Requirements | ||
|
||
The target is cross-compiled, and uses static linking. No external toolchain is | ||
required and the default `rust-lld` linker works, but you must specify a linker | ||
script. | ||
|
||
## Building the target | ||
|
||
This target is included in Rust and can be installed via `rustup`. | ||
|
||
## Testing | ||
|
||
This is a cross-compiled `no-std` target, which must be run either in a | ||
simulator or by programming them onto suitable hardware. It is not possible to | ||
run the Rust test-suite on this target. | ||
|
||
## Cross-compilation toolchains and C code | ||
|
||
This target supports C code. If interlinking with C or C++, you may need to use | ||
`riscv32-unknown-elf-gcc` as a linker instead of `rust-lld`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.