[Toybox] What am I doing wrong with ndk-r20?

Rob Landley rob at landley.net
Thu Oct 10 14:33:21 PDT 2019

On 10/9/19 9:47 PM, enh wrote:
> On Wed, Oct 9, 2019, 19:10 Rob Landley <rob at landley.net
> >     How about:
> > 
> >     #if defined(__BIONIC__) && !defined(__ANDROID_NDK__) && !defined(__NDK_MAJOR__)
> Yeah, that should work for everything.

It doesn't seem to, though. Possibly because __NDK_MAJOR__ is #defined in
ndk-version.h which the headers only #include from two places:

$ grep -r ndk-version

Neither of which is already included from portability.h, and I kinda doubt:

#ifdef __BIONIC__
#include <android/ndk-version.h>
#if !defined...

is going to work well in the AOSP build which is _not_ an NDK.

Also, this bit is now awkward:

// Android NDKv18 has liblog.so but not liblog.c for static builds,
// stub it out for now.
#ifdef __ANDROID_NDK__
#define __android_log_write(a, b, c) (0)
#define adjtime(x, y) (0)

Is that still needed, or...?


More information about the Toybox mailing list