Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub(crate) fn target() -> Target {
options: TargetOptions {
cfg_abi: CfgAbi::EabiHf,
llvm_floatabi: Some(FloatAbi::Hard),
features: "+strict-align,+v6,+vfp2".into(),
features: "+strict-align,+v6,+vfp2,-d32".into(),
max_atomic_width: Some(64),
mcount: "\u{1}__gnu_mcount_nc".into(),
llvm_mcount_intrinsic: Some("llvm.arm.gnu.eabi.mcount".into()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub(crate) fn target() -> Target {
llvm_floatabi: Some(FloatAbi::Hard),
// Most of these settings are copied from the arm_unknown_linux_gnueabihf
// target.
features: "+strict-align,+v6,+vfp2".into(),
features: "+strict-align,+v6,+vfp2,-d32".into(),
max_atomic_width: Some(64),
mcount: "\u{1}mcount".into(),
// FIXME(compiler-team#422): musl targets should be dynamically linked by default.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub(crate) fn target() -> Target {
options: TargetOptions {
cfg_abi: CfgAbi::EabiHf,
llvm_floatabi: Some(FloatAbi::Hard),
features: "+v6,+vfp2".into(),
features: "+v6,+vfp2,-d32".into(),
max_atomic_width: Some(64),
mcount: "\u{1}__gnu_mcount_nc".into(),
llvm_mcount_intrinsic: Some("llvm.arm.gnu.eabi.mcount".into()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub(crate) fn target() -> Target {
options: TargetOptions {
cfg_abi: CfgAbi::EabiHf,
llvm_floatabi: Some(FloatAbi::Hard),
features: "+v6,+vfp2".into(),
features: "+v6,+vfp2,-d32".into(),
max_atomic_width: Some(64),
mcount: "__mcount".into(),
..base::netbsd::opts()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub(crate) fn target() -> Target {
options: TargetOptions {
cfg_abi: CfgAbi::Eabi,
llvm_floatabi: Some(FloatAbi::Soft),
features: "+v7,+thumb-mode,+thumb2,+vfp3d16,-neon".into(),
features: "-d32,+v7,+thumb-mode,+thumb2,+vfp3d16".into(),
supported_sanitizers: SanitizerSet::ADDRESS,
max_atomic_width: Some(64),
..base
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub(crate) fn target() -> Target {
options: TargetOptions {
cfg_abi: CfgAbi::EabiHf,
llvm_floatabi: Some(FloatAbi::Hard),
features: "+v7,+vfp3d16,+thumb2,-neon".into(),
features: "-d32,+v7,+vfp3d16,+thumb2".into(),
max_atomic_width: Some(64),
mcount: "\u{1}__gnu_mcount_nc".into(),
..base::freebsd::opts()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub(crate) fn target() -> Target {
cfg_abi: CfgAbi::EabiHf,
llvm_floatabi: Some(FloatAbi::Hard),
// Info about features at https://wiki.debian.org/ArmHardFloatPort
features: "+v7,+vfp3d16,+thumb2,-neon".into(),
features: "-d32,+v7,+vfp3d16,+thumb2".into(),
max_atomic_width: Some(64),
mcount: "\u{1}__gnu_mcount_nc".into(),
llvm_mcount_intrinsic: Some("llvm.arm.gnu.eabi.mcount".into()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub(crate) fn target() -> Target {
options: TargetOptions {
cfg_abi: CfgAbi::EabiHf,
llvm_floatabi: Some(FloatAbi::Hard),
features: "+v7,+vfp3d16,+thumb2,-neon".into(),
features: "-d32,+v7,+vfp3d16,+thumb2".into(),
max_atomic_width: Some(64),
mcount: "\u{1}mcount".into(),
// FIXME(compiler-team#422): musl targets should be dynamically linked by default.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub(crate) fn target() -> Target {

options: TargetOptions {
// Info about features at https://wiki.debian.org/ArmHardFloatPort
features: "+v7,+vfp3d16,+thumb2,-neon".into(),
features: "-d32,+v7,+vfp3d16,+thumb2".into(),
cpu: "generic".into(),
max_atomic_width: Some(64),
mcount: "_mcount".into(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub(crate) fn target() -> Target {
options: TargetOptions {
cfg_abi: CfgAbi::EabiHf,
llvm_floatabi: Some(FloatAbi::Hard),
features: "+v7,+vfp3d16,+thumb2,-neon".into(),
features: "-d32,+v7,+vfp3d16,+thumb2".into(),
max_atomic_width: Some(64),
mcount: "__mcount".into(),
..base::netbsd::opts()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub(crate) fn target() -> Target {
cfg_abi: CfgAbi::EabiHf,
llvm_floatabi: Some(FloatAbi::Hard),
// Info about features at https://wiki.debian.org/ArmHardFloatPort
features: "+v7,+vfp3d16,+thumb2,-neon".into(),
features: "-d32,+v7,+vfp3d16,+thumb2".into(),
max_atomic_width: Some(64),
..base::vxworks::opts()
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub(crate) fn target() -> Target {
cfg_abi: CfgAbi::EabiHf,
llvm_floatabi: Some(FloatAbi::Hard),
linker: Some("arm-kmc-eabi-gcc".into()),
features: "+v7,+vfp3d16,+thumb2,-neon".into(),
features: "-d32,+v7,+vfp3d16,+thumb2".into(),
relocation_model: RelocModel::Static,
disable_redzone: true,
max_atomic_width: Some(64),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub(crate) fn target() -> Target {
options: TargetOptions {
cfg_abi: CfgAbi::EabiHf,
llvm_floatabi: Some(FloatAbi::Hard),
features: "+vfp3d16,-neon,+strict-align".into(),
features: "-d32,+vfp3d16,+strict-align".into(),
max_atomic_width: Some(64),
has_thumb_interworking: true,
..base::arm_none::opts()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub(crate) fn target() -> Target {
options: TargetOptions {
cfg_abi: CfgAbi::EabiHf,
llvm_floatabi: Some(FloatAbi::Hard),
features: "+vfp3d16,-neon,+strict-align".into(),
features: "-d32,+vfp3d16,+strict-align".into(),
max_atomic_width: Some(64),
has_thumb_interworking: true,
..base::arm_none::opts()
Expand Down
4 changes: 4 additions & 0 deletions src/doc/rustc/src/platform-support/arm-linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,3 +215,7 @@ export CXX_arm_unknown_linux_gnueabi=arm-linux-gnueabi-g++
export CC_arm_unknown_linux_gnueabi=arm-linux-gnueabi-gcc
cargo +nightly build -Zbuild-std --target=arm-unknown-linux-gnueabi
```

> **Note**: From version 1.94 up to 1.99, some hardfloat targets required `VFPv3-D32` as a minimum
> as they erroneously enabled the `d32` feature. Breakage introduced as a result of correcting this
> can be fixed by passing `-Ctarget-feature=+d32` to Rust.
4 changes: 4 additions & 0 deletions src/doc/rustc/src/platform-support/arm-none-eabi.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,10 @@ Most of `core` should work as expected, with the following notes:

Rust programs are output as ELF files.

> **Note**: From version 1.94 up to 1.99, some hardfloat targets required `VFPv3-D32` as a minimum
> as they erroneously enabled the `d32` feature. Breakage introduced as a result of correcting this
> can be fixed by passing `-Ctarget-feature=+d32` to Rust.
Comment on lines +206 to +207

@RalfJung RalfJung Aug 18, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Isn't the Rust 1.100 release notes a better place for this than the target page?

View changes since the review

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Works for me, sounds more likely to be seen sooner and doesn't need removing when no longer as relevant. @thejpster?

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.

I can live with it in the release notes. I just wanted it written down somewhere.


[atomic-load]: https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicU32.html#method.load
[atomic-store]: https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicU32.html#method.store
[fetch-add]: https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicU32.html#method.fetch_add
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ ar = "arm-linux-gnu-ar"
linker = "arm-linux-gnu-gcc"
```

> **Note**: From version 1.94 up to 1.99 the hardfloat target required `VFPv3-D32` as a minimum as it
> erroneously enabled the `d32` feature. Breakage introduced as a result of correcting this can be
> fixed by passing `-Ctarget-feature=+d32` to Rust.

## Building Rust programs

These targets is distributed through `rustup`, and otherwise requires no special configuration.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ cc = "/TOOLCHAIN_PATH/bin/arm-buildroot-linux-uclibcgnueabihf-gcc"
./x.py build --stage 2
```

> **Note**: From version 1.94 up to 1.99 this target required `VFPv3-D32` as a minimum as it
> erroneously enabled the `d32` feature. Breakage introduced as a result of correcting this can be
> fixed by passing `-Ctarget-feature=+d32` to Rust.

## Building and Running Rust Programs

To test cross-compiled binaries on a `x86_64` system, you can use the `qemu-arm` [userspace emulation](https://qemu-project.gitlab.io/qemu/user/main.html) program. This avoids having a full emulated ARM system by doing dynamic binary translation and dynamic system call translation. It lets you run ARM programs directly on your `x86_64` kernel. It's very convenient!
Expand Down
12 changes: 8 additions & 4 deletions src/doc/rustc/src/platform-support/armv7a-none-eabi.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ disabled as needed with `-C target-feature=(+/-)`.

In general, the following four combinations are possible:

- VFPv3-D16, target feature `+vfp3` and `-d32`
- VFPv3-D32, target feature `+vfp3` and `+d32`
- VFPv4-D16, target feature `+vfp4` and `-d32`
- VFPv4-D32, target feature `+vfp4` and `+d32`
- VFPv3-D16, target default
- VFPv3-D32, target feature `+d32`
- VFPv4-D16, llvm target feature `+vfp4d16`
- VFPv4-D32, target feature `+vfp4`

An Armv7-A processor may optionally include a NEON hardware unit which
provides Single Instruction Multiple Data (SIMD) operations. The
Expand All @@ -63,6 +63,10 @@ You can refer to the [arm-none-eabi](arm-none-eabi.md) documentation for a
generic guide on target feature and target CPU specification and how to enable
and disable them via `.cargo/config.toml` file.

> **Note**: From version 1.94 up to 1.99 the hardfloat targets required `VFPv3-D32` as a minimum as
> they erroneously enabled the `d32` feature. Breakage introduced as a result of correcting this can
> be fixed by passing `-Ctarget-feature=+d32` to Rust.

[vfp]: https://developer.arm.com/documentation/den0013/0400/Floating-Point/Floating-point-basics-and-the-IEEE-754-standard/ARM-VFP

## Start-up and Low-Level Code
Expand Down
21 changes: 21 additions & 0 deletions tests/ui/asm/arm-high-dregs.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//@ add-minicore
//@ check-fail
//@ only-arm
//@ only-eabihf
//@ ignore-backends: gcc

// As well as the error message, this also tests that d32 is not enabled by default on arm hardfloat
// targets

#![feature(f16, no_core)]
#![crate_type = "rlib"]
#![no_core]

extern crate minicore;
use minicore::*;

#[no_mangle]
pub unsafe fn high(x: f64) {
asm!("vmov.f64 d16, d0", in("d16") x);
//~^ ERROR register class `dreg` requires at least one of the following target features: d32, neon
}
8 changes: 8 additions & 0 deletions tests/ui/asm/arm-high-dregs.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
error: register class `dreg` requires at least one of the following target features: d32, neon
--> $DIR/arm-high-dregs.rs:19:30
|
LL | asm!("vmov.f64 d16, d0", in("d16") x);
| ^^^^^^^^^^^

error: aborting due to 1 previous error

Loading