[Toybox] Fun with the android NDK.

Rob Landley rob at landley.net
Sat Sep 8 15:09:15 PDT 2018


On 09/06/2018 05:46 PM, enh wrote:
> On Mon, Sep 3, 2018 at 9:54 AM Rob Landley <rob at landley.net> wrote:
>> It created a ~ subdirectory under the extracted android ndk directory. Of course
>> it did.
> 
> (i was going to file a bug at
> https://github.com/android-ndk/ndk/issues/new but danalbert fixed it
> quicker than i could file the bug [because i was looking up the
> mailing list to give a link to this thread...]. turns out he naturally
> uses "--install-dir ~/ndk" which obviously is the shell's problem
> rather than python's...
> https://android-review.googlesource.com/c/platform/ndk/+/749658 )

I break everything.

>>> as for the initializations, i'm always happy to see such changes, but
>>> i haven't needed them personally. i suspect you're using GCC rather
>>> than clang?
>>
>> I used the llvm- prefix.
> 
> "there be dragons"... we're moving the platform off binutils as i
> speak, but it's very much a work in progress, and we're finding lots
> of bugs/differences from binutils.

It's sad the guy who did Gold (and wrote up a great series of blog posts about
all the issues he hit, starting at https://www.airs.com/blog/archives/38 )
signed the result over to the FSF to be buried in a GPLv3 sea trench.

>>> (GCC will be removed in r18, some time this month.) here
>>> are the `-Wno-`s i need to be able to build with the Android-preferred
>>> -Wall -Werror:
>>>
>>>         "-Wno-char-subscripts",

Why is an array subscript of type char objectionable?

I already have that in my default $CFLAGS from last time:

[ -z "$CFLAGS" ] && CFLAGS="-Wall -Wundef -Wno-char-subscripts
-Werror=implicit-function-declaration"

>>>         "-Wno-gnu-variable-sized-type-not-at-end",
>>
>> That one's my bad, I need to fix it. (The linestack stuff is unfinished, I
>> really need to get back to it and actually implement a text editor and such.)
>>
>>>         "-Wno-missing-field-initializers",
>>>         "-Wno-sign-compare",
>>>         "-Wno-string-plus-int",
>>>         "-Wno-unused-parameter",

I didn't need to set any of those with the the new NDK? (Not to build defconfig
anyway, maybe it's in the pending stuff you're building...)

>> The kernel build grew a dependency on it, although it's not a deep dependency
>> yet (it spits out a lot of "getconf not found" stuff but _mostly_ falls back to
>> sane defaults), and if I was going to add it, I might as well do it right...
> 
> to be clear[er than i was], i actually meant confstr(3).

Added to portability.h (Hardwiring in the output of the 2 cases we were using.)

(I dunno why the v7 case is there, it was there in
https://landley.net/notes-2017.html#18-02-2017 but doesn't seem to be in the gnu
version? Huh. I didn't use their code, but did use their symbol list...)

>>> __android_log_write is in the NDK.
>>
>> I'll upgrade the version and try it again.

I Did The Thing and it just needs llvm-cc and liblog.a. (A working strip -o
would be nice but the existing build works around that.)

Rob



More information about the Toybox mailing list