|
| 1 | +//! Targets the Nintendo Game Boy Advance (GBA). |
| 2 | +//! |
| 3 | +//! The GBA is a handheld game device from 2001. Inside, the CPU is an ARM7TDMI. |
| 4 | +//! That's in the ARMv4T architecture family. |
| 5 | +//! |
| 6 | +//! Technically the device has no OS, however we're going to copy the |
| 7 | +//! `mipsel_sony_psp` target setup and set the OS string to be "GBA". Other than |
| 8 | +//! the setting of the `target_os` and `target_vendor` values, this target is a |
| 9 | +//! fairly standard configuration for `thumbv4t` |
| 10 | +
|
| 11 | +use crate::spec::{LinkerFlavor, LldFlavor, Target, TargetOptions, TargetResult}; |
| 12 | + |
| 13 | +pub fn target() -> TargetResult { |
| 14 | + Ok(Target { |
| 15 | + llvm_target: "thumbv4t-none-eabi".to_string(), |
| 16 | + target_endian: "little".to_string(), |
| 17 | + target_pointer_width: "32".to_string(), |
| 18 | + target_c_int_width: "32".to_string(), |
| 19 | + target_os: "gba".to_string(), |
| 20 | + target_env: String::new(), |
| 21 | + target_vendor: "nintendo".to_string(), |
| 22 | + arch: "arm".to_string(), |
| 23 | + data_layout: "TODO".to_string(), |
| 24 | + linker_flavor: LinkerFlavor::Ld, |
| 25 | + options: TargetOptions { |
| 26 | + // TODO |
| 27 | + ..TargetOptions::default() |
| 28 | + }, |
| 29 | + }) |
| 30 | +} |
0 commit comments