Re: [QUESTION] build errors and warnings when make M=samples/bpf

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 1/11/21 12:17 AM, Tiezhu Yang wrote:
Hi all,

I found the following build errors and warnings when make M=samples/bpf
on the Loongson 3A3000 platform which belongs to MIPS arch.

Are theseknown issues? Should I submit patches to fix them? (1) fatal error: 'asm/rwonce.h' file not found

These issues may be mips specific. Sure you can submit patches to fix
these issues.


CLANG-bpf samples/bpf/xdpsock_kern.o In file included from samples/bpf/xdpsock_kern.c:2: In file included from ./include/linux/bpf.h:9: In file included from ./include/linux/workqueue.h:9: In file included from ./include/linux/timer.h:5: In file included from ./include/linux/list.h:9: In file included from ./include/linux/kernel.h:10: ./include/linux/compiler.h:246:10: fatal error: 'asm/rwonce.h' file not found #include <asm/rwonce.h> ^~~~~~~~~~~~~~ 1 error generated. HEAD is now at 7c53f6b... Linux 5.11-rc3 [yangtiezhu@linux linux.git]$ find . -name rwonce.h ./include/asm-generic/rwonce.h ./arch/arm64/include/asm/rwonce.h ./arch/alpha/include/asm/rwonce.h The following changes can fix the above errors, is it right? [yangtiezhu@linux linux.git]$ vim include/linux/compiler.h [yangtiezhu@linux linux.git]$ git diff diff --git a/include/linux/compiler.h b/include/linux/compiler.h index b8fe0c2..b73b18c 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -243,6 +243,8 @@ static inline void *offset_to_ptr(const int *off) */ #define prevent_tail_call_optimization() mb() +#ifdef CONFIG_ARM64 || CONFIG_ALPHA #include <asm/rwonce.h> +#endif #endif /* __LINUX_COMPILER_H */ (2) printf format warnings

   CC  samples/bpf/ibumad_user.o
samples/bpf/ibumad_user.c: In function ‘dump_counts’:
samples/bpf/ibumad_user.c:46:24: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘__u64’ {aka ‘long unsigned int’} [-Wformat=]
     printf("0x%02x : %llu\n", key, value);
                      ~~~^          ~~~~~
                      %lu

For these issues, __u64 defined as "unsigned long long" on x64 so we
do not have issues. On your system, it is defined as "unsigned long",
hence the warning. When you try to fix the issue, please make x64 works
fine. The same for above "rwonce.h" issue.

   CC  samples/bpf/lathist_user.o
   CC  samples/bpf/lwt_len_hist_user.o
   CC  samples/bpf/map_perf_test_user.o
   CC  samples/bpf/offwaketime_user.o
samples/bpf/offwaketime_user.c: In function ‘print_ksym’:
samples/bpf/offwaketime_user.c:34:17: warning: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘__u64’ {aka ‘long unsigned int’} [-Wformat=]
    printf("%s/%llx;", sym->name, addr);
               ~~~^               ~~~~
               %lx
[...]



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux