rustc_target: Use rustc_abi instead of cfg_abi to detect powerpcspe #157140
Open
taiki-e wants to merge 1 commit into
Open
rustc_target: Use rustc_abi instead of cfg_abi to detect powerpcspe #157140taiki-e wants to merge 1 commit into
taiki-e wants to merge 1 commit into
Conversation
Collaborator
|
|
RalfJung
reviewed
May 30, 2026
|
|
||
| pub(crate) fn is_spe(target_features: &FxIndexSet<Symbol>) -> bool { | ||
| target_features.contains(&sym::spe) | ||
| } |
Member
There was a problem hiding this comment.
No, we can't do this. Target features are not guaranteed to be consistent across the crate graph. Also we shouldn't parse the target feature like this. Instead, we have the target unambiguously indicate the ABI and then we force the target features to match.
I am working on extending #157085 with SPE support.
Member
There was a problem hiding this comment.
Here's a patch that extends our existing ABI tracking to also cover SPE:
751237abda7
This comment has been minimized.
This comment has been minimized.
Member
Author
|
Updated to refer rustc_abi. |
Member
|
@bors r+ rollup Nice, removing more |
Contributor
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Jun 4, 2026
rustc_target: Use rustc_abi instead of cfg_abi to detect powerpcspe When self-reviewing rust-lang#157137, I recalled a previous my comment (rust-lang#153876 (comment)) about a case where cfg_abi is referred but rustc_abi should be referred. > There is another powerpc code that [refers to `abi` field](https://github.com/rust-lang/rust/blob/bfc05d6b072585dfd0c792ec1b8728c08a3511fe/compiler/rustc_target/src/asm/powerpc.rs#L125), but it should be changed to refer to the target feature. `tests/codegen-llvm/asm/powerpc-clobbers.rs` contains a test to check whether this detection is working properly: https://github.com/rust-lang/rust/blob/6368fd52cb9f230dfb156097625993e7a8891800/tests/codegen-llvm/asm/powerpc-clobbers.rs#L123 r? @RalfJung @rustbot label +O-PowerPC +A-target-feature
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 4, 2026
…uwer Rollup of 8 pull requests Successful merges: - #156281 (Emit nofree attribute) - #157305 (Eagerly decide whether relaxed bounds are allowed or not) - #148713 (rustc_borrowck: fix async closure error note to report AsyncFn rather than Fn) - #156266 (Don't ICE in has_self_borrows when coroutine captures-by-ref ty is still inferred) - #156417 (Fix an ICE in the vtable iteration for a trait reference in const eval when a supertrait is not implemented) - #156956 (Support generic params in `Lift_Generic`) - #157140 ( rustc_target: Use rustc_abi instead of cfg_abi to detect powerpcspe ) - #157423 (Refactor/expand rustc_attr_parsing docs)
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.
When self-reviewing #157137, I recalled a previous my comment (#153876 (comment)) about a case where cfg_abi is referred but rustc_abi should be referred.
tests/codegen-llvm/asm/powerpc-clobbers.rscontains a test to check whether this detection is working properly:rust/tests/codegen-llvm/asm/powerpc-clobbers.rs
Line 123 in 6368fd5
r? @RalfJung
@rustbot label +O-PowerPC +A-target-feature