use mimalloc for mips/mipsel (#71)

This commit is contained in:
Sijie.Sun 2024-05-04 00:26:57 +08:00 committed by GitHub
parent 61d5e38cc9
commit 3a5332e31d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 13 additions and 3 deletions

View File

@ -11,7 +11,8 @@ 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]
@ -19,5 +20,6 @@ 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"
]

View File

@ -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 -

2
.gitignore vendored
View File

@ -24,3 +24,5 @@ nohup.out
.DS_Store
components.d.ts
musl_gcc

View File

@ -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"]