-
Notifications
You must be signed in to change notification settings - Fork 95
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
consumers using CO.RE might need vmlinux.h generation from BTF: it might not be available OR be different compile/run time #30
Comments
Why BTF is required? |
But you're already including: At: https://github.com/rafaeldtinoco/libbpfgo/blob/main/Makefile#L87 we would be generating it automatically, but the building env might not be able to do so.
This also opens the question: libbpfgo on top of older kernels, or having BPF objects (of consumers) being built with vmlinux.h files (generated during build time ? or previously ? what kernel code base if previously ?)
That is why I started with: So libbpfgo consumers might be able to do static or dynamic compiling of libbpfgo, and, perhaps, decide wether new vmlinux.h should be generated or not (if bpftool is available, if build environment kernel supports BTF, etc).
Makes sense ? |
We don't use vmlinux.h if CORE define was not chosen. |
This is tricky:
If consumers are using libbpfgo as libbpf is supposed to be used, and CORE is 'enabled' in that usage, then the BPF objects don't necessarily need So perhaps I should rename this issue to reflect this discussion.
|
Ok, now it is more clear. |
Nice catch ;). It was meant for the libbpfgo-dynamic-test only (because of the .bpf.c dependencies) but libbpfgo-test-bpf is already depending on it. I'm fixing that there.
Yes, there is much room for improvement there. I'll fix that but, for now, will likely add an error message only. Then, when solving this issue, I might do something else I guess. |
Okay, we assume that whoever is using libbpfgo will always have to build in a system that has BTF available (/sys/kernel/btf/vmlinux) and this issue does not apply any longer. |
If the build system is running a recent kernel without BTF enabled... the build might fail. We could (should ?) include a default minor vmlinux.h so the build succeeds. Thoughts ?
The text was updated successfully, but these errors were encountered: