Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

cargo bpf build failure on Fedora #71

Closed
kbknapp opened this issue Aug 14, 2020 · 4 comments · Fixed by #72
Closed

cargo bpf build failure on Fedora #71

kbknapp opened this issue Aug 14, 2020 · 4 comments · Fixed by #72

Comments

@kbknapp
Copy link
Contributor

kbknapp commented Aug 14, 2020

Just compiling the hello example on fedora gives the error:

$ cargo bpf build
[ .. snip .. ]
   Compiling redbpf-probes v1.0.1
error: failed to run custom build command for `redbpf-probes v1.0.1`

Caused by:
  process didn't exit successfully: `/mnt/storage/Projects/hello-bpf/target/bpf/release/build/redbpf-probes-a7fe94a0d7f9d765/build-script-build` (exit code: 101)
  --- stderr
  /lib/modules/5.7.12-200.fc32.x86_64/source/include/net/flow_offload.h:304:4: error: use of undeclared identifier 'KBUILD_MODNAME'
  /lib/modules/5.7.12-200.fc32.x86_64/source/include/net/flow_offload.h:338:3: error: use of undeclared identifier 'KBUILD_MODNAME'
  /lib/modules/5.7.12-200.fc32.x86_64/source/include/net/flow_offload.h:342:3: error: use of undeclared identifier 'KBUILD_MODNAME'
  /lib/modules/5.7.12-200.fc32.x86_64/source/include/net/flow_offload.h:304:4: error: use of undeclared identifier 'KBUILD_MODNAME', err: true
  /lib/modules/5.7.12-200.fc32.x86_64/source/include/net/flow_offload.h:338:3: error: use of undeclared identifier 'KBUILD_MODNAME', err: true
  /lib/modules/5.7.12-200.fc32.x86_64/source/include/net/flow_offload.h:342:3: error: use of undeclared identifier 'KBUILD_MODNAME', err: true
  thread 'main' panicked at 'failed to generate bindings: ()', /home/kevin/.cargo/registry/src/github.com-1ecc6299db9ec823/redbpf-probes-1.0.1/build.rs:74:10
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: failed to compile the `block_http' program

Following the exact same instructions on Ubuntu 20.04 yields a successful build.

@alessandrod
Copy link
Contributor

Thanks for reporting the issue!

I think the latest kernel version we run on CI is 5.4, so there's probably a little porting work we need to do for newer kernels. What fedora version is this?

@kbknapp
Copy link
Contributor Author

kbknapp commented Aug 14, 2020

Fedora 32 which currently ships with kernel 5.7.14. I tried it on a few 5.7.x kernels but all had the same result.

@rsdy
Copy link
Collaborator

rsdy commented Aug 15, 2020

Everything up to 5.6 should work. Unfortunately I haven't had time to track the changes made in 5.7 onwards yet, and I can't put an ETA on it right now, but it doesn't seem like a huge piece of work.

@rsdy
Copy link
Collaborator

rsdy commented Aug 21, 2020

@kbknapp I've merged a PR that will enable compilation on 5.7 onwards. Let me know if you have any issues on Fedora in 1.1.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants