Skip to content

tier 3 target policy: target CPU and features must be supported by upstream backend - #162840

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
RalfJung:tier-3-target-cpu
Oct 21, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
RalfJung:tier-3-target-cpu

Conversation

@RalfJung

@RalfJung RalfJung commented Sep 16, 2026 •

Copy link
Copy Markdown
Member

I am proposing we clarify this point in our tier 3 target policy: it's not enough to just generate some assembly; whatever values are set for target CPU and target features must actually be recognized by the backend.

In particular, if a target emits a warning like this when used without any -C flag, it does not satisfy the policy:

'esp32s3' is not a recognized processor for this target (ignoring processor)

The context here is #162828: we landed the xtensa targets two years ago when they had basically no upstream LLVM support, and even now we have one target that uses a CPU that upstream LLVM does not recognize. I think we should consider this target as not satisfying our policy.

@RalfJung RalfJung added the I-compiler-nominated Nominated for discussion during a compiler team meeting. label Sep 16, 2026
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 16, 2026
@rustbot

rustbot commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

r? @mati865

rustbot has assigned @mati865.
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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 76 candidates
  • Random selection from 20 candidates

@RalfJung

Copy link
Copy Markdown
Member Author

I think this will require FCP. I hope it's okay for me to spawn the checkboxes.

@rfcbot merge compiler

@rust-rfcbot rust-rfcbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Sep 16, 2026
@rust-rfcbot

rust-rfcbot commented Sep 16, 2026 •

Copy link
Copy Markdown
Collaborator

@RalfJung has proposed to merge this. The next step is review by the rest of the tagged team members:

No concerns currently listed.

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for info about what commands tagged team members can give me.

@rust-rfcbot rust-rfcbot added proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. labels Sep 16, 2026
@RalfJung
RalfJung force-pushed the tier-3-target-cpu branch 2 times, most recently from e8f69c2 to 342d9ca Compare September 16, 2026 09:47
rustc's supported backends from any host target. The default target CPU and
target features must be supported by that backend. Having support in a fork
of the backend is not sufficient, it must be upstream in the version of the
backend that ships with rustc.

@RalfJung RalfJung Sep 16, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I also clarified that when we say "upstream", we mean the version we ship, not the latest dev branch.

View changes since the review

@RalfJung

Copy link
Copy Markdown
Member Author

Cc @rust-lang/wg-llvm

@petrochenkov

Copy link
Copy Markdown
Contributor

Having support in a fork of the backend is not sufficient, it must be upstream.

I definitely see how it may be useful to add a non-upstreamed LLVM target to rustc.
It allows to maintain an LLVM fork (something that companies often do) without maintaining a rustc fork as well (something that is not done often).

But given that the no-fork requirement is already in the policy, the additions from this PR do not change things significantly.

Comment thread src/doc/rustc/src/target-tier-policy.md Outdated
@RalfJung

Copy link
Copy Markdown
Member Author

I can see how it is useful for companies that have proprietary backends but I don't think we should spend our time and resources catering to those companies. If we can't even easily run smoke tests (such as tests/assembly-llvm/targets/targets-elf.rs) for the target then it has no place in upstream rustc IMO. So I fully support our existing policy in that regard.

@apiraino apiraino removed the I-compiler-nominated Nominated for discussion during a compiler team meeting. label Sep 29, 2026
@RalfJung

Copy link
Copy Markdown
Member Author

@TaKO8Ki @estebank @jdonszelmann @spastorino @wesleywiser please have a look at this, there's a checkbox waiting for you. :)

The change is tiny and hopefully uncontroversial.

@rust-rfcbot rust-rfcbot added final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. and removed proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. labels Oct 11, 2026
@rust-rfcbot

Copy link
Copy Markdown
Collaborator

🔔 This is now entering its final comment period, as per the review above. 🔔

@mati865 mati865 left a comment •

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.

r=me after FCP is complete

View changes since this review

@rust-rfcbot rust-rfcbot added finished-final-comment-period The final comment period is finished for this PR / Issue. to-announce Announce this issue on triage meeting and removed final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. labels Oct 21, 2026
@rust-rfcbot

Copy link
Copy Markdown
Collaborator

The final comment period, with a disposition to merge, as per the review above, is now complete.

As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.

@RalfJung

Copy link
Copy Markdown
Member Author

@bors r=mati865 rollup

@rust-bors

rust-bors Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

📌 Commit aad80a2 has been approved by mati865

It is now in the queue for this repository.

🌲 The tree is currently closed for pull requests below priority 5. This pull request will be tested once the tree is reopened.

Reason for tree closure: spurious failures

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 21, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Oct 21, 2026
tier 3 target policy: target CPU and features must be supported by upstream backend

I am proposing we clarify this point in our tier 3 target policy: it's not enough to just generate some assembly; whatever values are set for target CPU and target features must actually be recognized by the backend.

In particular, if a target emits a warning like this when used without any `-C` flag, it does not satisfy the policy:
```
'esp32s3' is not a recognized processor for this target (ignoring processor)
```

The context here is rust-lang#162828: we landed the xtensa targets two years ago when they had basically no upstream LLVM support, and even now we have one target that uses a CPU that upstream LLVM does not recognize. I think we should consider this target as not satisfying our policy.
rust-bors Bot pushed a commit that referenced this pull request Oct 21, 2026
…uwer

Rollup of 8 pull requests

Successful merges:

 - #162460 (Feat - `#[inline(always)] + #[target_feature(enable = "....")]` #2)
 - #163485 (`rustc_builtin_macros` cleanup, part 8)
 - #164578 (Don't ignore unknown LLVM diagnostics)
 - #162369 (Document the `recursion_limit` built-in attribute)
 - #162840 (tier 3 target policy: target CPU and features must be supported by upstream backend)
 - #164330 (Skip redundant monomorphization checks)
 - #164656 (stabilize ExitCodeExt for Windows)
 - #164660 (Touch up attribute docs)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Oct 21, 2026
tier 3 target policy: target CPU and features must be supported by upstream backend

I am proposing we clarify this point in our tier 3 target policy: it's not enough to just generate some assembly; whatever values are set for target CPU and target features must actually be recognized by the backend.

In particular, if a target emits a warning like this when used without any `-C` flag, it does not satisfy the policy:
```
'esp32s3' is not a recognized processor for this target (ignoring processor)
```

The context here is rust-lang#162828: we landed the xtensa targets two years ago when they had basically no upstream LLVM support, and even now we have one target that uses a CPU that upstream LLVM does not recognize. I think we should consider this target as not satisfying our policy.
rust-bors Bot pushed a commit that referenced this pull request Oct 21, 2026
…uwer

Rollup of 13 pull requests

Successful merges:

 - #162460 (Feat - `#[inline(always)] + #[target_feature(enable = "....")]` #2)
 - #163485 (`rustc_builtin_macros` cleanup, part 8)
 - #164457 (Add `vec_visualizer` lldb test)
 - #161253 (Implement `AsMut<T>` and `AsRef<T>` for `!`.)
 - #162369 (Document the `recursion_limit` built-in attribute)
 - #162840 (tier 3 target policy: target CPU and features must be supported by upstream backend)
 - #164329 (use default_field_values in declare_lint)
 - #164330 (Skip redundant monomorphization checks)
 - #164527 (doc: added addtional docs for Write)
 - #164656 (stabilize ExitCodeExt for Windows)
 - #164660 (Touch up attribute docs)
 - #164681 (tidy: use repository-relative path for style checks)
 - #164688 (re-enable test_dir_remove_dir test on QNX)
@rust-bors
rust-bors Bot merged commit 77edf46 into rust-lang:main Oct 21, 2026
13 checks passed
@rustbot rustbot added this to the 1.101.0 milestone Oct 21, 2026
rust-bors Bot pushed a commit that referenced this pull request Oct 21, 2026
Rollup merge of #162840 - RalfJung:tier-3-target-cpu, r=mati865

tier 3 target policy: target CPU and features must be supported by upstream backend

I am proposing we clarify this point in our tier 3 target policy: it's not enough to just generate some assembly; whatever values are set for target CPU and target features must actually be recognized by the backend.

In particular, if a target emits a warning like this when used without any `-C` flag, it does not satisfy the policy:
```
'esp32s3' is not a recognized processor for this target (ignoring processor)
```

The context here is #162828: we landed the xtensa targets two years ago when they had basically no upstream LLVM support, and even now we have one target that uses a CPU that upstream LLVM does not recognize. I think we should consider this target as not satisfying our policy.
@apiraino apiraino removed the to-announce Announce this issue on triage meeting label Oct 22, 2026
@RalfJung
RalfJung deleted the tier-3-target-cpu branch October 23, 2026 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this PR / Issue. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants