Skip to content

Commit 4b96128

Browse files
committed
Fix wrong dynamic link when target is mips-unknown-linux-musl
related issue: rust-lang/rust#80693 Close #3
1 parent 18dc318 commit 4b96128

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

.cargo/config.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[target.mips-unknown-linux-musl]
2+
linker = "mips-linux-musl-gcc"
3+
rustflags = ["-C", "target-feature=+crt-static", "-C", "link-arg=-s"]

Cross.toml

Lines changed: 0 additions & 7 deletions
This file was deleted.

README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,18 @@ you can get more details by typing -h:
1818
cargo run -- -h
1919
```
2020

21-
You can make cross-compile to mips like this:
21+
## Cross Compile
2222

23+
1. Add mips-unknown-linux-musl supports:
2324
```shell
24-
cross build --release -v --no-default-features --features from_file
25+
rustup target add mips-unknown-linux-musl
2526
```
26-
27-
And find the bin at:
27+
2. Download musl toolchain from [musl.cc](https://musl.cc): mips-linux-musl-cross
28+
3. Release:
29+
```shell
30+
cargo build --target mips-unknown-linux-musl --release --no-default-features --features from_file
31+
```
32+
4. Find the bin:
2833
```text
2934
target\mips-unknown-linux-musl\release
3035
```

0 commit comments

Comments
 (0)