|
| 1 | +use crate::spec::{ |
| 2 | + Arch, CodeModel, LinkerFlavor, Lld, PanicStrategy, RelocModel, |
| 3 | + Target, TargetOptions, TargetMetadata, Os |
| 4 | +}; |
| 5 | + |
| 6 | +pub(crate) fn target() -> Target { |
| 7 | + Target { |
| 8 | + data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(), |
| 9 | + metadata: TargetMetadata { |
| 10 | + description: Some("Bare RISC-V (RV64IMAFDC ISA) UEFI".into()), |
| 11 | + tier: Some(3), |
| 12 | + host_tools: Some(false), |
| 13 | + std: Some(false), |
| 14 | + }, |
| 15 | + llvm_target: "riscv64gc-unknown-windows".into(), |
| 16 | + pointer_width: 64, |
| 17 | + arch: Arch::RiscV64, |
| 18 | + |
| 19 | + options: TargetOptions { |
| 20 | + os: Os::Uefi, |
| 21 | + vendor: "unknown".into(), |
| 22 | + linker_flavor: LinkerFlavor::Msvc(Lld::No), |
| 23 | + |
| 24 | + // UEFI characteristics |
| 25 | + executables: true, |
| 26 | + is_like_windows: true, |
| 27 | + panic_strategy: PanicStrategy::Abort, |
| 28 | + relocation_model: RelocModel::Pic, |
| 29 | + |
| 30 | + // RISC-V features |
| 31 | + cpu: "generic-rv64".into(), |
| 32 | + features: "+m,+a,+f,+d,+c".into(), |
| 33 | + |
| 34 | + // These are the current correct field names: |
| 35 | + is_like_aix: false, |
| 36 | + is_like_android: false, |
| 37 | + is_like_msvc: true, |
| 38 | + |
| 39 | + // Codegen options |
| 40 | + code_model: Some(CodeModel::Medium), |
| 41 | + disable_redzone: true, |
| 42 | + ..Default::default() |
| 43 | + }, |
| 44 | + } |
| 45 | +} |
0 commit comments