rust-lang / rust-lang/rust

Xtensa esp32s3 targets do not work with upstream LLVM

Open
#162,828 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-LLVM A-targets C-bug T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

In https://github.com/rust-lang/rust/pull/160643, we made it so that the "windowed" target feature is marked as "required", because it affects the ABI and we do not intent to support cases where it is missing.

However, two of our Xtensa targets actually do not have that target feature: xtensa-esp32s3-none-elf and xtensa-esp32s3-espidf. This results in warnings any time the target is used:

$ rustc +nightly --print=cfg --target=xtensa-esp32s3-none-elf
'esp32s3' is not a recognized processor for this target (ignoring processor)
'esp32s3' is not a recognized processor for this target (ignoring processor)
warning: target feature `windowed` must be enabled to ensure that the ABI of the current target can be implemented correctly
  |
  = note: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
  = note: for more information, see issue #162235 <https://github.com/rust-lang/rust/issues/162235>

warning: target feature `exception` must be enabled to ensure that the ABI of the current target can be implemented correctly
  |
  = note: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
  = note: for more information, see issue #162235 <https://github.com/rust-lang/rust/issues/162235>

None of the other targets sets the feature explicitly, so I can only assume that the "esp32" and "esp32s2" CPUs imply "windowed" but "esp32s3" no longer implies "windowed". That seems odd. Is this a bug in the LLVM information about Xtensa CPUs?

Cc @MabezDev @SergioGasquez

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the rustc +nightly --print=cfg --target=xtensa-esp32s3-none-elf command and compare its feature output with the other Xtensa targets. Trace the target definitions and LLVM Xtensa CPU feature information implicated by PR #160643; done means both ESP32-S3 targets represent the required ABI features without these warnings.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.