Skip to content

Commit

Permalink
Support armv8r-none-eabihf
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Feb 22, 2024
1 parent a1d491d commit b773491
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 6 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ Clang version: https://github.com/mstorsjo/llvm-mingw/releases/tag/20231128
| `armv7a-none-eabihf` | 10.3.1 | ✓ (qemu) | x86_64/aarch64 linux (glibc 2.27+) |
| `armv7r-none-eabi` | 10.3.1 | ✓ (qemu) | x86_64/aarch64 linux (glibc 2.27+) |
| `armv7r-none-eabihf` | 10.3.1 | ✓ (qemu) | x86_64/aarch64 linux (glibc 2.27+) |
| `armv8r-none-eabihf` | 10.3.1 | ✓ (qemu) | x86_64/aarch64 linux (glibc 2.27+) |
| `riscv32i-unknown-none-elf` | 11.1.0 | ✓ (qemu) | x86_64 linux (glibc 2.27+) |
| `riscv32im-unknown-none-elf` (tier3) | 11.1.0 | ✓ (qemu) | x86_64 linux (glibc 2.27+) |
| `riscv32imac-unknown-none-elf` | 11.1.0 | ✓ (qemu) | x86_64 linux (glibc 2.27+) |
Expand Down
1 change: 1 addition & 0 deletions docker/none.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ FROM arm-toolchain as armv7a-none-eabi
FROM arm-toolchain as armv7a-none-eabihf
FROM arm-toolchain as armv7r-none-eabi
FROM arm-toolchain as armv7r-none-eabihf
FROM arm-toolchain as armv8r-none-eabihf
FROM arm-toolchain as thumbv5te-none-eabi
FROM arm-toolchain as thumbv6m-none-eabi
FROM arm-toolchain as thumbv7em-none-eabi
Expand Down
11 changes: 10 additions & 1 deletion docker/test/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,13 @@ EOF
cat >>"${env_path}" <<EOF
export CFLAGS_${rust_target_lower}="-march=armv7-a+vfpv3 -mfloat-abi=hard \${CFLAGS_${rust_target_lower}:-}"
export CXXFLAGS_${rust_target_lower}="-march=armv7-a+vfpv3 -mfloat-abi=hard \${CXXFLAGS_${rust_target_lower}:-}"
EOF
;;
armv8r-none-eabihf)
# https://github.com/rust-lang/rust/blob/026b3b8e955e0571db39aa96fc9d7aba25cc4d66/compiler/rustc_target/src/spec/targets/armv8r_none_eabihf.rs
cat >>"${env_path}" <<EOF
export CFLAGS_${rust_target_lower}="-march=armv8-r+fp-armv8,-fp64,-d32 -mfloat-abi=hard \${CFLAGS_${rust_target_lower}:-}"
export CXXFLAGS_${rust_target_lower}="-march=armv8-r+fp-armv8,-fp64,-d32 -mfloat-abi=hard \${CXXFLAGS_${rust_target_lower}:-}"
EOF
;;
aarch64-unknown-none-softfloat)
Expand Down Expand Up @@ -446,6 +453,8 @@ EOF
# https://github.com/rust-lang/rust/blob/1.70.0/compiler/rustc_target/src/spec/armv7r_none_eabihf.rs
# https://github.com/rust-lang/rust/blob/1.70.0/compiler/rustc_target/src/spec/armebv7r_none_eabihf.rs
armv7r-none-eabihf | armebv7r-none-eabihf) qemu_cpu=cortex-r5f ;;
# https://github.com/rust-lang/rust/blob/026b3b8e955e0571db39aa96fc9d7aba25cc4d66/compiler/rustc_target/src/spec/targets/armv8r_none_eabihf.rs
armv8r-none-eabihf | armebv8r-none-eabihf) qemu_cpu=cortex-r52 ;;
# TODO: https://github.com/rust-lang/rust/blob/1.70.0/compiler/rustc_target/src/spec/armv4t_none_eabi.rs
# TODO: https://github.com/rust-lang/rust/blob/1.70.0/compiler/rustc_target/src/spec/thumbv4t_none_eabi.rs
armv4t-none-eabi | thumbv4t-none-eabi) ;; # TODO
Expand Down Expand Up @@ -476,7 +485,7 @@ EOF
# Cortex-a
armv7a-*) qemu_machine=xilinx-zynq-a9 ;;
# TODO: As of QEMU 7.2, qemu-system-arm doesn't support Cortex-R machine.
arm*v7r-*) ;;
arm*v[7-8]r-*) ;;
*) bail "unrecognized target '${RUST_TARGET}'" ;;
esac
;;
Expand Down
2 changes: 1 addition & 1 deletion docker/test/fixtures/no-std-qemu/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ cc = "=1.0.83"

[dependencies]
semihosting = { version = "0.1", features = ["stdio", "panic-handler"] }
semihosting-no-std-test-rt = { git = "https://github.com/taiki-e/semihosting.git", rev = "66dee29" }
semihosting-no-std-test-rt = { git = "https://github.com/taiki-e/semihosting.git", rev = "80d16c5" }

[target.'cfg(all(target_arch = "arm", target_feature = "mclass"))'.dependencies]
cortex-m-rt = "0.7"
Expand Down
6 changes: 3 additions & 3 deletions docker/test/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -587,8 +587,8 @@ else
cargo_args+=(--features qemu-system)
case "${RUST_TARGET}" in
# TODO: As of QEMU 7.2, qemu-system-arm doesn't support Cortex-R machine.
armv7r* | armebv7r*) continue ;;
thumbv6m* | thumbv7m* | thumbv7em* | thumbv8m* | aarch64* | arm64* | riscv*)
armv[7-8]r* | armebv[7-8]r*) continue ;;
thumbv[6-8]m* | thumbv7em* | aarch64* | arm64* | riscv*)
_linker=link.x
target_rustflags+=" -C link-arg=-T${_linker}"
;;
Expand Down Expand Up @@ -784,7 +784,7 @@ case "${RUST_TARGET}" in
arm*v7* | thumbv7*) ;;
thumbv8m*hf) arch_specific_pat+=('Tag_FP_arch: FPv5/FP-D16 for ARMv8') ;;
thumbv8m*) ;;
armeb-*) ;;
armeb-* | armv8*) ;;
arm-*hf | armv6*hf)
for bin in "${out_dir}"/*; do
if [[ "${RUST_TARGET}" == *"-linux-musl"* ]] && [[ "${bin}" == *"-static" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion platform-support-status-tier3.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ See [platform-support-status.md](platform-support-status.md) for Tier 1 & Tier 2
- [x] armv7a-none-eabihf
- [ ] armv7k-apple-watchos
- [ ] armv7s-apple-ios
- [ ] armv8r-none-eabihf
- [x] armv8r-none-eabihf
- [ ] avr-unknown-gnu-atmega328
- [ ] bpfeb-unknown-none
- [ ] bpfel-unknown-none
Expand Down
1 change: 1 addition & 0 deletions tools/target-list-shared.sh
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ none_targets=(
armv7a-none-eabihf # tier3
armv7r-none-eabi
armv7r-none-eabihf
armv8r-none-eabihf # tier3
# avr-unknown-gnu-atmega328 # tier3
# bpfeb-unknown-none # tier3
# bpfel-unknown-none # tier3
Expand Down

0 comments on commit b773491

Please sign in to comment.