Compilation issue for xdp-bench
vahsek300501 opened this issue · comments
I am compliling xdp-tools. First I run ./configure and the I run make. The compilation till xdp-dump happens correctly but after that I starts giving the error for xdp-bench. The following is the error for the same.
"""
In file included from xdp_redirect_basic.c:25:
xdp_redirect_basic.c: In function ‘sample_init’:
../lib/util/xdp_sample.h:72:21: error: implicit declaration of function ‘bpf_program__type’; did you mean ‘bpf_program__size’? [-Werror=implicit-function-declaration]
72 | if (bpf_program__type(skel->progs.name) != BPF_PROG_TYPE_TRACING)
| ^~~~~~~~~~~~~~~~~
../lib/util/xdp_sample.h:111:25: note: in expansion of macro ‘__attach_tp’
111 | __attach_tp(tp_xdp_redirect_map);
| ^~~~~~~~~~~
xdp_redirect_basic.c:31:1: note: in expansion of macro ‘DEFINE_SAMPLE_INIT’
31 | DEFINE_SAMPLE_INIT(xdp_redirect_basic);
| ^~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
In file included from xdp_redirect_cpumap.c:28:
xdp_redirect_cpumap.c: In function ‘sample_init’:
../lib/util/xdp_sample.h:72:21: error: implicit declaration of function ‘bpf_program__type’; did you mean ‘bpf_program__size’? [-Werror=implicit-function-declaration]
72 | if (bpf_program__type(skel->progs.name) != BPF_PROG_TYPE_TRACING)
| ^~~~~~~~~~~~~~~~~
../lib/util/xdp_sample.h:111:25: note: in expansion of macro ‘__attach_tp’
111 | __attach_tp(tp_xdp_redirect_map);
| ^~~~~~~~~~~
xdp_redirect_cpumap.c:55:1: note: in expansion of macro ‘DEFINE_SAMPLE_INIT’
55 | DEFINE_SAMPLE_INIT(xdp_redirect_cpumap);
| ^~~~~~~~~~~~~~~~~~
xdp_redirect_cpumap.c: In function ‘do_redirect_cpumap’:
xdp_redirect_cpumap.c:240:24: error: implicit declaration of function ‘bpf_object__next_program’; did you mean ‘bpf_object__unpin_programs’? [-Werror=implicit-function-declaration]
240 | while ((prog = bpf_object__next_program(skel->obj, prog)) != NULL)
| ^~~~~~~~~~~~~~~~~~~~~~~~
| bpf_object__unpin_programs
xdp_redirect_cpumap.c:240:22: error: assignment to ‘struct bpf_program *’ from ‘int’ makes pointer from integer without a cast [-Werror=int-conversion]
240 | while ((prog = bpf_object__next_program(skel->obj, prog)) != NULL)
| ^
xdp_redirect_cpumap.c:242:21: error: implicit declaration of function ‘bpf_program__expected_attach_type’; did you mean ‘bpf_program__set_expected_attach_type’? [-Werror=implicit-function-declaration]
242 | bpf_program__expected_attach_type(prog) == BPF_XDP)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| bpf_program__set_expected_attach_type
cc1: all warnings being treated as errors
In file included from xdp_redirect_devmap.c:24:
xdp_redirect_devmap.c: In function ‘sample_init’:
../lib/util/xdp_sample.h:72:21: error: implicit declaration of function ‘bpf_program__type’; did you mean ‘bpf_program__size’? [-Werror=implicit-function-declaration]
72 | if (bpf_program__type(skel->progs.name) != BPF_PROG_TYPE_TRACING)
| ^~~~~~~~~~~~~~~~~
../lib/util/xdp_sample.h:111:25: note: in expansion of macro ‘__attach_tp’
111 | __attach_tp(tp_xdp_redirect_map);
| ^~~~~~~~~~~
xdp_redirect_devmap.c:30:1: note: in expansion of macro ‘DEFINE_SAMPLE_INIT’
30 | DEFINE_SAMPLE_INIT(xdp_redirect_devmap);
| ^~~~~~~~~~~~~~~~~~
xdp_redirect_devmap.c: In function ‘do_redirect_devmap’:
xdp_redirect_devmap.c:72:24: error: implicit declaration of function ‘bpf_object__next_program’; did you mean ‘bpf_object__unpin_programs’? [-Werror=implicit-function-declaration]
72 | while ((prog = bpf_object__next_program(skel->obj, prog)) != NULL)
| ^~~~~~~~~~~~~~~~~~~~~~~~
| bpf_object__unpin_programs
xdp_redirect_devmap.c:72:22: error: assignment to ‘struct bpf_program *’ from ‘int’ makes pointer from integer without a cast
-Werror=int-conversion]
72 | while ((prog = bpf_object__next_program(skel->obj, prog)) != NULL)
| ^
xdp_redirect_devmap.c:74:21: error: implicit declaration of function ‘bpf_program__expected_attach_type’; did you mean ‘bpf_program__set_expected_attach_type’? [-Werror=implicit-function-declaration]
74 | bpf_program__expected_attach_type(prog) == BPF_XDP)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| bpf_program__set_expected_attach_type
cc1: all warnings being treated as errors
In file included from xdp_redirect_devmap_multi.c:27:
xdp_redirect_devmap_multi.c: In function ‘sample_init’:
../lib/util/xdp_sample.h:72:21: error: implicit declaration of function ‘bpf_program__type’; did you mean ‘bpf_program__size’? [-Werror=implicit-function-declaration]
72 | if (bpf_program__type(skel->progs.name) != BPF_PROG_TYPE_TRACING)
| ^~~~~~~~~~~~~~~~~
../lib/util/xdp_sample.h:111:25: note: in expansion of macro ‘__attach_tp’
111 | __attach_tp(tp_xdp_redirect_map);
| ^~~~~~~~~~~
xdp_redirect_devmap_multi.c:37:1: note: in expansion of macro ‘DEFINE_SAMPLE_INIT’
37 | DEFINE_SAMPLE_INIT(xdp_redirect_devmap_multi);
| ^~~~~~~~~~~~~~~~~~
xdp_redirect_devmap_multi.c: In function ‘do_redirect_devmap_multi’:
xdp_redirect_devmap_multi.c:108:24: error: implicit declaration of function ‘bpf_object__next_program’; did you mean ‘bpf_object__unpin_programs’? [-Werror=implicit-function-declaration]
108 | while ((prog = bpf_object__next_program(skel->obj, prog)) != NULL)
| ^~~~~~~~~~~~~~~~~~~~~~~~
| bpf_object__unpin_programs
xdp_redirect_devmap_multi.c:108:22: error: assignment to ‘struct bpf_program *’ from ‘int’ makes pointer from integer without a cast [-Werror=int-conversion]
108 | while ((prog = bpf_object__next_program(skel->obj, prog)) != NULL)
| ^
xdp_redirect_devmap_multi.c:110:21: error: implicit declaration of function ‘bpf_program__expected_attach_type’; did you mean
bpf_program__set_expected_attach_type’? [-Werror=implicit-function-declaration]
110 | bpf_program__expected_attach_type(prog) == BPF_XDP)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| bpf_program__set_expected_attach_type
cc1: all warnings being treated as errors
In file included from xdp_basic.c:25:
xdp_basic.c: In function ‘sample_init’:
../lib/util/xdp_sample.h:72:21: error: implicit declaration of function ‘bpf_program__type’; did you mean ‘bpf_program__size’? [-Werror=implicit-function-declaration]
72 | if (bpf_program__type(skel->progs.name) != BPF_PROG_TYPE_TRACING)
| ^~~~~~~~~~~~~~~~~
../lib/util/xdp_sample.h:111:25: note: in expansion of macro ‘__attach_tp’
111 | __attach_tp(tp_xdp_redirect_map);
| ^~~~~~~~~~~
xdp_basic.c:30:1: note: in expansion of macro ‘DEFINE_SAMPLE_INIT’
30 | DEFINE_SAMPLE_INIT(xdp_basic);
| ^~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [../lib/common.mk:107: xdp-bench] Error 1
make: *** [Makefile:34: xdp-bench] Error 2
"""
Found clang binary 'clang' with version 14 (from 'Ubuntu clang version 14.0.0-1ubuntu1')
using /usr/lib/linux-tools/5.19.0-42-generic/bpftool v7.0.0
libbpf support: system v0.5.0
perf_buffer__consume support: yes
btf__load_from_kernel_by_id support: yes
btf__type_cnt support: no
bpf_object__next_map support: no
bpf_object__next_program support: no
bpf_program__insn_cnt support: no
bpf_program__type support: no
bpf_program__flags support: no
bpf_map_create support: no
perf_buffer__new_raw support: no
bpf_xdp_attach support: no
bpf_map__set_autocreate support: no
bpf_prog_test_run_opts support: no
secure_getenv support: yes
This is the output for ./configure
Please try #329
Alright, added another commit to #329 that hopefully fixes those as well. Please try that :)
Right, that's another bug unearthed by the previous changes. Added yet another commit to fix that, please try again :)
Alright, pushed another commit to hopefully take care of that one as well :)
Yes this commit worked. I was successfully able to compile the code. Thanks a lot for help 👍 :)
Awesome! Thank you for the report and for your help with debugging! :)