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

Allow bpftrace to be statically linked #31

Closed tnovak closed 2 years ago

tnovak commented 2 years ago

Adds a flag to the top-level Makefile that enables static linking of bpftrace against libclang, libbpf and other dependencies that are not part of the NDK.

$ make BUILD_TYPE=Release STATIC_LINKING=true NDK_ARCH=armv7 bpftools
$ llvm-readelf -d out/android/armv7/bin/bpftrace |grep NEEDED
  0x00000001 (NEEDED)          Shared library: [libdl.so]
  0x00000001 (NEEDED)          Shared library: [libm.so]
  0x00000001 (NEEDED)          Shared library: [libz.so]
  0x00000001 (NEEDED)          Shared library: [libc.so]

Also bumps BPFTRACE_COMMIT to a recent revision that supports static linking with the NDK toolchain and has full armv7 support.

michalgr commented 2 years ago

Thanks !