Add no_std Xtensa targets support
This commit is contained in:
parent
e823288c35
commit
11f70d78f5
11 changed files with 138 additions and 2 deletions
|
@ -35,3 +35,4 @@ pub(crate) mod windows_gnullvm;
|
|||
pub(crate) mod windows_msvc;
|
||||
pub(crate) mod windows_uwp_gnu;
|
||||
pub(crate) mod windows_uwp_msvc;
|
||||
pub(crate) mod xtensa;
|
||||
|
|
17
compiler/rustc_target/src/spec/base/xtensa.rs
Normal file
17
compiler/rustc_target/src/spec/base/xtensa.rs
Normal file
|
@ -0,0 +1,17 @@
|
|||
use crate::abi::Endian;
|
||||
use crate::spec::{Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, TargetOptions};
|
||||
|
||||
pub fn opts() -> TargetOptions {
|
||||
TargetOptions {
|
||||
os: "none".into(),
|
||||
endian: Endian::Little,
|
||||
c_int_width: "32".into(),
|
||||
linker_flavor: LinkerFlavor::Gnu(Cc::Yes, Lld::No),
|
||||
executables: true,
|
||||
panic_strategy: PanicStrategy::Abort,
|
||||
relocation_model: RelocModel::Static,
|
||||
emit_debug_gdb_scripts: false,
|
||||
atomic_cas: false,
|
||||
..Default::default()
|
||||
}
|
||||
}
|
|
@ -1766,6 +1766,10 @@ supported_targets! {
|
|||
|
||||
("nvptx64-nvidia-cuda", nvptx64_nvidia_cuda),
|
||||
|
||||
("xtensa-esp32-none-elf", xtensa_esp32_none_elf),
|
||||
("xtensa-esp32s2-none-elf", xtensa_esp32s2_none_elf),
|
||||
("xtensa-esp32s3-none-elf", xtensa_esp32s3_none_elf),
|
||||
|
||||
("i686-wrs-vxworks", i686_wrs_vxworks),
|
||||
("x86_64-wrs-vxworks", x86_64_wrs_vxworks),
|
||||
("armv7-wrs-vxworks-eabihf", armv7_wrs_vxworks_eabihf),
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
use crate::spec::{base::xtensa, Target, TargetOptions};
|
||||
|
||||
pub fn target() -> Target {
|
||||
Target {
|
||||
llvm_target: "xtensa-none-elf".into(),
|
||||
pointer_width: 32,
|
||||
data_layout: "e-m:e-p:32:32-v1:8:8-i64:64-i128:128-n32".into(),
|
||||
arch: "xtensa".into(),
|
||||
metadata: crate::spec::TargetMetadata {
|
||||
description: Some("Xtensa ESP32".into()),
|
||||
tier: Some(3),
|
||||
host_tools: Some(false),
|
||||
std: Some(false),
|
||||
},
|
||||
|
||||
options: TargetOptions {
|
||||
cpu: "esp32".into(),
|
||||
linker: Some("xtensa-esp32-elf-gcc".into()),
|
||||
max_atomic_width: Some(32),
|
||||
atomic_cas: true,
|
||||
..xtensa::opts()
|
||||
},
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
use crate::spec::{base::xtensa, Target, TargetOptions};
|
||||
|
||||
pub fn target() -> Target {
|
||||
Target {
|
||||
llvm_target: "xtensa-none-elf".into(),
|
||||
pointer_width: 32,
|
||||
data_layout: "e-m:e-p:32:32-v1:8:8-i64:64-i128:128-n32".into(),
|
||||
arch: "xtensa".into(),
|
||||
metadata: crate::spec::TargetMetadata {
|
||||
description: Some("Xtensa ESP32-S2".into()),
|
||||
tier: Some(3),
|
||||
host_tools: Some(false),
|
||||
std: Some(false),
|
||||
},
|
||||
|
||||
options: TargetOptions {
|
||||
cpu: "esp32-s2".into(),
|
||||
linker: Some("xtensa-esp32s2-elf-gcc".into()),
|
||||
max_atomic_width: Some(32),
|
||||
..xtensa::opts()
|
||||
},
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
use crate::spec::{base::xtensa, Target, TargetOptions};
|
||||
|
||||
pub fn target() -> Target {
|
||||
Target {
|
||||
llvm_target: "xtensa-none-elf".into(),
|
||||
pointer_width: 32,
|
||||
data_layout: "e-m:e-p:32:32-v1:8:8-i64:64-i128:128-n32".into(),
|
||||
arch: "xtensa".into(),
|
||||
metadata: crate::spec::TargetMetadata {
|
||||
description: Some("Xtensa ESP32-S3".into()),
|
||||
tier: Some(3),
|
||||
host_tools: Some(false),
|
||||
std: Some(false),
|
||||
},
|
||||
|
||||
options: TargetOptions {
|
||||
cpu: "esp32-s3".into(),
|
||||
linker: Some("xtensa-esp32s3-elf-gcc".into()),
|
||||
max_atomic_width: Some(32),
|
||||
atomic_cas: true,
|
||||
..xtensa::opts()
|
||||
},
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue