This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: Make Stap compatible with Android
On Mon, May 14, 2018 at 09:06:09PM +0200, Alexander Lochmann wrote:
>
> >> On my opinion, this does far beyond what someone should when compiling
> >> stap{io,run} for Android.
> >
> > I hear you, but your patches went to a fair amount of trouble to work
> > around the lack of elfutils, when elfutils has android support (if I'm
> > reading its source correctly). This does seem like the right way to
> > go.
> >
> Okay. Android does built its own version of elfutils, and their compiler
> seems to support libz. Sorry for that.
> However, the Android libc (aka bionic) lags some standard features,
> i.e., argparse. To overcome that issue, the Android developers made some
> fixups:
> https://android.googlesource.com/platform/external/elfutils.git/+/master/bionic-fixup/
>
> Android uses its own build system which bypasses configure in case of
> elfutils. The Android build system is used to include the aforementioned
> fixups:
> https://android.googlesource.com/platform/external/elfutils.git/+/master/libelf/Android.bp
> (Android.bp is a new variant of a Makefile)
>
> One of those fixups is a workaround for the missing argp_parse in bionic.
> I tried to include that fixup manually: ./configure
> --host=arm-linux-androideabi CFLAGS="-include
> `pwd`/bionic-fixup/AndroidFixup.h -I`pwd`/bionic-fixup/"
> But configure still fails, because the linker cannot find -largp.
I don't understand precisely what you are trying to do.
But I get the impression that you only want/need the runtime
(stapio, staprun) on android. In that case the existing elfutils
libelf support should be all you need and you don't need to
build elfutils from scratch. You only need that if you want to
build the other parts of systemtap (which uses the elfutils libdw
library, which doesn't seem available on android out of the box yet.
Cheers,
Mark