From 41f0cdfc80516c9204a583a0e9aa7264196b8a46 Mon Sep 17 00:00:00 2001 From: Lokathor Date: Sun, 10 Mar 2019 23:40:22 -0600 Subject: [PATCH 1/6] Limit this to sufficiently advanced devices --- crates/core_arch/src/acle/registers/aarch32.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/core_arch/src/acle/registers/aarch32.rs b/crates/core_arch/src/acle/registers/aarch32.rs index f59af5d3ae..d8ccb9de6c 100644 --- a/crates/core_arch/src/acle/registers/aarch32.rs +++ b/crates/core_arch/src/acle/registers/aarch32.rs @@ -1,4 +1,5 @@ /// Application Program Status Register pub struct APSR; +#[cfg(any(not(target_feature = thumb-mode), target_feature = v6t2))] rsr!(APSR); From 779ccafa9a08de1a4b034411b86182ecc902e5d3 Mon Sep 17 00:00:00 2001 From: Lokathor Date: Mon, 11 Mar 2019 01:25:35 -0600 Subject: [PATCH 2/6] add the double quotes --- crates/core_arch/src/acle/registers/aarch32.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/core_arch/src/acle/registers/aarch32.rs b/crates/core_arch/src/acle/registers/aarch32.rs index d8ccb9de6c..42c6b7a794 100644 --- a/crates/core_arch/src/acle/registers/aarch32.rs +++ b/crates/core_arch/src/acle/registers/aarch32.rs @@ -1,5 +1,5 @@ /// Application Program Status Register pub struct APSR; -#[cfg(any(not(target_feature = thumb-mode), target_feature = v6t2))] +#[cfg(any(not(target_feature = thumb-mode), target_feature = "v6t2"))] rsr!(APSR); From 0a9ac3ec64084bc628be10864a8f9290fabeb8de Mon Sep 17 00:00:00 2001 From: Lokathor Date: Mon, 11 Mar 2019 01:31:31 -0600 Subject: [PATCH 3/6] oh, they both need double quotes, okay --- crates/core_arch/src/acle/registers/aarch32.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/core_arch/src/acle/registers/aarch32.rs b/crates/core_arch/src/acle/registers/aarch32.rs index 42c6b7a794..bc4ecee8a5 100644 --- a/crates/core_arch/src/acle/registers/aarch32.rs +++ b/crates/core_arch/src/acle/registers/aarch32.rs @@ -1,5 +1,5 @@ /// Application Program Status Register pub struct APSR; -#[cfg(any(not(target_feature = thumb-mode), target_feature = "v6t2"))] +#[cfg(any(not(target_feature = "thumb-mode"), target_feature = "v6t2"))] rsr!(APSR); From 6894a2846cde4bfbf519d37791ed2f7b5f49c832 Mon Sep 17 00:00:00 2001 From: Lokathor Date: Fri, 15 Mar 2019 19:26:51 -0600 Subject: [PATCH 4/6] Revert the regression, add a GBA target to avoid this again --- .travis.yml | 18 ++++++++++ ci/gba.json | 34 +++++++++++++++++++ .../core_arch/src/acle/registers/aarch32.rs | 8 +++-- 3 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 ci/gba.json diff --git a/.travis.yml b/.travis.yml index da28db8da8..852e1f60b1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -64,6 +64,24 @@ matrix: env: TARGET=thumbv7em-none-eabi NORUN=1 NOSTD=1 NO_DOCKER=1 - name: "thumbv7em-none-eabihf - build libcore only" env: TARGET=thumbv7em-none-eabihf NORUN=1 NOSTD=1 NO_DOCKER=1 + - name: "Game Boy Advance - build libcore only" + env: NORUN=1 NOSTD=1 NO_DOCKER=1 + install: cargo install xargo + script: + # Obtain the devkitPro tools, using `target/` as a temp directory. This + # is required because we need to use their linker. `lld` uses the `BLX` + # instruction, which was not available in thumb state code until ARMv5. + - mkdir -p target + - cd target + - wget https://github.com/devkitPro/pacman/releases/download/devkitpro-pacman-1.0.1/devkitpro-pacman.deb + - sudo dpkg -i devkitpro-pacman.deb + - sudo dkp-pacman -Sy + - sudo dkp-pacman -Syu + - sudo dkp-pacman -S -v --noconfirm gba-tools devkitARM + - export PATH="$PATH:/opt/devkitpro/devkitARM/bin" + - export PATH="$PATH:/opt/devkitpro/tools/bin" + - cd .. + - xargo build --all --target=ci/gba.json - name: "Documentation" install: true script: ci/dox.sh diff --git a/ci/gba.json b/ci/gba.json new file mode 100644 index 0000000000..5aece43af2 --- /dev/null +++ b/ci/gba.json @@ -0,0 +1,34 @@ +{ + "abi-blacklist": [ + "stdcall", + "fastcall", + "vectorcall", + "thiscall", + "win64", + "sysv64" + ], + "arch": "arm", + "atomic-cas": false, + "cpu": "arm7tdmi", + "data-layout": "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", + "emit-debug-gdb-scripts": false, + "env": "agb", + "executables": true, + "features": "+soft-float,+strict-align", + "linker": "arm-none-eabi-ld", + "linker-flavor": "ld", + "linker-is-gnu": true, + "llvm-target": "thumbv4-none-agb", + "os": "none", + "panic-strategy": "abort", + "pre-link-args": { + "ld": [ + "-Tlinker.ld" + ] + }, + "relocation-model": "static", + "target-c-int-width": "32", + "target-endian": "little", + "target-pointer-width": "32", + "vendor": "nintendo" +} \ No newline at end of file diff --git a/crates/core_arch/src/acle/registers/aarch32.rs b/crates/core_arch/src/acle/registers/aarch32.rs index bc4ecee8a5..5cc66308be 100644 --- a/crates/core_arch/src/acle/registers/aarch32.rs +++ b/crates/core_arch/src/acle/registers/aarch32.rs @@ -1,5 +1,9 @@ /// Application Program Status Register pub struct APSR; -#[cfg(any(not(target_feature = "thumb-mode"), target_feature = "v6t2"))] -rsr!(APSR); +// Note (@Lokathor): Because this breaks the use of Rust on the Game Boy +// Advance, this change must be reverted until Rust learns to handle cpu state +// properly. See also: https://github.com/rust-lang-nursery/stdsimd/issues/702 + +//#[cfg(any(not(target_feature = "thumb-state"), target_feature = "v6t2"))] +//rsr!(APSR); From 2a676519c571cb604e66997d5f78f7dbc9780af4 Mon Sep 17 00:00:00 2001 From: Lokathor Date: Fri, 15 Mar 2019 19:57:11 -0600 Subject: [PATCH 5/6] I forgot that we need to install more --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 852e1f60b1..d6c396cacb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -66,7 +66,9 @@ matrix: env: TARGET=thumbv7em-none-eabihf NORUN=1 NOSTD=1 NO_DOCKER=1 - name: "Game Boy Advance - build libcore only" env: NORUN=1 NOSTD=1 NO_DOCKER=1 - install: cargo install xargo + install: + - rustup component add rust-src + - cargo install xargo script: # Obtain the devkitPro tools, using `target/` as a temp directory. This # is required because we need to use their linker. `lld` uses the `BLX` From 9f887dae31ea6437d877257ff750ff9b2b4cfdb0 Mon Sep 17 00:00:00 2001 From: Lokathor Date: Fri, 15 Mar 2019 20:37:48 -0600 Subject: [PATCH 6/6] gnzlbg xargo doesn't work like you thought ;_; --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d6c396cacb..e4cf492793 100644 --- a/.travis.yml +++ b/.travis.yml @@ -83,7 +83,9 @@ matrix: - export PATH="$PATH:/opt/devkitpro/devkitARM/bin" - export PATH="$PATH:/opt/devkitpro/tools/bin" - cd .. - - xargo build --all --target=ci/gba.json + # Pull the target spec up into the current directory and then build + - mv ci/gba.json gba.json + - xargo build --all --target=gba - name: "Documentation" install: true script: ci/dox.sh