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 Thu, Jan 14, 2021 at 3:50 PM Sedat Dilek <sedat.dilek@xxxxxxxxx> wrote:
>
> On Thu, Jan 14, 2021 at 3:29 PM Sedat Dilek <sedat.dilek@xxxxxxxxx> wrote:
> >
> > On Thu, Jan 14, 2021 at 3:24 PM Jiri Olsa <jolsa@xxxxxxxxxx> wrote:
> > >
> > > On Thu, Jan 14, 2021 at 03:13:18PM +0100, Sedat Dilek wrote:
> > > > On Mon, Jan 11, 2021 at 11:31 PM Jiri Olsa <jolsa@xxxxxxxxxx> wrote:
> > > > >
> > > > > On Mon, Jan 11, 2021 at 10:30:22PM +0100, Sedat Dilek wrote:
> > > > >
> > > > > SNIP
> > > > >
> > > > > > > >
> > > > > > > > Building a new Linux-kernel...
> > > > > > > >
> > > > > > > > - Sedat -
> > > > > > > >
> > > > > > > > [1] https://git.kernel.org/pub/scm/devel/pahole/pahole.git/
> > > > > > > > [2] https://github.com/ClangBuiltLinux/tc-build/issues/129#issuecomment-758026878
> > > > > > > > [3] https://github.com/ClangBuiltLinux/tc-build/issues/129#issuecomment-758056553
> > > > > > >
> > > > > > > There are no significant bug fixes between pahole 1.19 and master that
> > > > > > > would solve this problem, so let's try to repro this.
> > > > > > >
> > > > > >
> > > > > > You are right pahole fom latest Git does not solve the issue.
> > > > > >
> > > > > > + 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
> > > > >
> > > > > hm, is there a .BTF section in vmlinux?
> > > > >
> > > > > is this working over vmlinux:
> > > > >  $ bpftool btf dump file ./vmlinux
> > > > >
> > > >
> > > > I switched to LLVM v12 from <apt.llvm.org> and saw the same FAILED line.
> > > >
> > > > The generated vmlinux file is cleaned on failure.
> > > >
> > > > + 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
> > >
> > > did pahole generated the .BTF section? earlier in the log
> > >
> > > jirka
> > >
> >
> > Cannot say.
> >
> > I did:
> >
> > $ git diff
> > diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh
> > index 2d0b28758aa5..c6e679d08bbe 100755
> > --- a/scripts/link-vmlinux.sh
> > +++ b/scripts/link-vmlinux.sh
> > @@ -401,12 +401,6 @@ fi
> >
> > vmlinux_link vmlinux "${kallsymso}" ${btf_vmlinux_bin_o}
> >
> > -# fill in BTF IDs
> > -if [ -n "${CONFIG_DEBUG_INFO_BTF}" -a -n "${CONFIG_BPF}" ]; then
> > -       info BTFIDS vmlinux
> > -       ${RESOLVE_BTFIDS} vmlinux
> > -fi
> > -
> > if [ -n "${CONFIG_BUILDTIME_TABLE_SORT}" ]; then
> >        info SORTTAB vmlinux
> >        if ! sorttable vmlinux; then
> >
>
> Before...
>
> Encountered error while encoding BTF.
> + llvm-objcopy --only-section=.BTF --set-section-flags
> .BTF=alloc,readonly --strip-all .tmp_vmlinux.btf .btf.vmlinux.bin.o
>
> ...I see lots of errors.
>
> I have cut the relevant stuff and placed it in the attachment.
>
> With freshly installed bpftool:
>
> $ /usr/sbin/bpftool btf dump file ./vmlinux
> Error: failed to load BTF from ./vmlinux: Invalid argument
>

This is with CONFIG_DEBUG_INFO_DWARF4=y.
( See attached patch with cover-letter - applied here on top of Linux
v5.11-rc3+).

Concerning this I am looking into [1]:

die__process_unit: DW_TAG_label (0xa) @ <0xa7> not handled!
die__process_unit: tag not supported 0xa (label)!

- Sedat -

[1] http://www.dwarfstd.org/doc/DWARF4.pdf > 3.5 LABEL ENTRIES

Attachment: v4_20210112_ndesaulniers_kbuild_dwarf_v5_support.cover
Description: Binary data

Attachment: v4_20210112_ndesaulniers_kbuild_dwarf_v5_support.mbx
Description: Binary data


[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux