-
Couldn't load subscription status.
- Fork 140
define-syscall: Add bpf target #387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
define-syscall/src/lib.rs
Outdated
| pub mod definitions; | ||
|
|
||
| #[cfg(target_feature = "static-syscalls")] | ||
| #[cfg(any(target_feature = "static-syscalls", target_arch = "bpf"))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, just to make sure, but is this correct?
From what I understand, static-syscalls are only supported with sbfv3, which might not be enabled. The SIMD still hasn't been accepted: solana-foundation/solana-improvement-documents#178
In that case, shouldn't we avoid using static syscalls for bpf for now and instead use the old model?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point – we had an offline discussion about this. The use of static syscalls for sbpf v0 is unstable, since it was not designed to work with it. While the current implementation works, they have never been tested for v0.
To make this more explicitly, an "unstable-static-syscalls" feature was added to the crate, which needs to be enabled on target_arch = "bpf".
| [features] | ||
| unstable-static-syscalls = [] | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this feature is reasonable, because it conveys the message that it is usable, but we don't guarantee it to work.
To complement, we could write a short comment here saying "static syscalls for eBPF are experimental and not guaranteed to work".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
Problem
The upstream compiler uses
target_arch = "bpf"when compiling tobpfel-unknown-nonetarget, while thecfgconditional compilation is currently using onlytarget_os = "solana".Solution
Add
target_arch = "bpf"along sidetarget_os = "solana".