On 11/26/21 9:36 PM, Quentin Monnet wrote:
On Mon, 22 Nov 2021 at 19:23, Jean-Philippe Brucker jean-philippe@linaro.org wrote:
Add support for cross-building BPF tools and selftests with clang, by passing LLVM=1 or CC=clang to make, as well as CROSS_COMPILE. A single clang toolchain can generate binaries for multiple architectures, so instead of having prefixes such as aarch64-linux-gnu-gcc, clang uses the -target parameter: `clang -target aarch64-linux-gnu'.
Patch 1 adds the parameter in Makefile.include so tools can easily support this. Patch 2 prepares for the libbpf change from patch 3 (keep building resolve_btfids's libbpf in the host arch, when cross-building the kernel with clang). Patches 3-6 enable cross-building BPF tools with clang.
The set looks good to me. I checked that the tools are still building (without cross-compiling). I currently have issues building the selftests on my setup, but they don't appear to be related to this patchset.
Acked-by: Quentin Monnet quentin@isovalent.com
Note that on bpf-next, patch 5 (runqslower) has a conflict with be79505caf3f ("tools/runqslower: Install libbpf headers when building").
Jean-Philippe, please do one rebase spin for addressing the above.
Thanks, Daniel