Skip to content

Commit

Permalink
fix: cross build mips(64)(el)
Browse files Browse the repository at this point in the history
Signed-off-by: zu1k <[email protected]>
  • Loading branch information
zu1k committed May 17, 2022
1 parent b8eda15 commit a204660
Show file tree
Hide file tree
Showing 4 changed files with 243 additions and 3 deletions.
15 changes: 15 additions & 0 deletions .cargo/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[target.mips-unknown-linux-musl]
linker = "mips-linux-musl-gcc"
rustflags = ["-C", "target-feature=+crt-static", "-C", "link-arg=-s"]

[target.mipsel-unknown-linux-musl]
linker = "mipsel-linux-musl-gcc"
rustflags = ["-C", "target-feature=+crt-static", "-C", "link-arg=-s"]

[target.mips64-unknown-linux-muslabi64]
linker = "mips64-linux-musl-gcc"
rustflags = ["-C", "target-feature=+crt-static", "-C", "link-arg=-s"]

[target.mips64el-unknown-linux-muslabi64]
linker = "mips64el-linux-musl-gcc"
rustflags = ["-C", "target-feature=+crt-static", "-C", "link-arg=-s"]
221 changes: 221 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,6 @@ sha-1 = "0.10"

[features]
default = []
tls = ["reqwest/rustls-tls"]
tls = ["rust-tls"]
rust-tls = ["reqwest/rustls-tls"]
native-tls = ["reqwest/default-tls"]
6 changes: 4 additions & 2 deletions Makefile
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
NAME=sdusrun
BINDIR=bin
VERSION=$(shell git describe --tags || echo "unknown version")
UPX=upx --best
UPX=-upx --best
STRIP=llvm-strip -s
CARGO_BUILD=cargo build --release --target
CROSS_BUILD=cross build --release --target
Expand All @@ -13,7 +13,9 @@ CROSS_TARGET_LIST = \
aarch64-unknown-linux-musl \
armv7-unknown-linux-musleabihf \
mips-unknown-linux-musl \
mipsel-unknown-linux-musl
mipsel-unknown-linux-musl \
mips64-unknown-linux-muslabi64 \
mips64el-unknown-linux-muslabi64

$(CROSS_TARGET_LIST):
ifeq ($(TLS),TRUE)
Expand Down

0 comments on commit a204660

Please sign in to comment.