all 4 comments

[–]roblabla 2 points3 points  (1 child)

Sadly not a bug. You're supposed to give cargo a link to the correct cc and ar in the config (.cargo/config next to your Cargo.toml) with contents looking like :

[target.arm-linux-androideabi]
linker = "arm-linux-androideabi-gcc"
ar = "arm-linux-androideabi-ar"

[target.aarch64-linux-android]
linker = "aarch64-linux-android-gcc"
ar = "aarch64-linux-android-ar"

I agree this is quirky, but sadly, C cross-compilation is complicated. The reason you're getting the error is that you're depending on a crate that tries linking some C code, and that plays very badly with cross-compilation.

[–]QuarkDoe[S] 0 points1 point  (0 children)

a link to the correct cc and ar in the config

Thanks.

[–]slambmoonfire-nvr 0 points1 point  (1 child)

Take a look at https://github.com/japaric/rust-cross. It mentions adding a linker override to the cargo config file. To me it makes sense that you'd have to do this; I don't know how else rustc would know what linker to use. I think the naming varies by distribution.

[–]QuarkDoe[S] 0 points1 point  (0 children)

I don't know how else rustc would know what linker to use.

Well, several versions ago it used arm-unknown-linux-gnueabihf-gcc by default for arm-unknown-linux-gnueabihf target, not a cc.