Re: [PATCH bpf-next v2] bpftool: use linux/types.h from source tree for profiler build

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

 



2020-03-12 14:03 UTC+0100 ~ Tobias Klauser <tklauser@xxxxxxxxxx>
> When compiling bpftool on a system where the /usr/include/asm symlink
> doesn't exist (e.g. on an Ubuntu system without gcc-multilib installed),
> the build fails with:
> 
>     CLANG    skeleton/profiler.bpf.o
>   In file included from skeleton/profiler.bpf.c:4:
>   In file included from /usr/include/linux/bpf.h:11:
>   /usr/include/linux/types.h:5:10: fatal error: 'asm/types.h' file not found
>   #include <asm/types.h>
>            ^~~~~~~~~~~~~
>   1 error generated.
>   make: *** [Makefile:123: skeleton/profiler.bpf.o] Error 1
> 
> This indicates that the build is using linux/types.h from system headers
> instead of source tree headers.
> 
> To fix this, adjust the clang search path to include the necessary
> headers from tools/testing/selftests/bpf/include/uapi and
> tools/include/uapi. Also use __bitwise__ instead of __bitwise in
> skeleton/profiler.h to avoid clashing with the definition in
> tools/testing/selftests/bpf/include/uapi/linux/types.h.
> 
> Cc: Daniel Borkmann <daniel@xxxxxxxxxxxxx>
> Cc: Song Liu <songliubraving@xxxxxx>
> Cc: Alexei Starovoitov <alexei.starovoitov@xxxxxxxxx>
> Cc: Quentin Monnet <quentin@xxxxxxxxxxxxx>
> Signed-off-by: Tobias Klauser <tklauser@xxxxxxxxxx>

Looks good, thanks!
Reviewed-by: Quentin Monnet <quentin@xxxxxxxxxxxxx>



[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