samples: bpf: fix build error
Subsystems (3)
PATCH 1/1 samples: bpf: fix build error
GCC 10 is very strict about symbol clash, and lwt_len_hist_user contains a symbol which clashes with libbpf:
/usr/bin/ld: samples/bpf/lwt_len_hist_user.o:(.bss+0x0): multiple definition of `bpf_log_buf'; samples/bpf/bpf_load.o:(.bss+0x8c0): first defined here
collect2: error: ld returned 1 exit status
bpf_log_buf here seems to be a leftover, so removing it.
--- samples/bpf/lwt_len_hist_user.c | 2 -- 1 file changed, 2 deletions(-)
samples/bpf/lwt_len_hist_user.c +0 -2
@@ -15,8 +15,6 @@#define MAX_INDEX 64#define MAX_STARS 38 -char bpf_log_buf[BPF_LOG_BUF_SIZE ]; -static void stars (char *str,long val,long max,int width) {int i;
Signature · 1 line
2.26.2
Quoted 9 lines · Matteo Croce
GCC 10 is very strict about symbol clash, and
lwt_len_hist_usercontains a symbol which clashes with libbpf:
/usr/bin/ld: samples/bpf/lwt_len_hist_user.o:(.bss+0x0): multiple definition of `bpf_log_buf'; samples/bpf/bpf_load.o:(.bss+0x8c0): first defined here
collect2: error: ld returned 1 exit status
bpf_log_bufhere seems to be a leftover, so removing it.Signed-off-by Matteo Croce <[email protected]>
Alexei Starovoitov
AppliedQuoted 7 lines · Yonghong Song
Quoted 3 lines · Matteo Croce
GCC 10 is very strict about symbol clash, and
lwt_len_hist_usercontains a symbol which clashes with libbpf:
Quoted 8 lines
Quoted 6 lines
/usr/bin/ld: samples/bpf/lwt_len_hist_user.o:(.bss+0x0): multiple definition of `bpf_log_buf'; samples/bpf/bpf_load.o:(.bss+0x8c0): first defined here
collect2: error: ld returned 1 exit status
bpf_log_bufhere seems to be a leftover, so removing it.Signed-off-by Matteo Croce <[email protected]>Acked-by Yonghong Song <[email protected]>
Applied to bpf tree. Thanks