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

Dan Albert danalbert at google.com
Sat Jun 28 14:43:10 PDT 2014


Looks like a bug in libuv to me:
https://github.com/joyent/libuv/blob/a2506c936296006abe7b8a7517c3f37691191858/src/unix/linux-core.c#L49

android-ifaddrs.h depends on sockaddr (defined in sys/socket.h), but never
includes it. linux-core.c does include it, but only after including
android-ifaddrs.h.

On 1403990292582, Skirmantas Kligys <skirmantas.kligys at gmail.com> wrote:

> 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?
> _______________________________________________
> Rust-dev mailing list
> Rust-dev at mozilla.org
> https://mail.mozilla.org/listinfo/rust-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/rust-dev/attachments/20140628/34fbd4c1/attachment.html>


More information about the Rust-dev mailing list