The BPF library is not built on 64-bit RISC-V, as the BPF feature is not detected. Looking more in details, feature/test-bpf.c fails to build with the following error: | In file included from /tmp/linux-4.19.12/tools/include/uapi/asm/bitsperlong.h:17, | from /tmp/linux-4.19.12/tools/include/uapi/asm-generic/unistd.h:2, | from /usr/include/riscv64-linux-gnu/asm/unistd.h:1, | from test-bpf.c:2: | /tmp/linux-4.19.12/tools/include/asm-generic/bitsperlong.h:14:2: error: #error Inconsistent word size. Check asm/bitsperlong.h | #error Inconsistent word size. Check asm/bitsperlong.h | ^~~~~ The UAPI from the tools directory is missing RISC-V support, therefore bitsperlong.h from asm-generic is used, defaulting to 32 bits. Fix that by adding tools/arch/riscv/include/uapi/asm/bitsperlong.h as a copy of arch/riscv/include/uapi/asm/bitsperlong.h and by updating tools/include/uapi/asm/bitsperlong.h.
Showing the changes to tools/include/uapi (1 of 2 files). Show all
Unified · Split
| @@ -13,6 +13,8 @@ · 12 unmodified lines | ||
| 13 | 13 | #include "../../arch/mips/include/uapi/asm/bitsperlong.h" |
| 14 | 14 | #elif defined(__ia64__) |
| 15 | 15 | #include "../../arch/ia64/include/uapi/asm/bitsperlong.h" |
| 16 | +#elif defined(__riscv) | |
| 17 | +#include "../../arch/riscv/include/uapi/asm/bitsperlong.h" | |
| 16 | 18 | #else |
| 17 | 19 | #include <asm-generic/bitsperlong.h> |
| 18 | 20 | #endif |