Skip to content

Commit

Permalink
Fixed some more cross-compiling instructions in the README.
Browse files Browse the repository at this point in the history
  • Loading branch information
fpagliughi committed Jan 1, 2021
1 parent f43f507 commit 798b151
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,18 +264,21 @@ For example, to do a full build for `ARMv7`, which includes Raspberry Pi's, Beag

$ cargo build --target=armv7-unknown-linux-gnueabihf --examples

This builds the main crate, the *-sys* crate, and it cross-compiles the Paho C library. It uses SSL, so it requires you to have a version of the SSL development library installed with the cross-compiler.

If you use the `--vendored-ssl` feature, you might also need to the correct `CC` environment variable if the triplet of the cross-compiler doesn't exactly match that of the Rust target:
This builds the main crate, the *-sys* crate, and it cross-compiles the Paho C library. It uses SSL, so it requires you to have a version of the SSL development library installed with the cross-compiler. If the SSL libraries are not available you can compile and link them as part of the Rust build using the `--vendored-ssl` feature:
```
$ CC_armv7-unknown-linux-gnueabihf=armv7-unknown-linux-gnueabihf-gcc cargo build --target=armv7-unknown-linux-gnueabihf --features="vendored-ssl" --examples
$ cargo build --target=armv7-unknown-linux-gnueabihf --features="vendored-ssl" --examples
```

If you don't want to use SSL with the cross-compiler:
```
$ cargo build --target=armv7-unknown-linux-gnueabihf --no-default-features --features="bundled" --examples
```

If the triplet of the installed cross-compiler doesn't exactly match that of the Rust target, you might also need to correct the `CC` environment variable:
```
$ CC_armv7-unknown-linux-gnueabihf=armv7-unknown-linux-gnueabihf-gcc cargo build --target=armv7-unknown-linux-gnueabihf --features="vendored-ssl" --examples
```

#### Cross-Compiling with the "cross" project.

The [cross](https://github.com/rust-embedded/cross) project is a cross-compilation build tool that utilizes docker containers pre-loaded with the build tools for a number of targets. It requires [Docker](https://docs.docker.com/get-docker/) to be installed and running on your system.
Expand Down

0 comments on commit 798b151

Please sign in to comment.