on eBPF a Rust fn should handle more than 5 args
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
By default, eBPF only supports a 5-argument register calling convention. This is the only "standardized" ABI. In practice, compilers support stack-passing calling conventions for further arguments, and Rust is not required to follow a standard ABI for Rust to Rust calls. Nonetheless, because 5 args is the only standard, reputedly 5 args is what LLVM implements and the rest must be implemented by the frontend. We should be supporting argument-passing on the stack for extern "Rust" on eBPF if we're going to bother supporting bpfe{l,b}-unknown-none at all.
I'm opening this in advance of assembling a full repro before I forget it. It is possible this is no longer an issue and we only need an assembly test to verify we can handle 10 args on eBPF. h/t @saleemrashid
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by assembling the promised reproduction for an extern "Rust" function with more than five arguments on the bpfe{l,b}-unknown-none eBPF targets. Inspect the generated assembly and determine whether stack-passed arguments already work; done means either confirming support with an assembly test for ten arguments or identifying the missing frontend behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100