tools/bpftool: Fix cross-build
authorJean-Philippe Brucker <jean-philippe@linaro.org>
Tue, 10 Nov 2020 16:43:07 +0000 (17:43 +0100)
committerAndrii Nakryiko <andrii@kernel.org>
Wed, 11 Nov 2020 20:18:22 +0000 (12:18 -0800)
commit8859b0da5aac28e4e9651c8971e7af344f8ffec1
treed62b977c015fd0f00d5fce2ba455d62a0b2b76d0
parent9e8929fdbb9c9026bd3a732e9ac7dc9617c86309
tools/bpftool: Fix cross-build

The bpftool build first creates an intermediate binary, executed on the
host, to generate skeletons required by the final build. When
cross-building bpftool for an architecture different from the host, the
intermediate binary should be built using the host compiler (gcc) and
the final bpftool using the cross compiler (e.g. aarch64-linux-gnu-gcc).

Generate the intermediate objects into the bootstrap/ directory using
the host toolchain.

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/20201110164310.2600671-4-jean-philippe@linaro.org
tools/bpf/bpftool/Makefile