[Toybox] Fun with the android NDK.

Ryan Prichard rprichard at google.com
Fri Aug 31 17:10:45 PDT 2018


On Fri, Aug 31, 2018 at 2:05 PM Rob Landley <rob at landley.net> wrote:

> 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?
>

FWIW: the NDK version is available in these files:
 - source.properties
 - sysroot/usr/include/android/ndk-version.h

That compiler version matches the one in r17 beta 1 (and not r16b or r17
beta 2).

The 4639204 is a build ID from Google's build server, and r316199 is an
LLVM SVN revision. I'm less sure about the 6.0.1. I _think_ the 6 probably
matches the upcoming major LLVM version as of r316199. e.g. r18 beta 2 has
version "Android (4751641 based on r328903) clang version 7.0.2", but
upstream Clang hasn't released 7.0.0 yet.

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?)
>

It looks like there's a struct icmphdr in the NDK's UAPI header
linux/icmp.h. That header isn't usable on my glibc system because it
conflicts with the glibc netinet/ip_icmp.h header, but maybe it's OK to use
with the NDK, though?

-Ryan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20180831/44b85de0/attachment.htm>


More information about the Toybox mailing list