2016-03-20 19:28 GMT+08:00 Jihyun Son <
itaz...@gmail.com>:
> I have been trying to compile some sources such as powertop to analyze my
> tablet's power consumption.
> Simply too hard to get it done by putting those codes into external/powertop
> tree with dependancies.
> (Well I don't like all the ways I should use Android.mk...)
You should just learn how to write an Android.mk.
Or you have to go through all the details of "cross-compile".
> So I thought very thumb way: can I build native gcc compiler for
> Android-x86?
>
> Spent a whole day... Got it working but I don't know that's enough.
>
> - download android ndk and make standalone toolchain for API 23, because I'm
> on MM 6.0.1
> - using the toolchain with included sysroot, build binutils-2.25.1 and
> gcc-4.9.3 with mpc, mpfr, gmp.
> - put all together into some place in my tablet. (/system/gcc in my case)
> - make hello world code and compile with PIE support.
> - success.
This didn't give you any benefit to your problem.
What you got is just the same binaries in AOSP's prebuilts/gcc/.
The reasons to build toolchains manually are
* You want to learn the techniques to build toolchains
* You want to fix some issues in the prebuilt toolchains
Your problem doesn't fall into these categories I think.
> So I'm going to build powertop, hope it will go well without any issue.
Nope.
> P.S: Should I care about bionic? I heard that's a standard C library but
> what's different than sysroot from NDK toolchain?
Sure. The bionic is Android's C library and
your executable must link with it.
Anyway, I suggest you do more research first
before trying to do something.
I'm very sure someone has ported powertop to Android.
You just need to google it.
--
Chih-Wei
Android-x86 project
http://www.android-x86.org