Make Stap compatible with Android

Alexander Lochmann alexander.lochmann@tu-dortmund.de
Mon May 28 20:20:00 GMT 2018



On 14.05.2018 22:56, Mark Wielaard wrote:
> 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.
Yes, that's exactly what I need. But how do I get this done?
From what I understand, this can only be done if an user compiles
stap{io,run} using the Android source tree.
None of the Android-specific toolchains have libelf support.

Cheers,
Alex
> 
> Cheers,
> 
> Mark
> 
> 

-- 
Technische Universität Dortmund
Alexander Lochmann                PGP key: 0xBC3EF6FD
Otto-Hahn-Str. 16                 phone:  +49.231.7556141
D-44227 Dortmund                  fax:    +49.231.7556116
http://ess.cs.tu-dortmund.de/Staff/al

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://sourceware.org/pipermail/systemtap/attachments/20180528/b40f96b0/attachment.sig>


More information about the Systemtap mailing list