Aravind Buduri
Aravind Buduri

Reputation: 31

kernel compilation error when CONFIG_DEBUG_INFO_BTF is enabled

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.

Upvotes: 3

Views: 6962

Answers (2)

Veeresh Navali
Veeresh Navali

Reputation: 1

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/

Upvotes: 0

4t8dds
4t8dds

Reputation: 673

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.

Upvotes: 3

Related Questions