Hello,
I'm having hard time cross-building bpf selftests on an x86 for a powerpc target.
[root@PC-server-ldb bpf]# make CROSS_COMPILE=ppc-linux- ARCH=powerpc V=1
/root/gen_ldb/linux-powerpc/tools/testing/selftests/bpf/host-tools/sbin/bpftool gen skeleton
/root/gen_ldb/linux-powerpc/tools/testing/selftests/bpf/atomic_bounds.o >
/root/gen_ldb/linux-powerpc/tools/testing/selftests/bpf/atomic_bounds.skel.h
libbpf: elf: endianness mismatch in atomic_bounds.
Error: failed to open BPF object file: Endian mismatch
[root@PC-server-ldb bpf]# file atomic_bounds.o
atomic_bounds.o: ELF 64-bit MSB relocatable, eBPF, version 1 (SYSV), with debug_info, not stripped
Seems like the just-built host bpftool doesn't take into account target's endianness.
I see the patch https://github.com/torvalds/linux/commit/313e7f6f ("selftest/bpf: Use -m{little,
big}-endian for clang") in bpf selftest to enable cross-compilation, but it seems it is not enough.
What should I do to get bpftool work with the target's endianness ?
Thanks
Christophe