[Toybox] Fun with the android NDK.

Rob Landley rob at landley.net
Fri Aug 31 14:05:03 PDT 2018


So here's what I had to do to build and run toybox with the Android NDK:

1) I don't remember which NDK version I have installed and ls -l
/opt/android/x86-64 is unenlightening (NOTICE is 2400 lines of concatenated help
text starting with GPLv2, everything starting with "COPYING" is some variant of
GPL (yet MORE license text), repo.prop is a bunch of git hashes,
manifest_4639204.xml is not close enough to human readable to matter) but the
start of llvm-cc --version is "Android (4639204 based on r316199) clang version
6.0.1" which presumably means something to somebody. It's recent-ish. January maybe?

2) I applied the attached patch, some bits of which should get merged and others
I dunno about. (The structure ping wanted... did that git fixed upstream already?)

3) "LDFLAGS=--static CROSS_COMPILE=/opt/android/x86-64/bin/llvm- defconfig" and
then switch OFF CONFIG_LOG and CONFIG_GETCONF. The first I vaguely remember
talking about on here and the android guys intentionally don't export the log
functions in the NDK (but you can call the command line utility...?), the second
is missing posix stuff. (Is that fixed upstream or should I try to hack around
it here, or...?)

4) Build, with the same LDFLAGS and CROSS_COMPILE and run the result under
qemu-x86_64 -cpu Nehalem.f (The default cpu qemu emulates has the same immediate
segfault in the start code my netbook does, but if you have it fake an i7 it works.)

But hey, I have some sort of test environment now. :)

Rob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ndk.patch
Type: text/x-patch
Size: 2171 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20180831/ce9187fa/attachment.bin>


More information about the Toybox mailing list