1 use crate::spec::{cvs, PanicStrategy, RelocModel, Target, TargetOptions};
3 pub fn target() -> Target {
5 data_layout: "e-m:e-p:32:32-i64:64-n32-S128".into(),
6 llvm_target: "riscv32".into(),
8 arch: "riscv32".into(),
10 options: TargetOptions {
11 families: cvs!["unix"],
14 vendor: "espressif".into(),
15 linker: Some("riscv32-esp-elf-gcc".into()),
16 cpu: "generic-rv32".into(),
18 // While the RiscV32IMC architecture does not natively support atomics, ESP-IDF does support
19 // the __atomic* and __sync* GCC builtins, so setting `max_atomic_width` to `Some(64)`
20 // and `atomic_cas` to `true` will cause the compiler to emit libcalls to these builtins.
22 // Support for atomics is necessary for the Rust STD library, which is supported by the ESP-IDF framework.
23 max_atomic_width: Some(64),
26 features: "+m,+c".into(),
27 panic_strategy: PanicStrategy::Abort,
28 relocation_model: RelocModel::Static,
29 emit_debug_gdb_scripts: false,
30 eh_frame_header: false,