[Toybox] [landley/toybox] Help building toybox with the NDK/bionic (#43)
enh
enh at google.com
Tue Aug 16 14:04:52 PDT 2016
looking at the bug, i can cut a long story short for you: cutils isn't an
NDK library, and you don't have a new enough NDK to have <pty.h>. (there
are also going to be a ton of other problems hidden behind those.)
the bad news is that NDK r13 won't have <pty.h> either --- we slipped the
unified headers to r14 yesterday, sadly, because although we do have
headers, we haven't got enough of the build system support done, and we
don't want to hold up the release (which includes independently useful
stuff such as an updated libc++ and the new command-line cpu profiler).
https://github.com/android-ndk/ndk/issues/120 is the bug covering the
unified headers work, though the action is all in AOSP so that bug doesn't
show you the changes as they go in.
anyway, yeah, the NDK headers are about three years behind the platform.
(fun fact: the N and M headers are actually just the L headers, and the L
headers aren't actually the platform L headers either.) until we finish
fixing that mess, you're just wasting your time and polluting your code.
if you want to run on a modern device, build out of an appropriate AOSP
tree. if you want to run on an old device, build statically out of a modern
AOSP tree.
On Tue, Aug 16, 2016 at 1:35 PM, Rob Landley <rob at landley.net> wrote:
> On 08/11/2016 08:25 PM, Matthias Urhahn wrote:
> > I've tried to setup the latest NDK to test #36
> > <https://github.com/landley/toybox/issues/36>. I followed the
> > instructions here
> > <https://developer.android.com/ndk/guides/standalone_toolchain.html>, to
> > export a standalone toolchain.
>
> I hadn't found that page before, so I gave it a try.
>
> The NDK download page is
> https://developer.android.com/ndk/downloads/index.html and the linux
> version is a 750 megabyte download, which ground away through through
> coffee shop wifi at about 120k/second for the rest of that evening so I
> didn't get back to it for a few days.
>
fwiw, r11 was 790M and r13 is currently 680M. r10e -- the last NDK before
my team took over -- was 1110M. the NDK is actually getting quite a lot
smaller as we fix stuff, and there's plenty more to go...
also https://github.com/android-ndk/ndk/wiki is the freshest source (that
is: includes betas), and we're currently working on getting the various
approvals to publish nightly builds (since all the NDK source is in AOSP
anyway).
> When I did, I got hello world to build:
>
> android-ndk-r12b$ toolchains/x86_64-4.9/prebuilt/linux-x86_64 \
> /bin/x86_64-linux-android-gcc --static hello.c \
> --sysroot=$PWD/platforms/android-24/arch-x86_64
>
> Which was a little bit awkward and the resulting a.out is over 3 megs.
> Stripping it brings it down to 489984 bytes for basically a call to
> printf(). Still, it ran.
>
> This email has now been sitting open on my desktop for 3 days with no
> further progress, so I should probably just send it. :)
>
> Next up, I should try building toybox with it and see what happens.
>
> Rob
> _______________________________________________
> Toybox mailing list
> Toybox at lists.landley.net
> http://lists.landley.net/listinfo.cgi/toybox-landley.net
>
--
Elliott Hughes - http://who/enh - http://jessies.org/~enh/
Android native code/tools questions? Mail me/drop by/add me as a reviewer.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20160816/be73061e/attachment.htm>
More information about the Toybox
mailing list