This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Make Stap compatible with Android


On Tue, May 1, 2018 at 12:08 PM, Alexander Lochmann
<alexander.lochmann@tu-dortmund.de> wrote:
> On 30.04.2018 22:45, David Smith wrote:
>> I took a quick look at your patch. Comments:
>>
>> 1) build_android.sh: That script seems quite specific to your setup
>> (your choice of BUILD_PREFIX and OUTPUT_DIR for instance). I think I
>> would suggest we put something like that on the systemtap wiki in an
>> article about building for android, not in the source tree.
> I can move this script to another repo.
>>
>> 2) I think there's a typo around line 116 in your patch. You've got:
>>
>> ====
>> @@ -580,10 +587,14 @@ AC_MSG_NOTICE([stap will link $stap_LIBS])
>>  if test $build_elfutils = no; then
>>    save_LIBS="$LIBS"
>>    dnl this will only succeed with elfutils 0.142+
>> -  AC_CHECK_LIB(elf,elf_getshdrstrndx,[],[
>> -    AC_MSG_FAILURE([libelf too old, need 0.142+])])
>> -  staprun_LIBS="$staprun_LIBS -lelf"
>> -  stapbpf_LIBS="$stapbpf_LIBS -lelf"
>> +  if test "${have_android}" == "bo"; then
>> + AC_CHECK_LIB(elf,elf_getshdrstrndx,
>> + [staprun_LIBS="$staprun_LIBS -lelf"
>> + LIBS="$save_LIBS"],
>> + [AC_MSG_FAILURE([libelf too old, need 0.142+])])
>> + staprun_LIBS="$staprun_LIBS -lelf"
>> + stapbpf_LIBS="$stapbpf_LIBS -lelf"
>> +  fi
>> ====
>>
>> Shouldn't that test be checking for the string "no", not "bo"? I also
>> don't understand why you changed the original code. I understand
>> surrounding it with the 'if have_android == "no"' test, but not the
>> changes themselves. I would have expected just to see whitespace
>> changes to the original code there.
> Oh yeah... Indeed, it should be "no". Thanks for pointing that out.
> But these are just white space changes. Do I miss something?

Either I'm having trouble seeing or you are. The original code had an
empty AC_CHECK_LIB 2nd argument. The new code does not. If I'm reading
the new code correctly, -lelf will get added twice to staprun_LIBS in
the non-android case.

>> 3) I'm also not sure about the approach you are taking here. You seem
>> to assume that android will *never* have an elfutils 0.142+. Why don't
>> you test the elfutils version and change the configure macro from
>> HAVE_ANDROID to something like HAVE_ANDROID_OLD_ELFUTILS (feel free to
>> use a better name) if the elfutils version isn't new enough?
> As far as I know, neither my MentorGraphics compiler nor the Android
> EABI compiler
> (https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7)
> have support for elfutils at all.

Have you tried downloading elfutils source from
https://sourceware.org/elfutils/ and using the
--with-elfutils=ELFUTILS_SRC_DIR systemtap configure option?

-- 
David Smith
Associate Manager
Red Hat


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]