From: Jiri Olsa <olsajiri@gmail.com>
To: "Zeng, Oak" <oak.zeng@intel.com>
Cc: Kumar Kartikeya Dwivedi <memxor@gmail.com>,
"bpf@vger.kernel.org" <bpf@vger.kernel.org>
Subject: Re: Build error of samples/bpf
Date: Fri, 15 Jul 2022 10:26:10 +0200 [thread overview]
Message-ID: <YtEkosDJ2O0CXlL/@krava> (raw)
In-Reply-To: <BN6PR11MB163373657888237AB489C996928B9@BN6PR11MB1633.namprd11.prod.outlook.com>
On Fri, Jul 15, 2022 at 03:54:42AM +0000, Zeng, Oak wrote:
SNIP
> > > CC samples/bpf/xdp_router_ipv4_user.o
> > > CC samples/bpf/xdp_rxq_info_user.o
> > > CC samples/bpf/xdp_sample_pkts_user.o
> > > CC samples/bpf/xdp_tx_iptunnel_user.o
> > > CC samples/bpf/xdpsock_ctrl_proc.o
> > > CC samples/bpf/xsk_fwd.o
> > > CLANG-BPF samples/bpf/xdp_sample.bpf.o
> > > CLANG-BPF samples/bpf/xdp_redirect_map_multi.bpf.o
> > > CLANG-BPF samples/bpf/xdp_redirect_cpu.bpf.o
> > > CLANG-BPF samples/bpf/xdp_redirect_map.bpf.o
> > > CLANG-BPF samples/bpf/xdp_monitor.bpf.o
> > > CLANG-BPF samples/bpf/xdp_redirect.bpf.o
> > > BPF GEN-OBJ samples/bpf/xdp_monitor
> > > BPF GEN-SKEL samples/bpf/xdp_monitor
> > > libbpf: map 'rx_cnt': unexpected def kind var.
> >
> > IIRC, this error is due to older clang. Can you try with a newer clang
> > (11 and above)?
>
> Thank you Kumar.
>
> I updated to llvm/clang to version 12, the issue persists.
>
> I also have another problem... To build those xdp samples, I need to enable CONFIG_DEBUG_INFO_BTF. But once this is enabled, I failed to build linux kernel with below errors. I was able to build on a 4.15 ubuntu machine but on a 5.11 ubuntu machine, I had below error to build the same kernel. Any one can give me some hint? I searched google but didn't figure out. I noticed somethings is killed during build of .bpf.vmlinux.bin.o, so I guess some of my tools is not updated?
>
>
>
> szeng@szeng-develop:~/dii-tools/linux$ make -j$(nproc)
> DESCEND objtool
> DESCEND bpf/resolve_btfids
> CALL scripts/atomic/check-atomics.sh
> CALL scripts/checksyscalls.sh
> CHK include/generated/compile.h
> UPD include/generated/compile.h
> CC init/version.o
> AR init/built-in.a
> CHK kernel/kheaders_data.tar.xz
> GEN .version
> CHK include/generated/compile.h
> UPD include/generated/compile.h
> CC init/version.o
> AR init/built-in.a
> LD vmlinux.o
> MODPOST vmlinux.symvers
> MODINFO modules.builtin.modinfo
> GEN modules.builtin
> LD .tmp_vmlinux.btf
> BTF .btf.vmlinux.bin.o
> Killed
looks like something happened during BTF generation and that's
probably the reason why 'BTFIDS' is failing below
I'd double check with V=1 and if it's pahole that's killed,
I'd check that you can run it properly.. maybe some library
mismatch? or try to build and install the latest pahole
there was similar issue recently:
https://lore.kernel.org/bpf/CAJQ9wQ-0UUAqzyB5P9Xy_0=hpxg9m+2OEzAmk2nWnoX9es9Gnw@mail.gmail.com/T/#t
jira
> LD .tmp_vmlinux.kallsyms1
> KSYMS .tmp_vmlinux.kallsyms1.S
> AS .tmp_vmlinux.kallsyms1.S
> LD .tmp_vmlinux.kallsyms2
> KSYMS .tmp_vmlinux.kallsyms2.S
> AS .tmp_vmlinux.kallsyms2.S
> LD vmlinux
> BTFIDS vmlinux
> FAILED: load BTF from vmlinux: No such file or directory
> make: *** [Makefile:1183: vmlinux] Error 255
> make: *** Deleting file 'vmlinux'
>
>
> Thanks,
> Oak
>
> >
> > > Error: failed to open BPF object file: Invalid argument
> > > samples/bpf/Makefile:430: recipe for target
> > 'samples/bpf/xdp_monitor.skel.h' failed
> > > make[1]: *** [samples/bpf/xdp_monitor.skel.h] Error 255
> > > make[1]: *** Deleting file 'samples/bpf/xdp_monitor.skel.h'
> > > Makefile:1868: recipe for target 'samples/bpf' failed
> > > make: *** [samples/bpf] Error 2
> > >
> > >
> > > Thanks,
> > > Oak
> > >
next prev parent reply other threads:[~2022-07-15 8:26 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <BN6PR11MB16338E9998353C6B239CD27792869@BN6PR11MB1633.namprd11.prod.outlook.com>
2022-07-12 13:50 ` Build error of samples/bpf Zeng, Oak
2022-07-12 17:22 ` sdf
2022-07-13 15:20 ` Zeng, Oak
2022-07-13 16:18 ` sdf
2022-07-13 20:18 ` Daniel Müller
2022-07-26 20:22 ` Daniel Müller
2022-07-14 5:13 ` Andrii Nakryiko
2022-07-13 18:21 ` Kumar Kartikeya Dwivedi
2022-07-15 3:54 ` Zeng, Oak
2022-07-15 8:26 ` Jiri Olsa [this message]
2022-07-15 16:08 ` Zeng, Oak
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=YtEkosDJ2O0CXlL/@krava \
--to=olsajiri@gmail.com \
--cc=bpf@vger.kernel.org \
--cc=memxor@gmail.com \
--cc=oak.zeng@intel.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