This mainly involved reworking the makefile to avoid conflating
Darwin/ARM builds with iOS, since we may also want to build for the
iOS Simulator, which is i386.
Note that I was only able to test this on the Simulator, since I don't
have a real iOS device to test with. Sorry if I broke something; if
so, please fix it :)
There were two issues: the linux->darwin cross compiler is more stringent
about unused variables, and the makefile specified flags for building ON
darwin that were actually applicable whenever we are building FOR darwin.
Per https://github.com/ReadyTalk/avian/issues/53, Avian should build
against a standard AOSP checkout, which means we should look for
subprojects in the directories the repo utility would place them.
Setting this property (e.g. -Davian.trace.port=5555) will cause the VM
to start an extra daemon thread which listens on the specified TCP
port for incoming connections and dumps stack traces for all running
threads to that socket. You can retrieve that dump using e.g. netcat:
nc localhost 5555
With corresponding changes to libcore, all the tests are passing
except Datagrams, which fails with a NPE in
NetworkInterface.getNetworkInterfacesList due to OS X not having
/sys/class/net. Porting that class to OS X looks like a non-trivial
task.
This fixes the iOS build, where the wrong version of util.h was being
used. The change to use -idirafter happened way back in 2007, and I
can't remember what its intention was. We'll have to watch for
regressions on other platforms.
It now builds and links, but fails at runtime because
register_libcore_icu_ICU can't find the file it wants. We'll probably need to replace register_libcore_icu_ICU with a better-behaved version.
Stuff compiles, but linking breaks spectacularly. Next step is to
figure out how to build the dependencies without checking out and
building the entire Android platform.