Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
librustc_target: Initial support for riscv32gc_unknown_linux_gnu
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
- Loading branch information
1 parent
9b41541
commit a4183f0
Showing
2 changed files
with
26 additions
and
0 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
25 changes: 25 additions & 0 deletions
25
compiler/rustc_target/src/spec/riscv32gc_unknown_linux_gnu.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,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 { | ||
abi_blacklist: super::riscv_base::abi_blacklist(), | ||
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() | ||
}, | ||
}) | ||
} |