bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yonghong Song <yhs@fb.com>
To: <sedat.dilek@gmail.com>, Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>,
	Martin KaFai Lau <kafai@fb.com>, Song Liu <songliubraving@fb.com>,
	John Fastabend <john.fastabend@gmail.com>,
	KP Singh <kpsingh@kernel.org>,
	Masahiro Yamada <masahiroy@kernel.org>
Cc: <bpf@vger.kernel.org>, <linux-kbuild@vger.kernel.org>
Subject: Re: Check pahole availibity and BPF support of toolchain before starting a Linux kernel build
Date: Mon, 11 Jan 2021 08:05:03 -0800	[thread overview]
Message-ID: <fa019010-9d7c-206c-d2c6-0893381f5913@fb.com> (raw)
In-Reply-To: <CA+icZUVuk5PVY4_HoCoY2ymd27UjuDi6kcAmFb_3=dqkvOA_Qw@mail.gmail.com>



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
> 

  reply	other threads:[~2021-01-11 16:06 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-11 12:48 Check pahole availibity and BPF support of toolchain before starting a Linux kernel build Sedat Dilek
2021-01-11 16:05 ` Yonghong Song [this message]
2021-01-11 17:56   ` Sedat Dilek
2021-01-11 21:03     ` Andrii Nakryiko
     [not found]       ` <CA+icZUVrF_LCVhELbNLA7=FzEZK4=jk3QLD9XT2w5bQNo=nnOA@mail.gmail.com>
2021-01-11 22:31         ` Jiri Olsa
2021-01-11 22:34           ` Tom Stellard
2021-01-12 10:46             ` Jiri Olsa
2021-01-12 13:10               ` Jiri Olsa
2021-01-12 16:14                 ` Sedat Dilek
2021-01-12 16:21                   ` Jiri Olsa
2021-01-12 17:18                     ` Sedat Dilek
2021-01-12 20:47                     ` Sedat Dilek
2021-01-12 21:36                       ` Sedat Dilek
2021-01-14 14:13           ` Sedat Dilek
2021-01-14 14:24             ` Jiri Olsa
2021-01-14 14:29               ` Sedat Dilek
     [not found]                 ` <CA+icZUXp5gkxCr+mybQ8uO3xx+rVmmRSnN7Dfx0Xmr+VQWyZAA@mail.gmail.com>
2021-01-14 15:13                   ` Sedat Dilek
2021-01-12  0:57         ` Yonghong Song
2021-01-12  4:09           ` Sedat Dilek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fa019010-9d7c-206c-d2c6-0893381f5913@fb.com \
    --to=yhs@fb.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=kpsingh@kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=sedat.dilek@gmail.com \
    --cc=songliubraving@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).