You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13-13Lines changed: 13 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ It contains essential tools for cross-compile [Rust](https://www.rust-lang.org/)
30
30
31
31
### Compiling an application inside a Docker container
32
32
33
-
By default the working directory is `/root/src`.
33
+
By default, the working directory is `/root/src`.
34
34
35
35
#### x86_64-unknown-linux-musl
36
36
@@ -56,19 +56,19 @@ docker run --rm \
56
56
57
57
### Cargo Home advice
58
58
59
-
It's known that the [`CARGO_HOME`](https://doc.rust-lang.org/cargo/guide/cargo-home.html#cargo-home) points to `$HOME/.cargo` by default (`/root/.cargo` in this case). However if you want to use a custom Cargo home directory then make sure to copy the Cargo `config` file to the particular directory like `cp "$HOME/.cargo/config" "$CARGO_HOME/"` before to cross-compile your program. Otherwise you could face a linking error when for example you want to cross-compile to an `x86_64-apple-darwin` target.
59
+
It's known that the [`CARGO_HOME`](https://doc.rust-lang.org/cargo/guide/cargo-home.html#cargo-home) points to `$HOME/.cargo` by default (`/root/.cargo` in this case). However, if you want to use a custom Cargo home directory then make sure to copy the Cargo `config` file to the particular directory like `cp "$HOME/.cargo/config" "$CARGO_HOME/"` before to cross-compile your program. Otherwise, you could face a linking error when for example you want to cross-compile to an `x86_64-apple-darwin` target.
60
60
61
61
### Dockerfile
62
62
63
-
You can also use the image as a base for your own Dockerfile:
63
+
You can also use the image as a base for your Dockerfile:
64
64
65
65
```Dockerfile
66
66
FROM joseluisq/rust-linux-darwin-builder:1.61.0
67
67
```
68
68
69
69
### OSXCross
70
70
71
-
You can also use o32-clang(++) and o64-clang(++) like a normal compiler.
71
+
You can also use o32-clang(++) and o64-clang(++) as a normal compiler.
72
72
73
73
__Notes:__
74
74
@@ -92,12 +92,12 @@ Example 4: x86_64-apple-darwin21.4-strip -x test
92
92
93
93
### Cross-compilation example
94
94
95
-
Below a simple example using a `Makefile` for cross-compiling a Rust app.
95
+
Below is a simple example of using a `Makefile`` for cross-compiling a Rust app.
96
96
97
97
Notes:
98
98
99
99
- A [hello world](./tests/hello-world) app is used.
100
-
- A custom directory is used below as working directory instead of `/root/src`.
100
+
- A custom directory is used below as a working directory instead of `/root/src`.
101
101
102
102
Create a Makefile:
103
103
@@ -131,13 +131,13 @@ Just run the makefile `compile` target, then you will see two release binaries `
If some of your crates require C bindings and you run into compilation or linking errors, try to use Clang for C/C++ builds.
154
154
155
-
For example to crosscompile to Macos:
155
+
For example to cross-compile to Macos:
156
156
157
157
```sh
158
158
CC=o64-clang \
159
159
CXX=o64-clang++ \
160
160
cargo build --target x86_64-apple-darwin
161
161
```
162
162
163
-
For more details take a look at [Crosscompiling Rust from Linux to macOS](https://wapl.es/rust/2019/02/17/rust-cross-compile-linux-to-macos.html) by James Waples.
163
+
For more details take a look at Cross-compiling Rust from Linux to macOS](https://wapl.es/rust/2019/02/17/rust-cross-compile-linux-to-macos.html) by James Waples.
0 commit comments