Skip to content

Conversation

RalfJung
Copy link
Member

Based on top of #140920, only the last commit is new.

  • Get rid of RUSTC_SPECIAL_FEATURES. It was only needed for s390x "backchain", but since LLVM 19 that is always a regular target feature so we don't need this hack any more. The hack also has various unintended side-effects so we don't want to keep it. Fixes When should cfg(target_feature = "backchain") (s390x target feature) be enabled? #142412.
  • Move RUSTC_SPECIFIC_FEATURES handling into the shared parse_rust_feature_flag helper so all consumers of -Ctarget-feature that only care about actual target features (and not "crt-static") have it. Previously, we actually set cfg(target_feature = "crt-static") twice: once in the backend target feature logic, and once specifically for that one feature. IIUC, some targets are meant to ignore -Ctarget-feature=+crt-static, it seems like before this PR that flag still incorrectly enabled cfg(target_feature = "crt-static") (but I didn't test this).
  • Move fixed_x18 handling together with retpoline handling.
  • Forbid setting fixed_x18 as a regular target feature, even unstably. It must be set via the -Z flag.

@rustbot
Copy link
Collaborator

rustbot commented Jun 14, 2025

r? @SparrowLii

rustbot has assigned @SparrowLii.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-rustdoc-json Area: Rustdoc JSON backend S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Jun 14, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jun 14, 2025

Some changes occurred in compiler/rustc_codegen_ssa

cc @WaffleLapkin

Some changes occurred in compiler/rustc_codegen_ssa/src/codegen_attrs.rs

cc @jdonszelmann

Some changes occurred in compiler/rustc_codegen_gcc

cc @antoyo, @GuillaumeGomez

@rust-log-analyzer

This comment has been minimized.

@RalfJung RalfJung force-pushed the target-feature-cleanup branch from 92baddb to 3a6d0c2 Compare June 14, 2025 14:03
@SparrowLii
Copy link
Member

r? codegen

@rustbot rustbot assigned saethlin and unassigned SparrowLii Jun 16, 2025
@bors
Copy link
Collaborator

bors commented Jun 18, 2025

☔ The latest upstream changes (presumably #138165) made this pull request unmergeable. Please resolve the merge conflicts.

Copy link
Member

@WaffleLapkin WaffleLapkin left a comment

Choose a reason for hiding this comment

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

r=me after 140920 merges

@WaffleLapkin WaffleLapkin added S-blocked Status: Blocked on something else such as an RFC or other implementation work. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 18, 2025
@RalfJung
Copy link
Member Author

Folded into #140920

@RalfJung RalfJung closed this Jun 19, 2025
@RalfJung RalfJung deleted the target-feature-cleanup branch June 21, 2025 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-rustdoc-json Area: Rustdoc JSON backend S-blocked Status: Blocked on something else such as an RFC or other implementation work. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When should cfg(target_feature = "backchain") (s390x target feature) be enabled?
7 participants