Skip to content

Simplify the unwind crate#159010

Open
bjorn3 wants to merge 4 commits into
rust-lang:mainfrom
bjorn3:refactor_unwind
Open

Simplify the unwind crate#159010
bjorn3 wants to merge 4 commits into
rust-lang:mainfrom
bjorn3:refactor_unwind

Conversation

@bjorn3

@bjorn3 bjorn3 commented Jul 9, 2026

Copy link
Copy Markdown
Member

Use cfg_select! and unify type definitions.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jul 9, 2026
@rustbot

rustbot commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
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: libs
  • libs expanded to 12 candidates
  • Random selection from 6 candidates

@bjorn3

bjorn3 commented Jul 9, 2026

Copy link
Copy Markdown
Member Author

@xobs would you be able to check if the second commit doesn't break Xous?

@rust-log-analyzer

This comment has been minimized.

@bjorn3 bjorn3 force-pushed the refactor_unwind branch from 3581b47 to 4866a9c Compare July 9, 2026 14:46
@rustbot

rustbot commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

miri is developed in its own repository. If possible, consider making this change to rust-lang/miri instead.

cc @rust-lang/miri

Comment thread library/unwind/src/libunwind.rs Outdated
@bjorn3 bjorn3 force-pushed the refactor_unwind branch from 13a879b to 9cd0685 Compare July 10, 2026 12:51
@rust-log-analyzer

This comment has been minimized.

@bjorn3 bjorn3 force-pushed the refactor_unwind branch from 9cd0685 to 407410c Compare July 10, 2026 13:43
@xobs

xobs commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

At first blush, it doesn't compile:

Compiling panic_unwind v0.0.0 (/Users/seancross/Code/Xous/rust/library/panic_unwind)
warning: dropping unsupported crate type `dylib` for target `riscv32imac-unknown-xous-elf`

error[E0433]: cannot find `FrameInfoKind` in `unwind`
  --> std/src/sys/pal/xous/mod.rs:23:35
   |
23 |                     kind: unwind::FrameInfoKind::EhFrame(unsafe { EH_FRAME_ADDRESS }),
   |                                   ^^^^^^^^^^^^^ could not find `FrameInfoKind` in `unwind`

error[E0405]: cannot find trait `EhFrameFinder` in crate `unwind`
  --> std/src/sys/pal/xous/mod.rs:16:25
   |
16 |     unsafe impl unwind::EhFrameFinder for EhFrameFinder {
   |                         ^^^^^^^^^^^^^ not found in `unwind`

error[E0425]: cannot find type `FrameInfo` in crate `unwind`
  --> std/src/sys/pal/xous/mod.rs:17:54
   |
17 |         fn find(&self, _pc: usize) -> Option<unwind::FrameInfo> {
   |                                                      ^^^^^^^^^ not found in `unwind`

error[E0422]: cannot find struct, variant or union type `FrameInfo` in crate `unwind`
  --> std/src/sys/pal/xous/mod.rs:21:30
   |
21 |                 Some(unwind::FrameInfo {
   |                              ^^^^^^^^^ not found in `unwind`

error[E0425]: cannot find function `set_custom_eh_frame_finder` in crate `unwind`
  --> std/src/sys/pal/xous/mod.rs:48:21
   |
48 |             unwind::set_custom_eh_frame_finder(&super::eh_unwinding::EH_FRAME_SETTINGS).ok();
   |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in `unwind`

Some errors have detailed explanations: E0405, E0422, E0425, E0433.
For more information about an error, try `rustc --explain E0405`.

@Mark-Simulacrum

Copy link
Copy Markdown
Member

@rustbot author

r=me on the general approach once we get xous working -- I'd expect you can check at least compilation locally with x.py check? You might need to skip bootstrap's sanity checks for a c toolchain.

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 11, 2026
@bjorn3

bjorn3 commented Jul 12, 2026

Copy link
Copy Markdown
Member Author

./x.py check --target riscv32imac-unknown-xous-elf library now passes minus pre-existing implicit_provenance_casts lint violations.

@bors r=Mark-Simulacrum

@rust-bors

rust-bors Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 64811e9 has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 12, 2026
@bjorn3

bjorn3 commented Jul 12, 2026

Copy link
Copy Markdown
Member Author

Opened #159174 for the lint warnings.

jhpratt added a commit to jhpratt/rust that referenced this pull request Jul 12, 2026
…ulacrum

Simplify the unwind crate

Use cfg_select! and unify type definitions.
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jul 12, 2026
…ulacrum

Simplify the unwind crate

Use cfg_select! and unify type definitions.
rust-bors Bot pushed a commit that referenced this pull request Jul 12, 2026
…uwer

Rollup of 7 pull requests

Successful merges:

 - #158732 (Apply MCP 1003 and move diagnostics.rs into its own module)
 - #159010 (Simplify the unwind crate)
 - #159131 (bootstrap: Allow path-based skipping of the coverage test suite)
 - #159134 (std: fix panic in Windows Stdin::read_vectored with pending surrogate)
 - #159178 (Print duration of BOLT instrumentation and optimization steps)
 - #159112 (Fix segfault in env access in statically linked FreeBSD binaries)
 - #159124 (compiletest: use VecDeque::pop_front_if)
@JonathanBrouwer

Copy link
Copy Markdown
Contributor

💔 I suspect this PR failed tests as part of a rollup
@bors r-

After fixing the problem, consider running a try job for the failed job before re-approving.

Link to failure: #159187 (comment)

@rust-bors rust-bors Bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jul 12, 2026
@rust-bors

rust-bors Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

This pull request was unapproved.

This PR was contained in a rollup (#159187), which was unapproved.

View changes since this unapproval

@bjorn3 bjorn3 force-pushed the refactor_unwind branch from 64811e9 to aa31851 Compare July 13, 2026 10:14
@bjorn3

bjorn3 commented Jul 13, 2026

Copy link
Copy Markdown
Member Author

I've reverted the unwinder_private_data_size and _Unwind_Exception.private visibility changes. Turns out EHABI on ARM does genuinely require the personality function to touch the private field.

@bjorn3 bjorn3 added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants