Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/rustc_target/src/spec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1665,7 +1665,7 @@ supported_targets! {
("thumbv7a-none-eabihf", thumbv7a_none_eabihf),
("armv7a-nuttx-eabi", armv7a_nuttx_eabi),
("armv7a-nuttx-eabihf", armv7a_nuttx_eabihf),
("armv7a-vex-v5", armv7a_vex_v5),
("thumbv7a-vex-v5", thumbv7a_vex_v5),

("msp430-none-elf", msp430_none_elf),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::spec::{
TargetMetadata, TargetOptions,
};

const LINKER_SCRIPT: &str = include_str!("./armv7a_vex_v5_linker_script.ld");
const LINKER_SCRIPT: &str = include_str!("./thumbv7a_vex_v5_linker_script.ld");

pub(crate) fn target() -> Target {
let opts = TargetOptions {
Expand All @@ -29,7 +29,7 @@ pub(crate) fn target() -> Target {
..Default::default()
};
Target {
llvm_target: "armv7a-none-eabihf".into(),
llvm_target: "thumbv7a-none-eabihf".into(),
metadata: TargetMetadata {
description: Some("ARMv7-A Cortex-A9 VEX V5 Brain".into()),
tier: Some(3),
Expand Down
3 changes: 2 additions & 1 deletion library/std/src/sys/pal/vexos/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ global_asm!(
.section .boot, "ax"
.global _boot

.arm
_boot:
ldr sp, =__stack_top @ Set up the user stack.
b _start @ Jump to the Rust entrypoint.
blx _start @ Jump to the Rust entrypoint.
"#
);

Expand Down
2 changes: 1 addition & 1 deletion src/doc/rustc/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@
- [armv6k-nintendo-3ds](platform-support/armv6k-nintendo-3ds.md)
- [armv7-rtems-eabihf](platform-support/armv7-rtems-eabihf.md)
- [armv7-sony-vita-newlibeabihf](platform-support/armv7-sony-vita-newlibeabihf.md)
- [armv7a-vex-v5](platform-support/armv7a-vex-v5.md)
- [\*-android and \*-androideabi](platform-support/android.md)
- [\*-linux-ohos](platform-support/openharmony.md)
- [\*-hurd-gnu](platform-support/hurd.md)
Expand Down Expand Up @@ -124,6 +123,7 @@
- [s390x-unknown-none-softfloat](platform-support/s390x-unknown-none-softfloat.md)
- [sparc-unknown-none-elf](./platform-support/sparc-unknown-none-elf.md)
- [solaris](platform-support/solaris.md)
- [thumbv7a-vex-v5](platform-support/thumbv7a-vex-v5.md)
- [\*-nto-qnx-\*](platform-support/nto-qnx.md)
- [\*-unikraft-linux-musl](platform-support/unikraft-linux-musl.md)
- [\*-unknown-helenos](platform-support/helenos.md)
Expand Down
2 changes: 1 addition & 1 deletion src/doc/rustc/src/platform-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,6 @@ target | std | host | notes
[`armv7-wrs-vxworks-eabihf`](platform-support/vxworks.md) | ✓ | | Armv7-A for VxWorks
[`armv7a-kmc-solid_asp3-eabi`](platform-support/kmc-solid.md) | ✓ | | ARM SOLID with TOPPERS/ASP3
[`armv7a-kmc-solid_asp3-eabihf`](platform-support/kmc-solid.md) | ✓ | | ARM SOLID with TOPPERS/ASP3, hardfloat
[`armv7a-vex-v5`](platform-support/armv7a-vex-v5.md) | ? | | Armv7-A Cortex-A9 VEX V5 Brain, VEXos
[`armv7k-apple-watchos`](platform-support/apple-watchos.md) | ✓ | | Armv7-A Apple WatchOS
[`armv7s-apple-ios`](platform-support/apple-ios.md) | ✓ | | Armv7-A Apple-A6 Apple iOS
[`armv7a-nuttx-eabi`](platform-support/nuttx.md) | ✓ | | ARMv7-A with NuttX
Expand Down Expand Up @@ -429,6 +428,7 @@ target | std | host | notes
[`thumbv7a-nuttx-eabihf`](platform-support/nuttx.md) | ✓ | | ARMv7-A with NuttX, hardfloat
`thumbv7a-pc-windows-msvc` | | |
[`thumbv7a-uwp-windows-msvc`](platform-support/uwp-windows-msvc.md) | | |
[`thumbv7a-vex-v5`](platform-support/thumbv7a-vex-v5.md) | ✓ | | Armv7-A Cortex-A9 VEX V5 Brain, VEXos
[`thumbv7em-nuttx-eabi`](platform-support/nuttx.md) | ✓ | | ARMv7EM with NuttX
[`thumbv7em-nuttx-eabihf`](platform-support/nuttx.md) | ✓ | | ARMv7EM with NuttX, hardfloat
[`thumbv7m-nuttx-eabi`](platform-support/nuttx.md) | ✓ | | ARMv7M with NuttX
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# `armv7a-vex-v5`
# `thumbv7a-vex-v5`

**Tier: 3**

Allows compiling user programs for the [VEX V5 Brain](https://www.vexrobotics.com/276-4810.html), a microcontroller for educational and competitive robotics.

Rust support for this target is not affiliated with VEX Robotics or IFI, and does not link against any official VEX SDK.

This target was previously named `armv7a-vex-v5`.

@tropicaaal tropicaaal Jul 11, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a blocker, but it might be a good idea for this to be elaborated on wrt. why we changed to thumb.

View changes since the review


## Target maintainers

This target is maintained by members of the [vexide](https://github.com/vexide) organization:
Expand Down Expand Up @@ -48,7 +50,7 @@ Libraries may access symbols from the active VEX SDK without depending on a spec

## Building the target

You can build Rust with support for this target by adding it to the `target` list in `bootstrap.toml`, and then running `./x build --target armv7a-vex-v5 compiler`.
You can build Rust with support for this target by adding it to the `target` list in `bootstrap.toml`, and then running `./x build --target thumbv7a-vex-v5 compiler`.

## Building Rust programs

Expand Down Expand Up @@ -113,13 +115,13 @@ This target can be cross-compiled from any host.
The recommended configuration for compiling compatible C code is to use the [Arm Toolchain for Embedded](https://github.com/arm/arm-toolchain/tree/arm-software/arm-software/embedded#readme) with the following compilation flags:

```sh
clang --target=arm-none-eabi -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=hard -fno-pic -fno-exceptions -fno-rtti -funwind-tables
clang --target=thumbv7a-none-eabihf -mcpu=cortex-a9 -mfpu=neon -fno-pic -fno-exceptions -fno-rtti -funwind-tables
```

The following Cargo configuration can be used to link with picolibc (the libc used by the Arm Toolchain for Embedded):

```toml
[target.armv7a-vex-v5]
[target.thumbv7a-vex-v5]
# We use ARM Clang as a linker because ld.lld by itself doesn't include the
# multilib logic for resolving static libraries.
linker = "clang"
Expand All @@ -128,7 +130,9 @@ rustflags = [
# These link flags resolve to this sysroot:
# `…/arm-none-eabi/armv7a_hard_vfpv3_d16_unaligned`
# (hard float / VFP version 3 with 16 regs / unaligned access)
"-Clink-arg=--target=armv7a-none-eabihf",
"-Clink-arg=--target=thumbv7a-none-eabihf",
"-Clink-arg=-fno-rtti",
"-Clink-arg=-fno-exceptions",

# To disable crt0 and use Rust's _boot implementation
# (or something custom):
Expand Down
6 changes: 3 additions & 3 deletions tests/assembly-llvm/targets/targets-elf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,9 @@
//@ revisions: armv7a_nuttx_eabihf
//@ [armv7a_nuttx_eabihf] compile-flags: --target armv7a-nuttx-eabihf
//@ [armv7a_nuttx_eabihf] needs-llvm-components: arm
//@ revisions: armv7a_vex_v5
//@ [armv7a_vex_v5] compile-flags: --target armv7a-vex-v5
//@ [armv7a_vex_v5] needs-llvm-components: arm
//@ revisions: thumbv7a_vex_v5
//@ [thumbv7a_vex_v5] compile-flags: --target thumbv7a-vex-v5
//@ [thumbv7a_vex_v5] needs-llvm-components: arm
//@ revisions: armv7r_none_eabi
//@ [armv7r_none_eabi] compile-flags: --target armv7r-none-eabi
//@ [armv7r_none_eabi] needs-llvm-components: arm
Expand Down
Loading