]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: Fix broken riscv build
authorBjörn Töpel <bjorn.topel@gmail.com>
Wed, 18 Nov 2020 07:16:38 +0000 (08:16 +0100)
committerAndrii Nakryiko <andrii@kernel.org>
Thu, 19 Nov 2020 01:44:59 +0000 (17:44 -0800)
commit5f2f484abfc2d3bc57c7e6f9cedddb36da8b668b
treec7ee41ff7462f2ddc7db52b15d3f818b7fa7c14c
parentdea2a63c2287a6ba9044273a6eceb1c7e9ff207d
selftests/bpf: Fix broken riscv build

The selftests/bpf Makefile includes system include directories from
the host, when building BPF programs. On RISC-V glibc requires that
__riscv_xlen is defined. This is not the case for "clang -target bpf",
which messes up __WORDSIZE (errno.h -> ... -> wordsize.h) and breaks
the build.

By explicitly defining __risc_xlen correctly for riscv, we can
workaround this.

Fixes: 1e32a4d8c175 ("selftests/bpf: Makefile fix "missing" headers on build with -idirafter")
Signed-off-by: Björn Töpel <bjorn.topel@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Luke Nelson <luke.r.nels@gmail.com>
Link: https://lore.kernel.org/bpf/20201118071640.83773-2-bjorn.topel@gmail.com
tools/testing/selftests/bpf/Makefile