Use rust rather than LLVM target features in the target spec#149173
Merged
bors merged 1 commit intorust-lang:mainfrom Nov 26, 2025
Merged
Use rust rather than LLVM target features in the target spec#149173bors merged 1 commit intorust-lang:mainfrom
bors merged 1 commit intorust-lang:mainfrom
Conversation
Collaborator
|
Some changes occurred in compiler/rustc_codegen_gcc These commits modify compiler targets. |
Collaborator
|
r? @chenyukang rustbot has assigned @chenyukang. Use |
Member
|
I haven't looked at the code yet, but I like the general direction! The doc comment for https://doc.rust-lang.org/nightly/nightly-rustc/rustc_target/spec/struct.TargetOptions.html#structfield.features should also be updated. |
This comment has been minimized.
This comment has been minimized.
Member
|
haven't touched this part, so @rustbot reroll |
Contributor
|
@rustbot reroll |
Member
|
r? @RalfJung |
RalfJung
requested changes
Nov 25, 2025
Member
|
Thanks, LGTM! r=me after squashing the history so we don't have "fix" commits. |
This works better with non-LLVM codegen backends.
658763b to
fedbccd
Compare
Member
Author
|
@bors r=RalfJung |
Collaborator
jhpratt
added a commit
to jhpratt/rust
that referenced
this pull request
Nov 26, 2025
…r=RalfJung Use rust rather than LLVM target features in the target spec This works better with non-LLVM codegen backends.
bors
added a commit
that referenced
this pull request
Nov 26, 2025
Rollup of 9 pull requests Successful merges: - #147936 (Offload intrinsic) - #148358 (Fix some issues around `rustc_public`) - #148452 (Mangle symbols with a mangled name close to PDB limits with v0 instead of legacy mangling to avoid linker errors) - #148751 (Build gnullvm toolchains on Windows natively) - #148951 (rustc_target: aarch64: Remove deprecated FEAT_TME) - #149173 (Use rust rather than LLVM target features in the target spec) - #149307 (Deny const auto traits) - #149312 (Mark riscv64gc-unknown-linux-musl as tier 2 target) - #149341 (Add `Copy` to some AST enums.) r? `@ghost` `@rustbot` modify labels: rollup
bors
added a commit
that referenced
this pull request
Nov 26, 2025
Rollup of 12 pull requests Successful merges: - #147936 (Offload intrinsic) - #148358 (Fix some issues around `rustc_public`) - #148452 (Mangle symbols with a mangled name close to PDB limits with v0 instead of legacy mangling to avoid linker errors) - #148751 (Build gnullvm toolchains on Windows natively) - #148951 (rustc_target: aarch64: Remove deprecated FEAT_TME) - #149149 ([rustdoc] misc search index cleanups) - #149173 (Use rust rather than LLVM target features in the target spec) - #149307 (Deny const auto traits) - #149312 (Mark riscv64gc-unknown-linux-musl as tier 2 target) - #149317 (Handle inline asm in has_ffi_unwind_calls) - #149326 (Remove unused `Clone` derive on `DelayedLint`) - #149341 (Add `Copy` to some AST enums.) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
that referenced
this pull request
Nov 26, 2025
Rollup merge of #149173 - bjorn3:target_spec_rust_features, r=RalfJung Use rust rather than LLVM target features in the target spec This works better with non-LLVM codegen backends.
github-actions bot
pushed a commit
to rust-lang/rustc-dev-guide
that referenced
this pull request
Nov 27, 2025
Rollup of 12 pull requests Successful merges: - rust-lang/rust#147936 (Offload intrinsic) - rust-lang/rust#148358 (Fix some issues around `rustc_public`) - rust-lang/rust#148452 (Mangle symbols with a mangled name close to PDB limits with v0 instead of legacy mangling to avoid linker errors) - rust-lang/rust#148751 (Build gnullvm toolchains on Windows natively) - rust-lang/rust#148951 (rustc_target: aarch64: Remove deprecated FEAT_TME) - rust-lang/rust#149149 ([rustdoc] misc search index cleanups) - rust-lang/rust#149173 (Use rust rather than LLVM target features in the target spec) - rust-lang/rust#149307 (Deny const auto traits) - rust-lang/rust#149312 (Mark riscv64gc-unknown-linux-musl as tier 2 target) - rust-lang/rust#149317 (Handle inline asm in has_ffi_unwind_calls) - rust-lang/rust#149326 (Remove unused `Clone` derive on `DelayedLint`) - rust-lang/rust#149341 (Add `Copy` to some AST enums.) r? `@ghost` `@rustbot` modify labels: rollup
makai410
pushed a commit
to makai410/rustc_public
that referenced
this pull request
Dec 10, 2025
Rollup of 12 pull requests Successful merges: - rust-lang/rust#147936 (Offload intrinsic) - rust-lang/rust#148358 (Fix some issues around `rustc_public`) - rust-lang/rust#148452 (Mangle symbols with a mangled name close to PDB limits with v0 instead of legacy mangling to avoid linker errors) - rust-lang/rust#148751 (Build gnullvm toolchains on Windows natively) - rust-lang/rust#148951 (rustc_target: aarch64: Remove deprecated FEAT_TME) - rust-lang/rust#149149 ([rustdoc] misc search index cleanups) - rust-lang/rust#149173 (Use rust rather than LLVM target features in the target spec) - rust-lang/rust#149307 (Deny const auto traits) - rust-lang/rust#149312 (Mark riscv64gc-unknown-linux-musl as tier 2 target) - rust-lang/rust#149317 (Handle inline asm in has_ffi_unwind_calls) - rust-lang/rust#149326 (Remove unused `Clone` derive on `DelayedLint`) - rust-lang/rust#149341 (Add `Copy` to some AST enums.) r? `@ghost` `@rustbot` modify labels: rollup
makai410
pushed a commit
to makai410/rust
that referenced
this pull request
Dec 10, 2025
…r=RalfJung Use rust rather than LLVM target features in the target spec This works better with non-LLVM codegen backends.
makai410
pushed a commit
to makai410/rust
that referenced
this pull request
Dec 10, 2025
Rollup of 12 pull requests Successful merges: - rust-lang#147936 (Offload intrinsic) - rust-lang#148358 (Fix some issues around `rustc_public`) - rust-lang#148452 (Mangle symbols with a mangled name close to PDB limits with v0 instead of legacy mangling to avoid linker errors) - rust-lang#148751 (Build gnullvm toolchains on Windows natively) - rust-lang#148951 (rustc_target: aarch64: Remove deprecated FEAT_TME) - rust-lang#149149 ([rustdoc] misc search index cleanups) - rust-lang#149173 (Use rust rather than LLVM target features in the target spec) - rust-lang#149307 (Deny const auto traits) - rust-lang#149312 (Mark riscv64gc-unknown-linux-musl as tier 2 target) - rust-lang#149317 (Handle inline asm in has_ffi_unwind_calls) - rust-lang#149326 (Remove unused `Clone` derive on `DelayedLint`) - rust-lang#149341 (Add `Copy` to some AST enums.) r? `@ghost` `@rustbot` modify labels: rollup
Kobzol
pushed a commit
to Kobzol/rustc_codegen_gcc
that referenced
this pull request
Dec 21, 2025
Rollup of 12 pull requests Successful merges: - rust-lang/rust#147936 (Offload intrinsic) - rust-lang/rust#148358 (Fix some issues around `rustc_public`) - rust-lang/rust#148452 (Mangle symbols with a mangled name close to PDB limits with v0 instead of legacy mangling to avoid linker errors) - rust-lang/rust#148751 (Build gnullvm toolchains on Windows natively) - rust-lang/rust#148951 (rustc_target: aarch64: Remove deprecated FEAT_TME) - rust-lang/rust#149149 ([rustdoc] misc search index cleanups) - rust-lang/rust#149173 (Use rust rather than LLVM target features in the target spec) - rust-lang/rust#149307 (Deny const auto traits) - rust-lang/rust#149312 (Mark riscv64gc-unknown-linux-musl as tier 2 target) - rust-lang/rust#149317 (Handle inline asm in has_ffi_unwind_calls) - rust-lang/rust#149326 (Remove unused `Clone` derive on `DelayedLint`) - rust-lang/rust#149341 (Add `Copy` to some AST enums.) r? `@ghost` `@rustbot` modify labels: rollup
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Dec 21, 2025
…-fix, r=Amanieu Fix d32 usage in Arm target specs Fixes rust-lang#149399 - after checking with an LLVM engineer Rust's feature implications do correctly map to LLVM's. The target specs originally had +vfp3,+d16, but were mistakenly fixed to +vfp3,-d32 which disables vfp3 again. Some targets specify +vfp2,-d32, and since vfp2 shouldn't imply d32 the -d32 is unneeded. The list of Arm features is quite old and since Arm is now a target maintainer of many of them we'll go in and update them. We should probably add vfp3d16 and similar as rust has no way to express these right now after d16 was removed. The LLVM features expand like this: ``` vfp4 -> vfp3 + fp16 + vfp4d16 + vfp4sp vfp4d16 -> vfp3d16 + fp16 + fp64 + vfp4d16sp vfp4sp -> vfp3sp + fp16 + d32 + vfp4d16sp vfp4d16sp -> vfp3d16sp + fp16 vfp3 -> vfp2 + vfp3d16 + vfp3sp vfp3d16 -> vfp2 + fp64 + vfp3d16sp vfp3sp -> vfp2 + d32 + vfp3d16sp vfp3d16sp -> vfp2sp vfp2 -> vfp2sp + fp64 vfp2sp -> fpregs ``` `-neon` might be unnecessary too in many of these cases, but some default CPUs that Rust specifies will turn Neon on so that needs a bit more care. I can't see any LLVM cpus that enable D32. Old description: > Fixes rust-lang#149399 - this implication was likely a mistake and isn't enforced by LLVM. This is is a breaking change and any users specifying `vfp2/3/4` via `-Ctarget-features` or the `target_feature` attribute will need to add `d32` in to get the same behaviour. The target features are unstable so this is ok for Rust, and this is necessary as otherwise there's no way to specify a `vfp2-d16` configuration, for example. > > I expect these targets would have been broken by rust-lang#149173 as `-d32` would have disabled any `+vfpX` feature before it. With the removal of the implication the `-d32` went back to being unnecessary, but I've removed it anyway. > > As `@RalfJung` pointed out, thumbv7a-nuttx-eabihf looks to have been relying on this implication so I've added `+d32` to it's target spec.
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Dec 21, 2025
…-fix, r=Amanieu Fix d32 usage in Arm target specs Fixes rust-lang#149399 - after checking with an LLVM engineer Rust's feature implications do correctly map to LLVM's. The target specs originally had +vfp3,+d16, but were mistakenly fixed to +vfp3,-d32 which disables vfp3 again. Some targets specify +vfp2,-d32, and since vfp2 shouldn't imply d32 the -d32 is unneeded. The list of Arm features is quite old and since Arm is now a target maintainer of many of them we'll go in and update them. We should probably add vfp3d16 and similar as rust has no way to express these right now after d16 was removed. The LLVM features expand like this: ``` vfp4 -> vfp3 + fp16 + vfp4d16 + vfp4sp vfp4d16 -> vfp3d16 + fp16 + fp64 + vfp4d16sp vfp4sp -> vfp3sp + fp16 + d32 + vfp4d16sp vfp4d16sp -> vfp3d16sp + fp16 vfp3 -> vfp2 + vfp3d16 + vfp3sp vfp3d16 -> vfp2 + fp64 + vfp3d16sp vfp3sp -> vfp2 + d32 + vfp3d16sp vfp3d16sp -> vfp2sp vfp2 -> vfp2sp + fp64 vfp2sp -> fpregs ``` `-neon` might be unnecessary too in many of these cases, but some default CPUs that Rust specifies will turn Neon on so that needs a bit more care. I can't see any LLVM cpus that enable D32. Old description: > Fixes rust-lang#149399 - this implication was likely a mistake and isn't enforced by LLVM. This is is a breaking change and any users specifying `vfp2/3/4` via `-Ctarget-features` or the `target_feature` attribute will need to add `d32` in to get the same behaviour. The target features are unstable so this is ok for Rust, and this is necessary as otherwise there's no way to specify a `vfp2-d16` configuration, for example. > > I expect these targets would have been broken by rust-lang#149173 as `-d32` would have disabled any `+vfpX` feature before it. With the removal of the implication the `-d32` went back to being unnecessary, but I've removed it anyway. > > As ``@RalfJung`` pointed out, thumbv7a-nuttx-eabihf looks to have been relying on this implication so I've added `+d32` to it's target spec.
rust-timer
added a commit
that referenced
this pull request
Dec 22, 2025
Rollup merge of #149512 - adamgemmell:dev/adagem01/armv7-d32-fix, r=Amanieu Fix d32 usage in Arm target specs Fixes #149399 - after checking with an LLVM engineer Rust's feature implications do correctly map to LLVM's. The target specs originally had +vfp3,+d16, but were mistakenly fixed to +vfp3,-d32 which disables vfp3 again. Some targets specify +vfp2,-d32, and since vfp2 shouldn't imply d32 the -d32 is unneeded. The list of Arm features is quite old and since Arm is now a target maintainer of many of them we'll go in and update them. We should probably add vfp3d16 and similar as rust has no way to express these right now after d16 was removed. The LLVM features expand like this: ``` vfp4 -> vfp3 + fp16 + vfp4d16 + vfp4sp vfp4d16 -> vfp3d16 + fp16 + fp64 + vfp4d16sp vfp4sp -> vfp3sp + fp16 + d32 + vfp4d16sp vfp4d16sp -> vfp3d16sp + fp16 vfp3 -> vfp2 + vfp3d16 + vfp3sp vfp3d16 -> vfp2 + fp64 + vfp3d16sp vfp3sp -> vfp2 + d32 + vfp3d16sp vfp3d16sp -> vfp2sp vfp2 -> vfp2sp + fp64 vfp2sp -> fpregs ``` `-neon` might be unnecessary too in many of these cases, but some default CPUs that Rust specifies will turn Neon on so that needs a bit more care. I can't see any LLVM cpus that enable D32. Old description: > Fixes #149399 - this implication was likely a mistake and isn't enforced by LLVM. This is is a breaking change and any users specifying `vfp2/3/4` via `-Ctarget-features` or the `target_feature` attribute will need to add `d32` in to get the same behaviour. The target features are unstable so this is ok for Rust, and this is necessary as otherwise there's no way to specify a `vfp2-d16` configuration, for example. > > I expect these targets would have been broken by #149173 as `-d32` would have disabled any `+vfpX` feature before it. With the removal of the implication the `-d32` went back to being unnecessary, but I've removed it anyway. > > As ``@RalfJung`` pointed out, thumbv7a-nuttx-eabihf looks to have been relying on this implication so I've added `+d32` to it's target spec.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This works better with non-LLVM codegen backends.