[Toybox] toys/android/log.c with android NDK?

Rob Landley rob at landley.net
Fri Feb 16 07:51:51 PST 2018


n 02/14/2018 06:30 PM, enh wrote:
> On Wed, Feb 14, 2018 at 3:36 PM, Rob Landley <rob at landley.net> wrote:
>> More to the point all of this _compiled_, meaning it's in the headers. And then
>> it couldn't find it in the libraries. So there's a consistency issue somewhere.
> 
> i suspect you said "--api 26" but then also tried to build a static
> binary? in which case you linked against an api 21 libc.a. as i said

Yup, has to be statically compiled to run on an ubuntu host.

> (somewhere) earlier today, NDK r17 (and later) will have a modern
> libc.a, but for NDK r16 you'll want to either (a) set --api 21 for
> static binaries or (b) build a dynamic binary for --api 26.

Ok, I'll try again when the new one comes out.

> longer term (https://android.googlesource.com/platform/ndk/+/master/docs/Roadmap.md)
> we want to make standalone toolchains obsolete by just teaching the
> clang driver everything it needs to know about Android, so hopefully
> before the end of the year it's just a matter of `CC=ndk-clang make
> defconfig`.

I don't have context to know what's involved there.

>> I can try to fix it up in lib/portability.c...?
> 
> the __android_log_write thing might need a fix on your side: i suspect
> you're missing a -l for the NDK liblog?

I'll try to fix it up when I get the new ndk.

Thanks,

Rob



More information about the Toybox mailing list