I am trying to setup my system for cross-compiling by using the cargo config file. This way, for a given target, the linker, ar, and library path info can be setup by default and I don't have to set it up per project.
To be more concrete, I have my config file at ~/.cargo/config.toml and its contents are:
[target.aarch64-linux-android]
ar = "/path/to/aarch64/ar"
linker = "/path/to/aarch64/ld"
rustc-link-search = { all = "/path/to/aarch64/libs" }
This works well for specifying the archiver and linker, but I can't figure how to get rustc-link-search to work. An example of how to use it can be seen here, but the documentation is wrong. It shows that a list of paths can be passed, but when I try that cargo/rust tells me that it is expecting a table, but got an array.
Ok, so it wants map. I assume the keys are one of the KINDs listed here, but I'm not really sure. In any case, it doesn't seem to add the directory to the library search path.
Can anyone shed some light on how to correctly use the rustc-link-search configuration field?
It seems that the documentation is also wrong for rustc-flags. It shows the argument takes a string, but it also seems to want a table. No clue how the keys/values should work on that one either.