]> git.lizzy.rs Git - rust.git/blob - src/librustc_target/spec/riscv32imac_unknown_none_elf.rs
Enable RISC-V atomic compare and swap
[rust.git] / src / librustc_target / spec / riscv32imac_unknown_none_elf.rs
1 // Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 use spec::{LinkerFlavor, LldFlavor, PanicStrategy,
12            Target, TargetOptions, TargetResult};
13
14 pub fn target() -> TargetResult {
15     Ok(Target {
16         data_layout: "e-m:e-p:32:32-i64:64-n32-S128".to_string(),
17         llvm_target: "riscv32".to_string(),
18         target_endian: "little".to_string(),
19         target_pointer_width: "32".to_string(),
20         target_c_int_width: "32".to_string(),
21         target_os: "none".to_string(),
22         target_env: String::new(),
23         target_vendor: "unknown".to_string(),
24         arch: "riscv32".to_string(),
25         linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
26
27         options: TargetOptions {
28             linker: Some("rust-lld".to_string()),
29             cpu: "generic-rv32".to_string(),
30             max_atomic_width: Some(32),
31             atomic_cas: true,
32             features: "+m,+a,+c".to_string(),
33             executables: true,
34             panic_strategy: PanicStrategy::Abort,
35             relocation_model: "static".to_string(),
36             emit_debug_gdb_scripts: false,
37             abi_blacklist: super::riscv_base::abi_blacklist(),
38             .. Default::default()
39         },
40     })
41 }