Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support build on Android (AOSP) #433

Closed
gigony opened this issue Aug 6, 2018 · 6 comments
Closed

Support build on Android (AOSP) #433

gigony opened this issue Aug 6, 2018 · 6 comments

Comments

@gigony
Copy link

gigony commented Aug 6, 2018

Thank you for developing a great tool!
It would be very nice if makefile of uftrace is applicable for Android platform.

Current uftrace source code heavily depends on argp.
Unfortunately, Android's bionic doesn't implement argp so uftrace is not buildable for arm-based Android, showing argp-related error messages (attached build error messages: build_failure.txt).

https://android.googlesource.com/platform/external/elfutils/+/master/bionic-fixup/argp.h

export TOP=/build/gbae/dev-other-next
# cp $TOP/external/elfutils/bionic-fixup/argp.h $TOP/prebuilts/ndk/r11/platforms/android-21/arch-arm/usr/include/    <== used for fixing include-related error but argp implementation is missing..
export CFLAGS="-march=armv7-a --sysroot=$TOP/prebuilts/ndk/r11/platforms/android-21/arch-arm"
./configure --prefix=`pwd`/build --with-elfutils=$TOP/external/elfutils
make

I wonder if you have any idea on making uftrace available on Android.

@namhyung
Copy link
Owner

namhyung commented Aug 6, 2018

@gigony thanks for kind words. Currently uftrace is tested on glibc-based systems only so I'm not sure it works well on Android too. Unfortunately I'm not familiar with the Android code base..

For argp errors, it looks like there's a standalone argp library. Is it possible for you to try to build with it?

@gigony
Copy link
Author

gigony commented Aug 9, 2018

@namhyung Thanks for the reply!

It seems that there were similar issues with v4l-utils.
https://patchwork.kernel.org/patch/7117581/

I think I can try to build library with https://github.com/jahrome/argp-standalone on Android.
I am not sure if it would work without significant modifications because Android is using Clang as a default compiler nowadays.
Would let you know when I am able to build it.

@ParkHanbum
Copy link
Contributor

google offer the strace that has compiled statically by trace tool.
because Android OS environment could be customized by OS vendor.
if there is the way to build by statically, could helpful for these cases.

@honggyukim
Copy link
Collaborator

In termux project, they maintain some local patches for Android porting. Maybe we can apply some of their local patches into uftrace.

One of the major obstacles for porting uftrace to Android is to provide shm_open/shm_unlink.

@namhyung What do you think about having our custom shm_open/shm_unlink implementation just like termux does in https://github.com/termux/termux-packages/blob/master/packages/uftrace/cmds-record.c.patch?

@namhyung
Copy link
Owner

We can have an abstraction layer for shmem. On posix, we can use shm_* APIs and fallback to tmpfs if not available.

@namhyung
Copy link
Owner

Note that we already got rid of argp parser from v0.10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants