On 12/26/22 3:34 AM, Rong Tao wrote:
Hi, Andrii. It is much better to get an explicit compiler error than to debug the BPF Verifier failure later. But should we let the other selftests continue to compile? I get the following compilation error, and the compilation is aborted:
btf_type_tag and btf_decl_tag are supported since llvm14, could you upgrade your compiler? If you want to truely test selftests, you should
try to use recent compilers, otherwise, some selftests may fail and some others may be skipped.
$ make -C tools/testing/selftests/bpf/ CLNG-BPF [test_maps] cgrp_ls_attach_cgroup.bpf.o progs/cb_refs.c:7:29: error: unknown attribute 'btf_type_tag' ignored [-Werror,-Wunknown-attributes] struct prog_test_ref_kfunc __kptr_ref *ptr; ^~~~~~~~~~ /home/rongtao/Git/linux/tools/testing/selftests/bpf/tools/include/bpf/bpf_helpers.h:178:35: note: expanded from macro '__kptr_ref' #define __kptr_ref __attribute__((btf_type_tag("kptr_ref"))) ^~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. make: *** [Makefile:541: /home/rongtao/Git/linux/tools/testing/selftests/bpf/cb_refs.bpf.o] Error 1 make: *** Waiting for unfinished jobs.... In file included from progs/cgrp_kfunc_failure.c:8: progs/cgrp_kfunc_common.h:13:16: error: unknown attribute 'btf_type_tag' ignored [-Werror,-Wunknown-attributes] struct cgroup __kptr_ref * cgrp; ^~~~~~~~~~ /home/rongtao/Git/linux/tools/testing/selftests/bpf/tools/include/bpf/bpf_helpers.h:178:35: note: expanded from macro '__kptr_ref' #define __kptr_ref __attribute__((btf_type_tag("kptr_ref"))) ^~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. make: *** [Makefile:541: /home/rongtao/Git/linux/tools/testing/selftests/bpf/cgrp_kfunc_failure.bpf.o] Error 1 In file included from progs/cgrp_kfunc_success.c:8: progs/cgrp_kfunc_common.h:13:16: error: unknown attribute 'btf_type_tag' ignored [-Werror,-Wunknown-attributes] struct cgroup __kptr_ref * cgrp; ^~~~~~~~~~ /home/rongtao/Git/linux/tools/testing/selftests/bpf/tools/include/bpf/bpf_helpers.h:178:35: note: expanded from macro '__kptr_ref' #define __kptr_ref __attribute__((btf_type_tag("kptr_ref"))) ^~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. make: *** [Makefile:541: /home/rongtao/Git/linux/tools/testing/selftests/bpf/cgrp_kfunc_success.bpf.o] Error 1 make: Leaving directory '/home/rongtao/Git/linux/tools/testing/selftests/bpf' Best wishes. Rong Tao