[Toybox] [landley/toybox] Help building toybox with the NDK/bionic (#43)

Rob Landley rob at landley.net
Sat Dec 17 12:59:18 PST 2016


On 12/15/2016 06:16 PM, enh wrote:
> On Sat, Nov 19, 2016 at 3:20 PM, Rob Landley <rob at landley.net> wrote:
>> On 11/19/2016 01:54 PM, Elliott Hughes wrote:
>>> NDK r14 beta 1 should be out next week and includes the unified (aka
>>> "modern") headers, which will be the first step towards building toybox
>>> with the NDK.
>>
>> Yay!
> 
> just under a month later (delays caused by Android Studio)... NDK r14
> beta 1 shipped this week with the unified headers. a standalone
> toolchain using unified headers would help build toybox with the NDK
> rather than in the platform.

Let's see, wget
https://dl.google.com/android/repository/android-ndk-r14-beta1-linux-x86_64.zip
, extract it, try to build:

CROSS_COMPILE=~/android/android-ndk-r14-beta1/toolchains/x86_64-4.9/prebuilt/linux-x86_64/bin/x86_64-linux-android-
make

Complains there's no prefixed "cc", so ln -s x86_64-linux-android-gcc
x86_64-linux-android-cc in appropriate directory and...

./lib/portability.h:25:22: fatal error: features.h: No such file or
directory
 #include <features.h>

Hmmm, bit of a chicken and egg problem trying to figure out which libc
you're building if there's no features.h to include. (It's not in posix,
but it's in pretty much everything else...)

Which is odd because find . -name features.h says there are a dozen
copies of this file, let's see...

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory
"/home/landley/android/android-ndk-r14-beta1/toolchains/x86_64-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/x86_64-linux-android/4.9.x/../../../../x86_64-linux-android/include"
ignoring duplicate directory
"/home/landley/android/android-ndk-r14-beta1/toolchains/x86_64-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/../../lib/gcc/x86_64-linux-android/4.9.x/include"
ignoring nonexistent directory
"/tmp/ca8b1ea984a04012a16bb19760bc0d9a/sysroot/usr/local/include"
ignoring duplicate directory
"/home/landley/android/android-ndk-r14-beta1/toolchains/x86_64-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/../../lib/gcc/x86_64-linux-android/4.9.x/include-fixed"
ignoring nonexistent directory
"/home/landley/android/android-ndk-r14-beta1/toolchains/x86_64-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/../../lib/gcc/x86_64-linux-android/4.9.x/../../../../x86_64-linux-android/include"
ignoring nonexistent directory
"/tmp/ca8b1ea984a04012a16bb19760bc0d9a/sysroot/usr/include"
#include "..." search starts here:
#include <...> search starts here:
 .
 /home/landley/android/android-ndk-r14-beta1/toolchains/x86_64-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/x86_64-linux-android/4.9.x/include
 /home/landley/android/android-ndk-r14-beta1/toolchains/x86_64-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/x86_64-linux-android/4.9.x/include-fixed

So it's looking for sysroot/usr/include under /tmp/gianthexcode.

> (libselinux isn't an NDK API and isn't going to be, though, so it
> would be a cut-down toybox at best unless you start making those
> things available, at which point you're drifting back to "just build
> from AOSP" being the sensible choice.)

We'll burn that bridge when we come to it, right now it still can't
build with this toolchain for me.

Rob



More information about the Toybox mailing list