forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ESP32, ESP8266 and a generic Xtensa target.
- Loading branch information
Showing
4 changed files
with
144 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
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,47 @@ | ||
use crate::spec::{abi::Abi, LinkerFlavor, PanicStrategy, Target, TargetOptions, RelocModel}; | ||
|
||
pub fn target() -> Target { | ||
Target { | ||
llvm_target: "xtensa-none-elf".to_string(), | ||
pointer_width: 32, | ||
data_layout: "e-m:e-p:32:32-i8:8:32-i16:16:32-i64:64-n32".to_string(), | ||
arch: "xtensa".to_string(), | ||
|
||
options: TargetOptions { | ||
endian: "little".to_string(), | ||
c_int_width: "32".to_string(), | ||
os: "none".to_string(), | ||
env: String::new(), | ||
vendor: String::new(), | ||
linker_flavor: LinkerFlavor::Gcc, | ||
|
||
executables: true, | ||
cpu: "esp32".to_string(), | ||
linker: Some("xtensa-esp32-elf-gcc".to_string()), | ||
|
||
max_atomic_width: Some(32), | ||
|
||
// Because these devices have very little resources having an | ||
// unwinder is too onerous so we default to "abort" because the | ||
// "unwind" strategy is very rare. | ||
panic_strategy: PanicStrategy::Abort, | ||
|
||
// Similarly, one almost always never wants to use relocatable | ||
// code because of the extra costs it involves. | ||
relocation_model: RelocModel::Static, | ||
|
||
emit_debug_gdb_scripts: false, | ||
|
||
unsupported_abis: vec![ | ||
Abi::Stdcall, | ||
Abi::Fastcall, | ||
Abi::Vectorcall, | ||
Abi::Thiscall, | ||
Abi::Win64, | ||
Abi::SysV64, | ||
], | ||
|
||
..Default::default() | ||
}, | ||
} | ||
} |
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,47 @@ | ||
use crate::spec::{abi::Abi, LinkerFlavor, PanicStrategy, Target, TargetOptions, RelocModel}; | ||
|
||
pub fn target() -> Target { | ||
Target { | ||
llvm_target: "xtensa-none-elf".to_string(), | ||
pointer_width: 32, | ||
data_layout: "e-m:e-p:32:32-i8:8:32-i16:16:32-i64:64-n32".to_string(), | ||
arch: "xtensa".to_string(), | ||
|
||
options: TargetOptions { | ||
endian: "little".to_string(), | ||
c_int_width: "32".to_string(), | ||
os: "none".to_string(), | ||
env: String::new(), | ||
vendor: String::new(), | ||
linker_flavor: LinkerFlavor::Gcc, | ||
|
||
executables: true, | ||
cpu: "esp8266".to_string(), | ||
linker: Some("xtensa-lx106-elf-gcc".to_string()), | ||
|
||
max_atomic_width: Some(32), | ||
|
||
// Because these devices have very little resources having an | ||
// unwinder is too onerous so we default to "abort" because the | ||
// "unwind" strategy is very rare. | ||
panic_strategy: PanicStrategy::Abort, | ||
|
||
// Similarly, one almost always never wants to use relocatable | ||
// code because of the extra costs it involves. | ||
relocation_model: RelocModel::Static, | ||
|
||
emit_debug_gdb_scripts: false, | ||
|
||
unsupported_abis: vec![ | ||
Abi::Stdcall, | ||
Abi::Fastcall, | ||
Abi::Vectorcall, | ||
Abi::Thiscall, | ||
Abi::Win64, | ||
Abi::SysV64, | ||
], | ||
|
||
..Default::default() | ||
}, | ||
} | ||
} |
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,46 @@ | ||
use crate::spec::{abi::Abi, LinkerFlavor, PanicStrategy, Target, TargetOptions, RelocModel}; | ||
|
||
pub fn target() -> Target { | ||
Target { | ||
llvm_target: "xtensa-none-elf".to_string(), | ||
pointer_width: 32, | ||
data_layout: "e-m:e-p:32:32-i8:8:32-i16:16:32-i64:64-n32".to_string(), | ||
arch: "xtensa".to_string(), | ||
|
||
options: TargetOptions { | ||
endian: "little".to_string(), | ||
c_int_width: "32".to_string(), | ||
os: "none".to_string(), | ||
env: String::new(), | ||
vendor: String::new(), | ||
linker_flavor: LinkerFlavor::Gcc, | ||
|
||
executables: true, | ||
linker: Some("xtensa-esp32-elf-gcc".to_string()), | ||
|
||
max_atomic_width: Some(32), | ||
|
||
// Because these devices have very little resources having an | ||
// unwinder is too onerous so we default to "abort" because the | ||
// "unwind" strategy is very rare. | ||
panic_strategy: PanicStrategy::Abort, | ||
|
||
// Similarly, one almost always never wants to use relocatable | ||
// code because of the extra costs it involves. | ||
relocation_model: RelocModel::Static, | ||
|
||
emit_debug_gdb_scripts: false, | ||
|
||
unsupported_abis: vec![ | ||
Abi::Stdcall, | ||
Abi::Fastcall, | ||
Abi::Vectorcall, | ||
Abi::Thiscall, | ||
Abi::Win64, | ||
Abi::SysV64, | ||
], | ||
|
||
..Default::default() | ||
}, | ||
} | ||
} |