selftests/bpf: Enable cross-building
authorJean-Philippe Brucker <jean-philippe@linaro.org>
Wed, 13 Jan 2021 16:33:16 +0000 (17:33 +0100)
committerAndrii Nakryiko <andrii@kernel.org>
Thu, 14 Jan 2021 03:05:39 +0000 (19:05 -0800)
commitde11ae4f56fdc53474c08b03142860428e6c5655
tree09241691f84a0110ecd9983277eec25a905f8d7b
parent7c7a80ea5e3f91a93f17070f0b071cc34a474e3c
selftests/bpf: Enable cross-building

Build bpftool and resolve_btfids using the host toolchain when
cross-compiling, since they are executed during build to generate the
selftests. Add a host build directory in order to build both host and
target version of libbpf. Build host tools using $(HOSTCC) defined in
Makefile.include.

Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20210113163319.1516382-2-jean-philippe@linaro.org
tools/testing/selftests/bpf/Makefile