I compiled v0.23.4 bpftools last summer and it works flawlessly, but when I try to compile v0.24.1 now it has many problems.
diff --git a/sysroot/bpftools.mk b/sysroot/bpftools.mk
index fe4360f..dc67656 100644
--- a/sysroot/bpftools.mk
+++ b/sysroot/bpftools.mk
@@ -49,6 +49,7 @@ $(BPFTOOLS):
cp $(ANDROID_OUT_DIR)/lib/libbcc_bpf.so $@/lib/
cp -a $(ANDROID_OUT_DIR)/lib/libbpf.so* $@/lib/
cp $(ANDROID_OUT_DIR)/lib/libclang.so $@/lib/
+ cp $(ANDROID_OUT_DIR)/lib/libclang-cpp.so $@/lib/
cp $(ANDROID_OUT_DIR)/lib/libc++_shared.so $@/lib/
cp -a $(ANDROID_OUT_DIR)/lib/libelf*.so* $@/lib/
cp $(ANDROID_OUT_DIR)/lib/libfl.so $@/lib/
OP5D0DL1:/data/local/tmp/bpftools $ ./bpftrace
: CommandLine Error: Option 'disable-bpf-peephole' registered more than once!
LLVM ERROR: inconsistency in registered CommandLine options
Aborted
I see from the following snippet that bpftrace version used now is v0.24.1
ExtendedAndroidTools/projects/bpftrace/build.mk
Lines 51 to 56 in c80b92f
I compiled v0.23.4 bpftools last summer and it works flawlessly, but when I try to compile v0.24.1 now it has many problems.
scripts/jammy-install-deps.shlacks proper error handling andapt-getfails silently likely due to network issues, after fixing that, during build process, another error occurs due toxxdnot installed,apt-get install xxdfixed it. I think this script's content should stay in sync with https://github.com/bpftrace/bpftrace/blob/master/docker/Dockerfile.ubuntu, it has xxd in it.ldd $(which bpftrace)on wsl2 archlinux that libclang-cpp is indeed a dependency now. And libclang-cpp-dev was added to the dockerfile between the release of v0.23.4 and v0.24.1, see https://github.com/bpftrace/bpftrace/blame/3fc827015ad48f857570bda6783cec273ed83e9c/docker/Dockerfile.ubuntu#L24-L26. After applying the following change, the linker error is fixed.