Re: Check pahole availibity and BPF support of toolchain before starting a Linux kernel build

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 1/11/21 4:48 AM, Sedat Dilek wrote:
Hi BPF maintainers and Mashiro,

Debian started to use CONFIG_DEBUG_INFO_BTF=y.

My kernel-build fails like this:

+ info BTFIDS vmlinux
+ [  != silent_ ]
+ printf   %-7s %s\n BTFIDS vmlinux
  BTFIDS  vmlinux
+ ./tools/bpf/resolve_btfids/resolve_btfids vmlinux
FAILED: load BTF from vmlinux: Invalid argument

The root cause is my selfmade LLVM toolchain has no BPF support.

linux build should depend on LLVM toolchain unless you use LLVM to build kernel.


$ which llc
/home/dileks/src/llvm-toolchain/install/bin/llc

$ llc --version
LLVM (http://llvm.org/ ):
  LLVM version 11.0.1
  Optimized build.
  Default target: x86_64-unknown-linux-gnu
  Host CPU: sandybridge

  Registered Targets:
    x86    - 32-bit X86: Pentium-Pro and above
    x86-64 - 64-bit X86: EM64T and AMD64

Debian's llc-11 shows me BPF support is built-in.

I see the breakag approx. 3 hours after the start of my kernel-build -
in the stage "vmlinux".
After 2 faulures in my build (2x 3 hours of build-time) I have still
no finished Linux v5.11-rc3 kernel.
This is a bit frustrating.

You mean "BTFIDS  vmlinux" takes more than 3 hours here?
Maybe a bug in resolve_btfids due to somehow different ELF format
resolve_btfids need to handle?


What about doing pre-checks - means before doing a single line of
compilation - to check for:
1. Required binaries
2. Required support of whatever feature in compiler, linker, toolchain etc.

Recently, I fell over depmod binary not found in my PATH - in one of
the last steps (modfinal) of the kernel build.

Any ideas to improve the situation?
( ...and please no RTFM, see links below. )

Thanks.

Regards,
- Sedat -


[0] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/scripts/link-vmlinux.sh#n144
[1] https://salsa.debian.org/kernel-team/linux/-/commit/929891281c61ce4403ddd869664c949692644a2f
[2] https://www.kernel.org/doc/html/latest/bpf/bpf_devel_QA.html?highlight=pahole#llvm
[3] https://www.kernel.org/doc/html/latest/bpf/btf.html?highlight=pahole#btf-generation




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux