Skip to content

Register shims to global shim table, add register! macro - #5672

Open
WhySoBad wants to merge 2 commits into
rust-lang:masterfrom
WhySoBad:shim-registration-refactor
Open

WhySoBad wants to merge 2 commits into
rust-lang:masterfrom
WhySoBad:shim-registration-refactor

Conversation

@WhySoBad

@WhySoBad WhySoBad commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

This PR adds a new shim table on the Miri machine which contains all shims which are available for the current target.
Instead of matching shims by name in a big match statements when they are invoked, we now just need to look up the name in the global shim table.

To register shims to the shim table, a new register! macro has been added. In the first commit of this PR are all changes without the macro (i.e., it contains the code to which the macro would expand), and in the second commit the macro is added, and the expanded register functions are replaced by macro invocations.

Currently the macro supports variadic and non-variadic shims, custom call handleres, and custom shim results. To showcase this, the poll, accept, accept4, fcntl, and miri_start_unwind shims have been ported to the new system.

@rustbot rustbot added the S-waiting-on-review Status: Waiting for a review to complete label Nov 23, 2026
@WhySoBad
WhySoBad force-pushed the shim-registration-refactor branch from 7c07d84 to 519ad37 Compare November 23, 2026 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Waiting for a review to complete

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants