Reputation: 331
I'm using .cargo/config
like this
[target.arm-linux-androideabi]
linker = "/home/rico/android-ndk-r13b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc"
But /home/rico/android-ndk-r13b
is my NDK_HOME, not NDK_HOME of everyone
How can I specify to use $NDK_HOME
?
Something like:
[target.arm-linux-androideabi]
linker = "$NDK_HOME/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc"
Upvotes: 9
Views: 2554
Reputation: 1359
.cargo/config
doesn't support environment variables. But you can configure the linker with RUSTC_LINKER
environment variable:
export RUSTC_LINKER="$NDK_HOME/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc"
cargo build # will try to use NDK's linker now
Though it'll work for all targets, not only for arm-linux-androideabi
.
Upvotes: 8