Cross compile bpftools-5.10.10 error

I use ubuntu21.04 x86_64 cross comiple bpftools for arm_cortex-a9_musl_eabi, but met error:

openwrt-sdk-21.02.0-bcm53xx-generic_gcc-8.4.0_musl_eabi.Linux-x86_64/build_dir/target-arm_cortex-a9_musl_eabi/bpftools-full/bpftools-5.10.10/bpftool-bootstrap: Exec format error

file bpftool-bootstrap output:
ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-musl-arm.so.1, with debug_info, not stripped

how to fix this?

1 Like

I got the same error.
Buildlog: https://downloads.immortalwrt.org/releases/faillogs-21.02/x86_64/network/utils/bpftools/full/compile.txt

Do you see

Auto-detecting system features:
...
clang-bpf-co-re: [ on  ]

during compilation?

This should be fixed by https://github.com/openwrt/openwrt/commit/cf20f1bb5f0479c2509dd651d08e235a3b9e8755 .

1 Like

Can comfirm it fixed the issue. Thank you so much!