From 48ec236c8c7c5a32077c465eb254646a9860f802 Mon Sep 17 00:00:00 2001 From: Lokathor Date: Thu, 16 Jul 2020 07:05:08 -0600 Subject: [PATCH] start GBA file. --- .../spec/thumbv4t_nintendo_gba.rs | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/librustc_target/spec/thumbv4t_nintendo_gba.rs diff --git a/src/librustc_target/spec/thumbv4t_nintendo_gba.rs b/src/librustc_target/spec/thumbv4t_nintendo_gba.rs new file mode 100644 index 00000000000..b7e70167c0d --- /dev/null +++ b/src/librustc_target/spec/thumbv4t_nintendo_gba.rs @@ -0,0 +1,30 @@ +//! Targets the Nintendo Game Boy Advance (GBA). +//! +//! The GBA is a handheld game device from 2001. Inside, the CPU is an ARM7TDMI. +//! That's in the ARMv4T architecture family. +//! +//! Technically the device has no OS, however we're going to copy the +//! `mipsel_sony_psp` target setup and set the OS string to be "GBA". Other than +//! the setting of the `target_os` and `target_vendor` values, this target is a +//! fairly standard configuration for `thumbv4t` + +use crate::spec::{LinkerFlavor, LldFlavor, Target, TargetOptions, TargetResult}; + +pub fn target() -> TargetResult { + Ok(Target { + llvm_target: "thumbv4t-none-eabi".to_string(), + target_endian: "little".to_string(), + target_pointer_width: "32".to_string(), + target_c_int_width: "32".to_string(), + target_os: "gba".to_string(), + target_env: String::new(), + target_vendor: "nintendo".to_string(), + arch: "arm".to_string(), + data_layout: "TODO".to_string(), + linker_flavor: LinkerFlavor::Ld, + options: TargetOptions { + // TODO + ..TargetOptions::default() + }, + }) +}