[rust-dev] Building rustc to cross-compile to Android

Skirmantas Kligys skirmantas.kligys at gmail.com
Sat Jun 28 14:18:05 PDT 2014


I am trying to build a rustc for x86_64 Linux that would cross-compile
to Android.  I follow instructions on this page:

https://github.com/rust-lang/rust/wiki/Doc-building-for-android

Here is my configure command line:

../configure --prefix=/usr/local/stow/rust-android-20140627
--target=arm-linux-androideabi
--android-cross-path=/home/skligys/Work/Android/android-ndk-standalone

Everything seems to go smoothly until compiling libuv, and then

1) I get the message that gyp is missing, so I follow the libuv's
readme and do in src/libuv:

mkdir build && git clone https://git.chromium.org/external/gyp.git build/gyp

2) Libuv compile proceeds for a while and then fails:

make[1]: Entering directory
`/home/skligys/Temp/Rust/rust/build/arm-linux-androideabi/rt/libuv'
  CC(target) /home/skligys/Temp/Rust/rust/build/arm-linux-androideabi/rt/libuv/Release/obj.target/libuv/src/unix/linux-core.o
In file included from ../../../../src/libuv/src/unix/linux-core.c:31:0:
../../../../src/libuv/include/android-ifaddrs.h:35:19: error: expected
‘:’, ‘,’, ‘;’, ‘}’ or ‘__attribute__’ before ‘.’ token
  struct sockaddr *ifa_dstaddr;
                   ^
make[1]: *** [/home/skligys/Temp/Rust/rust/build/arm-linux-androideabi/rt/libuv/Release/obj.target/libuv/src/unix/linux-core.o]
Error 1
make[1]: Leaving directory
`/home/skligys/Temp/Rust/rust/build/arm-linux-androideabi/rt/libuv'
make: *** [arm-linux-androideabi/rt/libuv/Release/libuv.a] Error 2

Any thoughts?


More information about the Rust-dev mailing list