Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tools/bpf: fix perf build error with uClibc (seen on ARC)

When build perf for ARC recently, there was a build failure due to lack
of __NR_bpf.

| Auto-detecting system features:
|
| ... get_cpuid: [ OFF ]
| ... bpf: [ on ]
|
| # error __NR_bpf not defined. libbpf does not support your arch.
^~~~~
| bpf.c: In function 'sys_bpf':
| bpf.c:66:17: error: '__NR_bpf' undeclared (first use in this function)
| return syscall(__NR_bpf, cmd, attr, size);
| ^~~~~~~~
| sys_bpf

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Acked-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>

authored by

Vineet Gupta and committed by
Alexei Starovoitov
ca31ca82 a7d00671

+2
+2
tools/lib/bpf/bpf.c
··· 46 46 # define __NR_bpf 349 47 47 # elif defined(__s390__) 48 48 # define __NR_bpf 351 49 + # elif defined(__arc__) 50 + # define __NR_bpf 280 49 51 # else 50 52 # error __NR_bpf not defined. libbpf does not support your arch. 51 53 # endif