On Mon, 22 Nov 2021 at 19:23, Jean-Philippe Brucker <jean-philippe@xxxxxxxxxx> 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@xxxxxxxxxxxxx> Note that on bpf-next, patch 5 (runqslower) has a conflict with be79505caf3f ("tools/runqslower: Install libbpf headers when building"). Did you consider enabling cross-compiling for the BPF samples too? I'm asking because the build system is pretty similar to the BPF tools. Thanks, Quentin