Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
docs: Add documentation for BPF targets #135107
base: master
Are you sure you want to change the base?
docs: Add documentation for BPF targets #135107
Changes from all commits
33873b5
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
This fails building the docs at stage2:
The errors being, among others:
Could you also document how to prevent building docs for std and alloc here, which are not supported by the bpf targets? (without disabling docs entirely through
--disable-docs
, and without dropping other targets from the same rustc that do successfully build std docs)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.
This is a bug in the bootstrap code, so nothing that should have to be addressed by the documentation, see #137073
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.
Accepted by what, exactly? You mean a specific component of the kernel, right? Does the eBPF verifier also check debuginfo? Or is it that the debugger requires a specific debuginfo format?
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.
AFAIK the BPF dynamic linker uses BTF to do things like checking for compatibility of the BPF module with the type layouts of the kernel itself. And through special relocations it can fill in the offsets of fields for kernel types such that the BPF module can run on multiple kernel versions even if the layout of types used by the BPF module changes across those kernel versions. The latter almost certainly will require explicit rustc support to get wired up.
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.
@workingjubilee the kernel validates the BTF info as part of calling
bpf_program_load
. Producing valid BTF right now means... generating whatever clang generates for C code. Non-C symbols in type names are not allowed (eg<
inFoo<u8>
), and there are some other annoying constraints.@bjorn3 we discussed implementing BTF relocs on zulip a couple of years ago. Long term, you're correct it requires explicit rustc support if only because what debuginfo rustc generates with
-C debuginfo
is unspecified, so going from DI => relocs is fragile. In the meantime we think we can probably hack it up in bpf-linker tho.Check failure on line 74 in src/doc/rustc/src/platform-support/bpf-unknown-none.md
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.
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.
is this referring to our UI testsuite, or is it referring to
#[test]
functions, or both?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.
To both.
Check failure on line 95 in src/doc/rustc/src/platform-support/bpf-unknown-none.md
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.
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 think this wants a no_run?