facebookexperimental / ExtendedAndroidTools

Extended Android Tools is a place to host and maintain a build environment and makefiles cross compiling Linux tools we all love for Android.
Apache License 2.0
189 stars 63 forks source link

Static bpftrace binary? #42

Closed jeez closed 11 months ago

jeez commented 1 year ago

Hi there @michalgr @danielocfb! Do we have public instructions around how to build bpftrace for Android statically? If not, any chance that could be documented as part of this project?

thanks a lot

danielocfb commented 1 year ago

Hi Jesus, I believe https://github.com/danielocfb/bpftrace_local_manifest contains all the information you'd need.

michalgr commented 1 year ago

Hi @jeez!

The easiest way to get static bpftrace binaries for android is to download the CI builds, for example from here: https://github.com/facebookexperimental/ExtendedAndroidTools/actions/runs/4785564960 (bpftrace-android-*). You should be able to build static binaries on your own, just run the following command in the provided Docker environment: make bpftrace STATIC_LINKING=true LLVM_BPF_ONLY=true

simpleton commented 1 year ago

+1 on @michalgr's method. The bpftrace_local_manifest is hard to maintain since the c++ runtime's ABIs are not 100% compatible on different versions' LLVM.

jeez commented 11 months ago

thanks, all, that worked! I will be in touch.