1

I am want to compile linux 5.10.162 with CONFIG_DEBUG_INFO_BTF=y, the end goal being to enable bpf CO-RE. However, the build is failing with:

+ ./tools/bpf/resolve_btfids/resolve_btfids vmlinux
FAILED unresolved symbol udp_sock

I first thought it was something similar to this issue, but after moving to a newer gcc, the issue persists.

Relevant packages:

  • gcc 11.1.0 (also tested with 10.2)
  • dwarves 1.24 (also tested with 1.22)

Bear in mind don't have much experience compiling linux. Let me know if the config will be of use.

Ivan Kalchev
  • 345
  • 1
  • 4
  • 9
  • 1
    What architecture are you building for? How did you configure the kernel before starting the build? And also how did you enable `CONFIG_DEBUG_INFO_BTF=y` specifically? I.E. which commands did you use? – Marco Bonelli Feb 17 '23 at 17:43
  • @MarcoBonelli I am targeting x86_64. I added the option directly in the config file (not through menuconfig) next to the linux.spec file. That said, I should’ve mentioned I am building a full distro all together (hence the spec file) – Ivan Kalchev Feb 17 '23 at 19:35
  • 3
    "*I added the option directly in the config file (not through menuconfig)*" -- So you ignored the warning (in the **.config** file) not to edit it? You need to use the **menuconfig** method to ensure that all *dependencies* are satisfied, as well as all *auto-selections* are performed. – sawdust Feb 18 '23 at 01:19
  • 1
    Exactly what @sawdust said, you should not directly edit the `.config` file like that. Use one of the various `*config` targets to do that, like for example `menuconfig`. – Marco Bonelli Feb 18 '23 at 12:15
  • see https://cateee.net/lkddb/web-lkddb/DEBUG_INFO_BTF.html – stark Feb 18 '23 at 14:07
  • 1
    Note that you don't necessarily need BTF for bpf CO-RE. Indeed, it's easier if you have it but, if you don't, you can directly get the `vmlinux.h` corresponding to your target's environment (e.g., with BTFGen). – Justin Iurman Feb 18 '23 at 15:05
  • @sawdust I tried adding the option through the menuconfig - same result. Any other advice? – Ivan Kalchev Feb 19 '23 at 07:03
  • Did you try a clean build? I.E. `make distclean`, `make my_board_defconfig`. `make menuconfig`, ... , and finally `make`. – sawdust Feb 21 '23 at 02:05

0 Answers0