From aad5ddd0258870bfac62921d00833438ec094ce6 Mon Sep 17 00:00:00 2001 From: Lokathor Date: Thu, 30 May 2024 19:43:18 -0600 Subject: [PATCH] docs on setting the CPU --- .cargo/config.toml | 1 + src/per_project_setup.rs | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/.cargo/config.toml b/.cargo/config.toml index ac3738f..cbaf206 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -10,4 +10,5 @@ rustflags = [ "-Zub-checks=no", "-Clinker=arm-none-eabi-ld", "-Clink-arg=-Tlinker_scripts/mono_boot.ld", + "-Ctarget-cpu=arm7tdmi", ] diff --git a/src/per_project_setup.rs b/src/per_project_setup.rs index 101f378..b40ce39 100644 --- a/src/per_project_setup.rs +++ b/src/per_project_setup.rs @@ -28,6 +28,12 @@ //! `rustflags` argument with `-Clink-arg=-T`, using the script's path //! relative to our project root. //! +//! You can also set `-Ctarget-cpu=arm7tdmi`, because that is the specific CPU +//! of the GBA, though I'm not sure that LLVM really does much with the +//! information. In my very limited testing, I didn't see any different code +//! generated when setting the CPU compared to not doing it, but I do it just in +//! case it helps somehow, because it doesn't hurt. +//! //! [github_script]: //! https://github.com/rust-console/gba/blob/main/linker_scripts/mono_boot.ld //! @@ -44,6 +50,7 @@ //! rustflags = [ //! "-Clinker=arm-none-eabi-ld", //! "-Clink-arg=-Tlinker_scripts/mono_boot.ld", +//! "-Ctarget-cpu=arm7tdmi", //! ] //! ``` //!