diff options
| author | Tobias Klauser <[email protected]> | 2020-03-12 13:03:30 +0000 |
|---|---|---|
| committer | Daniel Borkmann <[email protected]> | 2020-03-12 15:22:41 +0000 |
| commit | fe4eb069edb7ab845160350d9e67d572c026a4a7 (patch) | |
| tree | 840739e27a07ed6f88a4ea40a1950b74c9a8392c /tools/bpf/bpftool/prog.c | |
| parent | tools/runqslower: Add BPF_F_CURRENT_CPU for running selftest on older kernels (diff) | |
| download | kernel-fe4eb069edb7ab845160350d9e67d572c026a4a7.tar.gz kernel-fe4eb069edb7ab845160350d9e67d572c026a4a7.zip | |
bpftool: Use linux/types.h from source tree for profiler build
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.
Signed-off-by: Tobias Klauser <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Reviewed-by: Quentin Monnet <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/bpf/bpftool/prog.c')
0 files changed, 0 insertions, 0 deletions
