summaryrefslogtreecommitdiff
path: root/docs/markdown/snippets/rust-cross.md
blob: 7f18c446ae2461f1527eccaf67458302d74d79b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
## Rust cross-compilation

Cross-compilation is now supported for Rust targets. Like other
cross-compilers, the Rust binary must be specified in your cross
file. It should specify a `--target` (as installed by `rustup target`)
and a custom linker pointing to your C cross-compiler. For example:

```
[binaries]
c = '/usr/bin/arm-linux-gnueabihf-gcc-7'
rust = [
    'rustc',
    '--target', 'arm-unknown-linux-gnueabihf',
    '-C', 'linker=/usr/bin/arm-linux-gnueabihf-gcc-7',
]
```