1
FAILED: load BTF from vmlinux: No such file or directory
make: *** [Makefile:1164: vmlinux] Error 255
make: *** Deleting file 'vmlinux'
root@akb:/home/akb/SRC/net/net-next# 

I have to enable BTF for my BPF xdp program to work.

Environment :on ubuntu 22.04 VM, net-next(5.19) latest version is compiled and installed on VM. recompiling is giving error. any pointers...? Thanks in advance.

Ian Abbott
  • 15,083
  • 19
  • 33
  • Did you resolve this? I had the same issue now. I am on CentOs 8.0 and kernnel 5.19. Is there config for this? – 4t8dds Aug 08 '22 at 03:12

2 Answers2

2

I got the same issue resolved.

First you need to make sure CONFIG_DEBUG_INFO_BTF=y is set and pahole is installed from https://github.com/acmel/dwarves. And I enabled CONFIG_DEBUG_INFO_SWARF4=y

And you have to make the pahole libs linked(This stopped me for long.): export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH

My previous failures are:

  1. I did not disable CONFIG_DEBUG_INFO_NONE. This config is for disable all the debug config info.
  2. some modules failure, like SSSE3 and chacha20 module. I just disabled them tool. These are crypto modules not sure why they fail.

I hope this would also help you.

4t8dds
  • 565
  • 7
  • 19
0

In kernel source, when CONFIG_DEBUG_INFO_BTF is enabled in .config file then copy the vmlinux from /sys/kernel/btf/vmlinux to /usr/lib/modules/uname -r/build/

cp /sys/kernel/btf/vmlinux /usr/lib/modules/uname -r/build/

or sudo /sys/kernel/btf/vmlinux /usr/lib/modules/uname -r/build/