libbpf-bootstrap icon indicating copy to clipboard operation
libbpf-bootstrap copied to clipboard

tools FindBpfObject.cmake may not get correct ARCH for aarch64 and etc.

Open woodpenker opened this issue 3 years ago • 1 comments

This line of CMake code(https://github.com/libbpf/libbpf-bootstrap/blob/938651fcef787f3885b7c32792851f8423bf8421/tools/cmake/FindBpfObject.cmake#L144) need to be changed to

COMMAND sed -e "s/x86_64/x86/" -e "s/aarch64/arm64/" -e "s/ppc64le/powerpc/" -e "s/mips.*/mips/"

So that cmake can get correct ARCH (such as arm64for aarch64 platform). Or it will raise an error when building: GCC error "Must specify a BPF target arch via __TARGET_ARCH_xxx"(__TARGET_ARCH_aarch64 isn't defined inside bpf_tracing.h)

woodpenker avatar Sep 02 '22 02:09 woodpenker

@woodpenker would you be able to send a PR with this change?

anakryiko avatar Sep 20 '22 07:09 anakryiko

Fixed by https://github.com/libbpf/libbpf-bootstrap/pull/116

anakryiko avatar Nov 15 '22 05:11 anakryiko