$ source ./android-configure /Users/mark.simpson/Development/android-ndk-r10d gyp
Copying prebuilt binaries...
Copying sysroot headers and libraries...
Copying c++ runtime headers and libraries...
Copying files to: /Users/mark.simpson/built_software/libuv/android-toolchain
Cleaning up...
Done.
['-Dtarget_arch=arm', '-DOS=android', '/Users/mark.simpson/built_software/libuv/uv.gyp', '-I', '/Users/mark.simpson/built_software/libuv/common.gypi', '--depth=.', '-f', 'make', '-Goutput_dir=/Users/mark.simpson/built_software/libuv/out', '--generator-output', '/Users/mark.simpson/built_software/libuv/out', '-Dhost_arch=x64', '-Duv_library=static_library', '-Dcomponent=static_library']
$ echo $PATH
/Users/mark.simpson/built_software/libuv/android-toolchain/bin:rest_of_my_path
$ make -C out
CC(target) /Users/mark.simpson/built_software/libuv/out/Debug/obj.target/libuv/src/fs-poll.o
arm-linux-androideabi-gcc: error: x86_64: No such file or directory
arm-linux-androideabi-gcc: error: unrecognized command line option '-fasm-blocks'
arm-linux-androideabi-gcc: error: unrecognized command line option '-mpascal-strings'
arm-linux-androideabi-gcc: error: unrecognized command line option '-arch'
make: *** [/Users/mark.simpson/built_software/libuv/out/Debug/obj.target/libuv/src/fs-poll.o] Error 1
$ sh autogen.sh
+ glibtoolize
+ aclocal -I m4
+ autoconf
+ automake --add-missing --copy
$ ./configure --build=x86_64-apple-darwin --host=arm-linux-androideabi --with-sysroot=$ANDROID_SYSROOT --prefix /Users/mark.simpson/built_software/libuv_compile/
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for arm-linux-androideabi-strip... arm-linux-androideabi-strip
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking build system type... x86_64-apple-darwin
checking host system type... arm-unknown-linux-androideabi
checking for arm-linux-androideabi-gcc... arm-linux-androideabi-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether arm-linux-androideabi-gcc accepts -g... yes
checking for arm-linux-androideabi-gcc option to accept ISO C89... none needed
checking whether arm-linux-androideabi-gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of arm-linux-androideabi-gcc... gcc3
checking if arm-linux-androideabi-gcc supports -fvisibility=hidden flag... yes
checking if arm-linux-androideabi-gcc supports -g flag... yes
checking if arm-linux-androideabi-gcc supports -std=gnu89 flag... yes
checking if arm-linux-androideabi-gcc supports -pedantic flag... yes
checking if arm-linux-androideabi-gcc supports -Wall flag... yes
checking if arm-linux-androideabi-gcc supports -Wextra flag... yes
checking if arm-linux-androideabi-gcc supports -Wno-unused-parameter flag... yes
checking for arm-linux-androideabi-ar... arm-linux-androideabi-ar
checking the archiver (arm-linux-androideabi-ar) interface... ar
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by arm-linux-androideabi-gcc... /Users/mark.simpson/built_software/libuv/android-toolchain/arm-linux-androideabi/bin/ld
checking if the linker (/Users/mark.simpson/built_software/libuv/android-toolchain/arm-linux-androideabi/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /Users/mark.simpson/built_software/libuv/android-toolchain/bin/arm-linux-androideabi-nm -B
checking the name lister (/Users/mark.simpson/built_software/libuv/android-toolchain/bin/arm-linux-androideabi-nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 196608
checking how to convert x86_64-apple-darwin file names to arm-unknown-linux-androideabi format... func_convert_file_noop
checking how to convert x86_64-apple-darwin file names to toolchain format... func_convert_file_noop
checking for /Users/mark.simpson/built_software/libuv/android-toolchain/arm-linux-androideabi/bin/ld option to reload object files... -r
checking for arm-linux-androideabi-objdump... arm-linux-androideabi-objdump
checking how to recognize dependent libraries... pass_all
checking for arm-linux-androideabi-dlltool... no
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for arm-linux-androideabi-ar... (cached) arm-linux-androideabi-ar
checking for archiver @FILE support... @
checking for arm-linux-androideabi-strip... (cached) arm-linux-androideabi-strip
checking for arm-linux-androideabi-ranlib... arm-linux-androideabi-ranlib
checking command to parse /Users/mark.simpson/built_software/libuv/android-toolchain/bin/arm-linux-androideabi-nm -B output from arm-linux-androideabi-gcc object... ok
checking for sysroot... /Users/mark.simpson/Development/android-ndk-r10d/platforms/android-9/arch-arm
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for arm-linux-androideabi-mt... no
checking for mt... no
checking if : is a manifest tool... no
checking how to run the C preprocessor... arm-linux-androideabi-gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if arm-linux-androideabi-gcc supports -fno-rtti -fno-exceptions... no
checking for arm-linux-androideabi-gcc option to produce PIC... -fPIC -DPIC
checking if arm-linux-androideabi-gcc PIC flag -fPIC -DPIC works... yes
checking if arm-linux-androideabi-gcc static flag -static works... yes
checking if arm-linux-androideabi-gcc supports -c -o file.o... yes
checking if arm-linux-androideabi-gcc supports -c -o file.o... (cached) yes
checking whether the arm-linux-androideabi-gcc linker (/Users/mark.simpson/built_software/libuv/android-toolchain/arm-linux-androideabi/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... Android linker
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking whether make supports nested variables... (cached) yes
checking for dlopen in -ldl... yes
checking for kstat_lookup in -lkstat... no
checking for kvm_open in -lkvm... no
checking for gethostbyname in -lnsl... no
checking for perfstat_cpu in -lperfstat... no
checking for pthread_mutex_init in -lpthread... no
checking for clock_gettime in -lrt... no
checking for sendfile in -lsendfile... no
checking for socket in -lsocket... no
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... unknown
checking for _LARGE_FILES value needed for large files... unknown
checking for pkg-config... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: executing depfiles commands
config.status: executing libtool commands
$ make
CC src/libuv_la-fs-poll.lo
CC src/libuv_la-inet.lo
CC src/libuv_la-threadpool.lo
CC src/libuv_la-uv-common.lo
CC src/libuv_la-version.lo
CC src/unix/libuv_la-async.lo
CC src/unix/libuv_la-core.lo
CC src/unix/libuv_la-dl.lo
CC src/unix/libuv_la-fs.lo
CC src/unix/libuv_la-getaddrinfo.lo
CC src/unix/libuv_la-getnameinfo.lo
CC src/unix/libuv_la-loop-watcher.lo
CC src/unix/libuv_la-loop.lo
CC src/unix/libuv_la-pipe.lo
src/unix/pipe.c: In function 'uv__pipe_getsockpeername':
src/unix/pipe.c:237:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (addrlen > *size) {
^
CC src/unix/libuv_la-poll.lo
CC src/unix/libuv_la-process.lo
CC src/unix/libuv_la-signal.lo
CC src/unix/libuv_la-stream.lo
CC src/unix/libuv_la-tcp.lo
CC src/unix/libuv_la-thread.lo
CC src/unix/libuv_la-timer.lo
CC src/unix/libuv_la-tty.lo
CC src/unix/libuv_la-udp.lo
CC src/unix/libuv_la-android-ifaddrs.lo
src/unix/android-ifaddrs.c: In function 'getNetlinkResponse':
src/unix/android-ifaddrs.c:139:9: warning: implicit declaration of function 'uv__free' [-Wimplicit-function-declaration]
uv__free(l_buffer);
^
src/unix/android-ifaddrs.c:140:9: warning: implicit declaration of function 'uv__malloc' [-Wimplicit-function-declaration]
l_buffer = uv__malloc(l_size);
^
src/unix/android-ifaddrs.c:140:18: warning: assignment makes pointer from integer without a cast [enabled by default]
l_buffer = uv__malloc(l_size);
^
src/unix/android-ifaddrs.c: In function 'newListItem':
src/unix/android-ifaddrs.c:185:27: warning: initialization makes pointer from integer without a cast [enabled by default]
NetlinkList *l_item = uv__malloc(sizeof(NetlinkList));
^
src/unix/android-ifaddrs.c: In function 'interpretLink':
src/unix/android-ifaddrs.c:351:13: warning: assignment makes pointer from integer without a cast [enabled by default]
l_entry = uv__malloc(sizeof(struct ifaddrs) + sizeof(int) + l_nameSize + l_addrSize + l_dataSize);
^
src/unix/android-ifaddrs.c: In function 'interpretAddr':
src/unix/android-ifaddrs.c:480:13: warning: assignment makes pointer from integer without a cast [enabled by default]
l_entry = uv__malloc(sizeof(struct ifaddrs) + l_nameSize + l_addrSize);
^
CC src/unix/libuv_la-pthread-fixes.lo
CC src/unix/libuv_la-linux-core.lo
CC src/unix/libuv_la-linux-inotify.lo
CC src/unix/libuv_la-linux-syscalls.lo
CC src/unix/libuv_la-proctitle.lo
CCLD libuv.la
Result: I can run the idle loop & print stuff just fine.
Result: I can't connect. uv_listen returns -13 (Listen error permission denied).
Result: Some of the plumbing appears to trigger. The curl socket callbacks don't trigger, but my requests come through as completing, but with no valid information (e.g. after I receive a CURLMSG_DONE message, curl_easy_getinfo(easy_handle, ....) doesn't tell me anything, as the out pointers are left unchanged). I'll dig into debugging this a bit more tomorrow and let you know what is/isn't triggered.
$ readelf -h ./libuv.a | grep -i 'class\|machine' | head -2
Class: ELF32
Machine: ARM
make -C out