For one of my projects in production I am targeting arm_linux_androideabi and i686_linux_android. Thanks to the .android/config file I can specify the linkers as follows:
[target.arm-linux-androideabi]
linker = "<TOOLCHAINS>/A14-arm-4.8/bin/arm-linux-androideabi-gcc"
[target.i686-linux-android]
linker = "<TOOLCHAINS>/A14-x86-4.8/bin/i686-linux-android-gcc"
This makes my project compile with all dependencies, except for openssl_rust. While building the openssl_rust it also compiles a small C layer using GCC. The problem is that this goes outsides the RUST environment and thus we lose this cross-compiler information set in the Cargo Config file.
According to @sfackler there are environment variables that can be set such as CC_arm_linux_androideabi and CC_i686_linux_android (for the android targets I need). This would make GCC recognize the correct cross compiler.
So I was wondering, as we're already giving cargo our cross-compiler information. Could Cargo perhaps set these variables, so that dependencies that have C code to build with GCC, work without me having to specifically set some extra and different environment variables for each of my different cargo builds. (one per android target)