Skip to content

Commit

Permalink
use mimalloc for mips/mipsel (EasyTier#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
KKRainbow authored May 3, 2024
1 parent 61d5e38 commit 3a5332e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
6 changes: 4 additions & 2 deletions .cargo/config
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ linker = "mipsel-linux-muslsf-gcc"
rustflags = ["-C", "target-feature=+crt-static",
"-L", "./musl_gcc/mipsel-linux-muslsf-cross/mipsel-linux-muslsf/lib",
"-L", "./musl_gcc/mipsel-linux-muslsf-cross/lib/gcc/mipsel-linux-muslsf/11.2.1",
"-l", "atomic"
"-l", "atomic",
"-l", "ctz"
]

[target.mips-unknown-linux-musl]
linker = "mips-linux-muslsf-gcc"
rustflags = ["-C", "target-feature=+crt-static",
"-L", "./musl_gcc/mips-linux-muslsf-cross/mips-linux-muslsf/lib",
"-L", "./musl_gcc/mips-linux-muslsf-cross/lib/gcc/mips-linux-muslsf/11.2.1",
"-l", "atomic"
"-l", "atomic",
"-l", "ctz"
]
6 changes: 6 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,13 @@ jobs:
# mips/mipsel cannot add target from rustup, need compile by ourselves
if [[ $OS =~ ^ubuntu.*$ && $TARGET =~ ^mips.*$ ]]; then
cd "$PWD/musl_gcc/${MUSL_URI}-cross/lib/gcc/${MUSL_URI}/11.2.1" || exit 255
# for panic-abort
cp libgcc_eh.a libunwind.a
# for mimalloc
ar x libgcc.a _ctzsi2.o _clz.o
ar rcs libctz.a _ctzsi2.o _clz.o
rustup toolchain install nightly-x86_64-unknown-linux-gnu
rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu
cd -
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ nohup.out
.DS_Store

components.d.ts

musl_gcc
2 changes: 1 addition & 1 deletion easytier/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ defguard_wireguard_rs = "0.4.2"

[features]
default = ["wireguard", "quic", "mimalloc"]
mips = ["aes-gcm"]
mips = ["aes-gcm", "mimalloc"]
wireguard = ["dep:boringtun", "dep:ring"]
quic = ["dep:quinn", "dep:rustls", "dep:rcgen"]
mimalloc = ["dep:mimalloc-rust"]
Expand Down

0 comments on commit 3a5332e

Please sign in to comment.