Rollup merge of #76048 - alistair23:alistair/rv32-linux, r=Amanieu

Initial support for riscv32gc_unknown_linux_gnu

Now that RISC-V 32-bit (RV32) support is in upstream glibc let's add support for userspace Rust.
This commit is contained in:
Dylan DPC 2020-09-16 01:30:40 +02:00 committed by GitHub
commit db228987ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 0 deletions

View File

@ -654,6 +654,7 @@ supported_targets! {
("riscv32i-unknown-none-elf", riscv32i_unknown_none_elf),
("riscv32imc-unknown-none-elf", riscv32imc_unknown_none_elf),
("riscv32imac-unknown-none-elf", riscv32imac_unknown_none_elf),
("riscv32gc-unknown-linux-gnu", riscv32gc_unknown_linux_gnu),
("riscv64imac-unknown-none-elf", riscv64imac_unknown_none_elf),
("riscv64gc-unknown-none-elf", riscv64gc_unknown_none_elf),
("riscv64gc-unknown-linux-gnu", riscv64gc_unknown_linux_gnu),

View File

@ -0,0 +1,25 @@
use crate::spec::{CodeModel, LinkerFlavor, Target, TargetOptions, TargetResult};
pub fn target() -> TargetResult {
Ok(Target {
llvm_target: "riscv32-unknown-linux-gnu".to_string(),
target_endian: "little".to_string(),
target_pointer_width: "32".to_string(),
target_c_int_width: "32".to_string(),
target_env: "gnu".to_string(),
data_layout: "e-m:e-p:32:32-i64:64-n32-S128".to_string(),
arch: "riscv32".to_string(),
target_os: "linux".to_string(),
target_vendor: "unknown".to_string(),
linker_flavor: LinkerFlavor::Gcc,
options: TargetOptions {
unsupported_abis: super::riscv_base::unsupported_abis(),
code_model: Some(CodeModel::Medium),
cpu: "generic-rv32".to_string(),
features: "+m,+a,+f,+d,+c".to_string(),
llvm_abiname: "ilp32d".to_string(),
max_atomic_width: Some(32),
..super::linux_base::opts()
},
})
}

View File

@ -195,6 +195,7 @@ target | std | host | notes
`powerpc64-unknown-linux-musl` | ? | |
`powerpc64-wrs-vxworks` | ? | |
`powerpc64le-unknown-linux-musl` | ? | |
`riscv32gc-unknown-linux-gnu` | | | RISC-V Linux (kernel 5.4, glibc 2.33)
`sparc-unknown-linux-gnu` | ✓ | | 32-bit SPARC Linux
`sparc64-unknown-netbsd` | ✓ | ✓ | NetBSD/sparc64
`sparc64-unknown-openbsd` | ? | |