bindings.h:1:10: fatal error: 'btf.h' file not found #334
Comments
Same issue here. I'm on Ubuntu 22.04 and have Any help/input would be highly appreciated. Thanks in advance! Let me know if you need any more information. |
https://github.com/foniod/redbpf#building-redbpf-from-source Please make sure you sync the submodules and try again. Let me know if build still fails then! @bendahl RedBPF on |
@rsdy Thanks for the super quick reply! I just gave this a try (using the I will make sure to check out the other link you provided to see whether I'm missing some important step. |
Quick update: This was totally my fault. I missed the important step of syncing/updating the git submodules (as described in the document you linked above). Doing this and using the Thank you so much! |
@bendahl If you could provide me the steps that you did to solve this problem, that would be very much helpful. |
@bendahl I hope you followed these steps
|
are the 2 commands specifically you'll need. Let me know how it goes. |
@rsdy warning: field is never read: `flags`
--> redbpf/src/symbols.rs:110:5
|
110 | flags: i32,
| ^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
note: `CacheEntry` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
--> redbpf/src/symbols.rs:106:10
|
106 | #[derive(Debug)]
| ^^^^^
= note: this warning originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: `redbpf` (lib) generated 1 warning
Compiling redbpf-probes v2.3.0 (/home/u1tron/redbpf/redbpf-probes)
Compiling probes v0.1.0 (/home/u1tron/redbpf/redbpf-tools/probes)
Compiling redbpf-tools v0.1.0 (/home/u1tron/redbpf/redbpf-tools)
Compiling example-probes v0.1.0 (/home/u1tron/redbpf/examples/example-probes)
error: failed to run custom build command for `redbpf-tools v0.1.0 (/home/u1tron/redbpf/redbpf-tools)`
Caused by:
process didn't exit successfully: `/home/u1tron/redbpf/target/debug/build/redbpf-tools-3d0d971cdb53b260/build-script-build` (exit status: 101)
--- stderr
thread 'main' panicked at 'couldn't compile probes: InvalidLLVMVersion("LLVM version that cargo-bpf linked to (13.0) < LLVM version that rustc depends on (14.0). You should re-build cargo-bpf with LLVM version (14.0), or downgrade rustc that uses LLVM version (13.0)")', redbpf-tools/build.rs:16:10
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish... |
Do I have to use this build command instead of that one |
@yasin-cs-ko-ak Seems like I'm a bit late to the party... However, to answer your question: Yes, I used the following commands to update the submodules:
I then ran My setup is as follows:
Due to the fact that I'm using llvm 14 I had to switch to nbaksalyar/redbpf:llvm14. As mentioned by @rsdy there is a pull request regarding llvm 14 support (see #316). I hope this helps! |
@bendahl Well, I have tried with that repository mentioned above. I still got the same error as previous and then I decided to try again with different method. I downloaded that repository as ZIP and then initiated using
I think there is something wrong with my LLVM version. |
@rsdy @bendahl
and also I was looking at this. This might be helpful for this. #213 |
@yasin-cs-ko-ak Please try the branch with LLVM14 support among the PRs. |
I do have my header file in this directory
/usr/include/uapi/linux/btf.h
. But it's not compiling properly.and also I am installed
cargo-bpf
with this commandcargo install cargo-bpf --no-default-features --features=llvm13,command-line
any thoughts?
The text was updated successfully, but these errors were encountered: