Skip to content

Rustdoc failure in armv7 targets with -neon with target_feature(enable = "neon") #134511

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sayantn opened this issue Dec 19, 2024 · 4 comments
Closed
Labels
A-target-feature Area: Enabling/disabling target features like AVX, Neon, etc. C-bug Category: This is a bug. O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@sayantn
Copy link
Contributor

sayantn commented Dec 19, 2024

I tried this code:

#![feature(arm_target_feature)]

#[target_feature(enable = "neon")]
unsafe fn foo() {}

This always compiles, but in armv7 targets that have -neon target-feature, running rustdoc on it produces the error

error: target feature `neon` cannot be toggled with `#[target_feature]`: unsound on hard-float targets because it changes float ABI
 --> bug.rs:3:18
  |
5 | #[target_feature(enable = "neon")]
  |

even if the target has +soft-float (e.g armv7-unknown-linux-gnueabi).

rustc --version --verbose:

rustc 1.85.0-nightly (9e136a30a 2024-12-19)
binary: rustc
commit-hash: 9e136a30a965bf4e63f03095c57df7257bf96fd6
commit-date: 2024-12-19
host: x86_64-unknown-linux-gnu
release: 1.85.0-nightly
LLVM version: 19.1.6

Related: #133417

@sayantn sayantn added the C-bug Category: This is a bug. label Dec 19, 2024
@rustbot rustbot added needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. A-target-feature Area: Enabling/disabling target features like AVX, Neon, etc. O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Dec 19, 2024
@sayantn sayantn changed the title [RustDoc] Rustdoc failure in armv7-unknown-linux-gnueabihf with neon target feature Dec 19, 2024
@jieyouxu
Copy link
Member

jieyouxu commented Dec 20, 2024

Hi @sayantn, could you elaborate on how exactly you ran rustdoc (e.g. flags, configs)?

@sayantn
Copy link
Contributor Author

sayantn commented Dec 20, 2024

I typically use cargo doc --target armv7-unknown-linux-gnueabihf, but rustdoc --target armv7-unknown-linux-gnueabihf --crate-type=lib bug.rs also reproduces the issue. No extra flags or anything needed, just a nightly toolchain

@jieyouxu jieyouxu removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Dec 20, 2024
@sayantn sayantn changed the title Rustdoc failure in armv7-unknown-linux-gnueabihf with neon target feature Rustdoc failure in armv7 targets with -neon with target_feature(enable = "neon") Dec 20, 2024
@sayantn sayantn closed this as completed Feb 3, 2025
@truboxl
Copy link

truboxl commented Feb 21, 2025

May I know why was this closed? Now that rust 1.85.0 is in stable but I hit this problem...

@sayantn
Copy link
Contributor Author

sayantn commented Feb 21, 2025

Oh I forgot about stable. This was fixed in 1.86.0 nightly
Should I reopen this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-target-feature Area: Enabling/disabling target features like AVX, Neon, etc. C-bug Category: This is a bug. O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants