Re: [Toybox] NDK versions?

2019-03-08 Thread enh via Toybox
On Fri, Mar 8, 2019 at 12:34 PM Rob Landley  wrote:
>
> On 3/8/19 1:06 PM, enh wrote:
> > On Fri, Mar 8, 2019 at 10:47 AM Rob Landley  wrote:
> >>
> >> On 3/5/19 6:23 PM, Rob Landley wrote:
> >>> landley@halfbrick:~/toybox/clean$
> >>> CROSS_COMPILE=/home/landley/android/android-ndk-r19b/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-
> >>> LDFLAGS=--static make
> >>
> >> It took some squinting (and rereading the instructions on the website 
> >> multiple
> >> times... why does the
> >> android-ndk-r19b/toolchains/x86_64-4.9/prebuilt/linux-x86_64/bin/ directory
> >> exist again? There's no cc in there.)
> >
> > that's binutils. we're working on moving over to the llvm tools, but
> > binutils isn't going to disappear for a while. the OS already switched
> > for the most part, but that's a subset of all NDK uses (and mostly
> > under our control if there's a workaround).
>
> I am currently sitting about 5 feet from the maintainer of ellcc.org (last 
> day!)
> and have frowned at him over the cubicle divider, and cc'd his home email.
>
> (It's tangential, but he did a toolchain using _all_ the bsd licensed stuff 
> but
> hasn't cleaned up his repo into a clean "tarball+patches" thing and hasn't
> gotten a new release out in forever.)
>
> Ah, day jobs...
>
> >> But this worked:
> >>
> >> mkdir ~/android
> >> cd ~/android
> >> wget 
> >> https://dl.google.com/android/repository/android-ndk-r19b-linux-x86_64.zip
> >> unzip android-ndk-r19b-linux-x86_64.zip
> >> ln -s x86_64-linux-android28-clang
> >> android-ndk-r19b/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android-cc
> >>
> >> cd ~/toybox
> >> CROSS_COMPILE=~/android-ndk-r19b/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android-
> >> LDFLAGS=--static make distclean defconfig toybox
> >>
> >> I should stick some variant of that in the FAQ page.
> >
> > maybe with a note saying that "28" should be replaced by whatever the
> > current highest API level is (since you're getting a static libc.a
> > anyway).
>
> The URL isn't stable either. And I forgot to put the /android/ dir in the
> CROSS_COMPILE above (cut and pasted from two different attempts).
>
> > if you use 1 (internally used to mean "current unreleased OS")
> > instead of 28 does that work?
>
> Alas, no:
>
> landley@halfbrick:~/android/android-ndk-r19b/toolchains/llvm/prebuilt/linux-x86_64/bin$
> ls x86_64-linux-android[0-9]*
> x86_64-linux-android21-clangx86_64-linux-android24-clang++
> x86_64-linux-android21-clang++  x86_64-linux-android26-clang
> x86_64-linux-android22-clangx86_64-linux-android26-clang++
> x86_64-linux-android22-clang++  x86_64-linux-android27-clang
> x86_64-linux-android23-clangx86_64-linux-android27-clang++
> x86_64-linux-android23-clang++  x86_64-linux-android28-clang
> x86_64-linux-android24-clangx86_64-linux-android28-clang++
>
> Gotta pick one of the available options.

i actually meant that you'd want something like

`dirname $0`/clang --target=x86_64-linux-android1 "$@"

> > pro: you'll never have to update your
> > instructions. con: if we ship an NDK with new headers but forget to
> > update libc.a, you'll likely be the first to catch that.
>
> What would be really really nice is if you had -cc and -c++ symlinks to the
> latest -clang and -clang++ versions in the zip file. Then I wouldn't have to
> create them, so I wouldn't have to work out which version is latest. (You 
> could
> also have some kind of "latest" in there, but... the -cc and -c++ symlinks 
> _are_
> a "latest" in directly usable format...)
>
> [puppy eyes intensify]
>
> >> Rob
> >
>
> Rob
___
Toybox mailing list
Toybox@lists.landley.net
http://lists.landley.net/listinfo.cgi/toybox-landley.net


Re: [Toybox] NDK versions?

2019-03-08 Thread enh via Toybox
On Fri, Mar 8, 2019 at 12:58 PM Josh Gao  wrote:
>
> On Fri, Mar 8, 2019 at 12:34 PM Rob Landley  wrote:
> >
> > What would be really really nice is if you had -cc and -c++ symlinks to the
> > latest -clang and -clang++ versions in the zip file. Then I wouldn't have to
> > create them, so I wouldn't have to work out which version is latest. (You 
> > could
> > also have some kind of "latest" in there, but... the -cc and -c++ symlinks 
> > _are_
> > a "latest" in directly usable format...)
> >
> > [puppy eyes intensify]
>
>
> AIUI, symlinks in the NDK are a pain in the ass because of Windows,
> which required administrative privileges to create until very recently
> (and windows's built in zip support probably doesn't support
> symlinks).

(and Studio's installer doesn't believe in symlinks for this reason.
and for that reason, the existing contents are all tiny shell scripts
rather than the symlinks you'd expect.)

but more importantly, he's the only person in the world who would
benefit from this... actual app developers would be actively harmed by
anything that defaulted to the latest release. that's basically never
what you want. (even for standalone toolchains this seems likely to
hurt more people than it helps --- "i built openssl or ffmpeg for
Android but it doesn't work on my device! help?".)
___
Toybox mailing list
Toybox@lists.landley.net
http://lists.landley.net/listinfo.cgi/toybox-landley.net


Re: [Toybox] NDK versions?

2019-03-08 Thread Josh Gao via Toybox
On Fri, Mar 8, 2019 at 12:34 PM Rob Landley  wrote:
>
> What would be really really nice is if you had -cc and -c++ symlinks to the
> latest -clang and -clang++ versions in the zip file. Then I wouldn't have to
> create them, so I wouldn't have to work out which version is latest. (You 
> could
> also have some kind of "latest" in there, but... the -cc and -c++ symlinks 
> _are_
> a "latest" in directly usable format...)
>
> [puppy eyes intensify]


AIUI, symlinks in the NDK are a pain in the ass because of Windows,
which required administrative privileges to create until very recently
(and windows's built in zip support probably doesn't support
symlinks).
___
Toybox mailing list
Toybox@lists.landley.net
http://lists.landley.net/listinfo.cgi/toybox-landley.net


Re: [Toybox] NDK versions?

2019-03-08 Thread Rob Landley
On 3/8/19 1:06 PM, enh wrote:
> On Fri, Mar 8, 2019 at 10:47 AM Rob Landley  wrote:
>>
>> On 3/5/19 6:23 PM, Rob Landley wrote:
>>> landley@halfbrick:~/toybox/clean$
>>> CROSS_COMPILE=/home/landley/android/android-ndk-r19b/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-
>>> LDFLAGS=--static make
>>
>> It took some squinting (and rereading the instructions on the website 
>> multiple
>> times... why does the
>> android-ndk-r19b/toolchains/x86_64-4.9/prebuilt/linux-x86_64/bin/ directory
>> exist again? There's no cc in there.)
> 
> that's binutils. we're working on moving over to the llvm tools, but
> binutils isn't going to disappear for a while. the OS already switched
> for the most part, but that's a subset of all NDK uses (and mostly
> under our control if there's a workaround).

I am currently sitting about 5 feet from the maintainer of ellcc.org (last day!)
and have frowned at him over the cubicle divider, and cc'd his home email.

(It's tangential, but he did a toolchain using _all_ the bsd licensed stuff but
hasn't cleaned up his repo into a clean "tarball+patches" thing and hasn't
gotten a new release out in forever.)

Ah, day jobs...

>> But this worked:
>>
>> mkdir ~/android
>> cd ~/android
>> wget 
>> https://dl.google.com/android/repository/android-ndk-r19b-linux-x86_64.zip
>> unzip android-ndk-r19b-linux-x86_64.zip
>> ln -s x86_64-linux-android28-clang
>> android-ndk-r19b/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android-cc
>>
>> cd ~/toybox
>> CROSS_COMPILE=~/android-ndk-r19b/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android-
>> LDFLAGS=--static make distclean defconfig toybox
>>
>> I should stick some variant of that in the FAQ page.
> 
> maybe with a note saying that "28" should be replaced by whatever the
> current highest API level is (since you're getting a static libc.a
> anyway).

The URL isn't stable either. And I forgot to put the /android/ dir in the
CROSS_COMPILE above (cut and pasted from two different attempts).

> if you use 1 (internally used to mean "current unreleased OS")
> instead of 28 does that work?

Alas, no:

landley@halfbrick:~/android/android-ndk-r19b/toolchains/llvm/prebuilt/linux-x86_64/bin$
ls x86_64-linux-android[0-9]*
x86_64-linux-android21-clangx86_64-linux-android24-clang++
x86_64-linux-android21-clang++  x86_64-linux-android26-clang
x86_64-linux-android22-clangx86_64-linux-android26-clang++
x86_64-linux-android22-clang++  x86_64-linux-android27-clang
x86_64-linux-android23-clangx86_64-linux-android27-clang++
x86_64-linux-android23-clang++  x86_64-linux-android28-clang
x86_64-linux-android24-clangx86_64-linux-android28-clang++

Gotta pick one of the available options.

> pro: you'll never have to update your
> instructions. con: if we ship an NDK with new headers but forget to
> update libc.a, you'll likely be the first to catch that.

What would be really really nice is if you had -cc and -c++ symlinks to the
latest -clang and -clang++ versions in the zip file. Then I wouldn't have to
create them, so I wouldn't have to work out which version is latest. (You could
also have some kind of "latest" in there, but... the -cc and -c++ symlinks _are_
a "latest" in directly usable format...)

[puppy eyes intensify]

>> Rob
> 

Rob
___
Toybox mailing list
Toybox@lists.landley.net
http://lists.landley.net/listinfo.cgi/toybox-landley.net


Re: [Toybox] NDK versions?

2019-03-08 Thread enh via Toybox
On Fri, Mar 8, 2019 at 10:47 AM Rob Landley  wrote:
>
> On 3/5/19 6:23 PM, Rob Landley wrote:
> > landley@halfbrick:~/toybox/clean$
> > CROSS_COMPILE=/home/landley/android/android-ndk-r19b/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-
> > LDFLAGS=--static make
>
> It took some squinting (and rereading the instructions on the website multiple
> times... why does the
> android-ndk-r19b/toolchains/x86_64-4.9/prebuilt/linux-x86_64/bin/ directory
> exist again? There's no cc in there.)

that's binutils. we're working on moving over to the llvm tools, but
binutils isn't going to disappear for a while. the OS already switched
for the most part, but that's a subset of all NDK uses (and mostly
under our control if there's a workaround).

> But this worked:
>
> mkdir ~/android
> cd ~/android
> wget 
> https://dl.google.com/android/repository/android-ndk-r19b-linux-x86_64.zip
> unzip android-ndk-r19b-linux-x86_64.zip
> ln -s x86_64-linux-android28-clang
> android-ndk-r19b/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android-cc
>
> cd ~/toybox
> CROSS_COMPILE=~/android-ndk-r19b/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android-
> LDFLAGS=--static make distclean defconfig toybox
>
> I should stick some variant of that in the FAQ page.

maybe with a note saying that "28" should be replaced by whatever the
current highest API level is (since you're getting a static libc.a
anyway).

if you use 1 (internally used to mean "current unreleased OS")
instead of 28 does that work? pro: you'll never have to update your
instructions. con: if we ship an NDK with new headers but forget to
update libc.a, you'll likely be the first to catch that.

> Rob
___
Toybox mailing list
Toybox@lists.landley.net
http://lists.landley.net/listinfo.cgi/toybox-landley.net


Re: [Toybox] NDK versions?

2019-03-08 Thread Rob Landley
On 3/5/19 6:23 PM, Rob Landley wrote:
> landley@halfbrick:~/toybox/clean$
> CROSS_COMPILE=/home/landley/android/android-ndk-r19b/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-
> LDFLAGS=--static make

It took some squinting (and rereading the instructions on the website multiple
times... why does the
android-ndk-r19b/toolchains/x86_64-4.9/prebuilt/linux-x86_64/bin/ directory
exist again? There's no cc in there.)

But this worked:

mkdir ~/android
cd ~/android
wget https://dl.google.com/android/repository/android-ndk-r19b-linux-x86_64.zip
unzip android-ndk-r19b-linux-x86_64.zip
ln -s x86_64-linux-android28-clang
android-ndk-r19b/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android-cc

cd ~/toybox
CROSS_COMPILE=~/android-ndk-r19b/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android-
LDFLAGS=--static make distclean defconfig toybox

I should stick some variant of that in the FAQ page.

Rob
___
Toybox mailing list
Toybox@lists.landley.net
http://lists.landley.net/listinfo.cgi/toybox-landley.net


Re: [Toybox] NDK versions?

2019-03-05 Thread Rob Landley
On 3/5/19 1:07 PM, enh wrote:
> (even betas should have source.properties because it's actually used by 
> Studio.)
> 
> are you sure this is even an NDK? is this maybe a standalone toolchain
> you generated from an NDK?

I was a standalone toolchain.

> anyway, pasting "4751641 based on r328903" into Google gets me
> https://github.com/android-ndk/ndk/issues/866 which says 18.1.5063045
> which you can also paste into Google and get
> https://github.com/android-ndk/ndk/issues/852 which says r18b.

Yay!

> but if you really don't have those files, you probably have a
> standalone toolchain rather than an NDK. luckily r19 makes standalone
> toolchains mostly unnecessary --- the clang driver can now configure
> most things correctly from the target triple. (last few fixes in r20,
> coming soon.)

"Most things." Let's see... Still no llvm-cc symlink (point it at clang...)

distclean, defconfig, and:

landley@halfbrick:~/toybox/clean$
CROSS_COMPILE=/home/landley/android/android-ndk-r19b/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-
LDFLAGS=--static make
scripts/make.sh
Generate headers from toys/*/*.c...
generated/newtoys.h Library probe
Make generated/config.h from .config.
generated/flags.h generated/globals.h generated/tags.h generated/help.h
Compile
toybox.generated/obj/id.o:
In function `do_id':
id.c:(.text.do_id+0x1c2): warning: Using 'getgrouplist' in statically linked
applications requires at runtime the shared libraries from the glibc version
used for linking
[a dozen similar warnings about glibc cut]
./home/landley/android/android-ndk-r19b/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip:
error: Link field value 0 in section .rela.plt is invalid.
strip failed, using unstripped
.
landley@halfbrick:~/toybox/clean$

Imma call that a "no".

Rob
___
Toybox mailing list
Toybox@lists.landley.net
http://lists.landley.net/listinfo.cgi/toybox-landley.net


Re: [Toybox] NDK versions?

2019-03-05 Thread enh via Toybox
(even betas should have source.properties because it's actually used by Studio.)

are you sure this is even an NDK? is this maybe a standalone toolchain
you generated from an NDK?

anyway, pasting "4751641 based on r328903" into Google gets me
https://github.com/android-ndk/ndk/issues/866 which says 18.1.5063045
which you can also paste into Google and get
https://github.com/android-ndk/ndk/issues/852 which says r18b.

but if you really don't have those files, you probably have a
standalone toolchain rather than an NDK. luckily r19 makes standalone
toolchains mostly unnecessary --- the clang driver can now configure
most things correctly from the target triple. (last few fixes in r20,
coming soon.)

On Tue, Mar 5, 2019 at 11:00 AM enh  wrote:
>
> if you really have an NDK so old that it doesn't have the new world
> source.properties nor the old RELEASE.TXT ... just delete it?
>
> are you sure you don't have either of those files?
>
> On Tue, Mar 5, 2019 at 10:14 AM Rob Landley  wrote:
> >
> > I'm downloading the 19b Android NDK to upgrade my toybox test environment, 
> > and
> > wondering if there's an easy way to tell which version I had installed 
> > before?
> > (I want to mv /opt/android/x86_64 to one with the old version number in it).
> >
> > It's not in the manifest file. It's not repo.prop... those are all git 
> > hashes. I
> > googled "how do I tell what android NDK version I have installed" and that 
> > found:
> >
> > https://stackoverflow.com/questions/36623681/how-to-find-the-ndk-revision-number-for-your-android-setup
> >
> > Which tells me to look in a file I haven't got in the installed version? The
> > next hit is:
> >
> > https://gist.github.com/jorgenpt/1961404
> >
> > Which is from 2012. Um...
> >
> > $ bin/llvm-cc --version
> > Android (4751641 based on r328903) clang version 7.0.2
> > (https://android.googlesource.com/toolchain/clang
> > 003100370607242ddd5815e4a043907ea9004281)
> > (https://android.googlesource.com/toolchain/llvm
> > 1d739ffb0366421d383e04ff80ec2ee591315116) (based on LLVM 7.0.2svn)
> > Target: x86_64-none-linux-android28
> > Thread model: posix
> > InstalledDir: /opt/android/x86_64/bin
> >
> > That's not mapping obviously to... 18b maybe? Is that what I installed last?
> >
> > Am I missing something obvious again? (The tarball I installed it _from_ is 
> > long
> > gone...)
> >
> > Rob
> > ___
> > Toybox mailing list
> > Toybox@lists.landley.net
> > http://lists.landley.net/listinfo.cgi/toybox-landley.net
___
Toybox mailing list
Toybox@lists.landley.net
http://lists.landley.net/listinfo.cgi/toybox-landley.net


Re: [Toybox] NDK versions?

2019-03-05 Thread enh via Toybox
if you really have an NDK so old that it doesn't have the new world
source.properties nor the old RELEASE.TXT ... just delete it?

are you sure you don't have either of those files?

On Tue, Mar 5, 2019 at 10:14 AM Rob Landley  wrote:
>
> I'm downloading the 19b Android NDK to upgrade my toybox test environment, and
> wondering if there's an easy way to tell which version I had installed before?
> (I want to mv /opt/android/x86_64 to one with the old version number in it).
>
> It's not in the manifest file. It's not repo.prop... those are all git 
> hashes. I
> googled "how do I tell what android NDK version I have installed" and that 
> found:
>
> https://stackoverflow.com/questions/36623681/how-to-find-the-ndk-revision-number-for-your-android-setup
>
> Which tells me to look in a file I haven't got in the installed version? The
> next hit is:
>
> https://gist.github.com/jorgenpt/1961404
>
> Which is from 2012. Um...
>
> $ bin/llvm-cc --version
> Android (4751641 based on r328903) clang version 7.0.2
> (https://android.googlesource.com/toolchain/clang
> 003100370607242ddd5815e4a043907ea9004281)
> (https://android.googlesource.com/toolchain/llvm
> 1d739ffb0366421d383e04ff80ec2ee591315116) (based on LLVM 7.0.2svn)
> Target: x86_64-none-linux-android28
> Thread model: posix
> InstalledDir: /opt/android/x86_64/bin
>
> That's not mapping obviously to... 18b maybe? Is that what I installed last?
>
> Am I missing something obvious again? (The tarball I installed it _from_ is 
> long
> gone...)
>
> Rob
> ___
> Toybox mailing list
> Toybox@lists.landley.net
> http://lists.landley.net/listinfo.cgi/toybox-landley.net
___
Toybox mailing list
Toybox@lists.landley.net
http://lists.landley.net/listinfo.cgi/toybox-landley.net


[Toybox] NDK versions?

2019-03-05 Thread Rob Landley
I'm downloading the 19b Android NDK to upgrade my toybox test environment, and
wondering if there's an easy way to tell which version I had installed before?
(I want to mv /opt/android/x86_64 to one with the old version number in it).

It's not in the manifest file. It's not repo.prop... those are all git hashes. I
googled "how do I tell what android NDK version I have installed" and that 
found:

https://stackoverflow.com/questions/36623681/how-to-find-the-ndk-revision-number-for-your-android-setup

Which tells me to look in a file I haven't got in the installed version? The
next hit is:

https://gist.github.com/jorgenpt/1961404

Which is from 2012. Um...

$ bin/llvm-cc --version
Android (4751641 based on r328903) clang version 7.0.2
(https://android.googlesource.com/toolchain/clang
003100370607242ddd5815e4a043907ea9004281)
(https://android.googlesource.com/toolchain/llvm
1d739ffb0366421d383e04ff80ec2ee591315116) (based on LLVM 7.0.2svn)
Target: x86_64-none-linux-android28
Thread model: posix
InstalledDir: /opt/android/x86_64/bin

That's not mapping obviously to... 18b maybe? Is that what I installed last?

Am I missing something obvious again? (The tarball I installed it _from_ is long
gone...)

Rob
___
Toybox mailing list
Toybox@lists.landley.net
http://lists.landley.net/listinfo.cgi/toybox-landley.net