mirror of
https://github.com/therealaleph/MasterHttpRelayVPN-RUST.git
synced 2026-05-18 07:34:36 +03:00
v1.1.3: portable-atomic polyfill so mipsel-softfloat compiles (#46)
v1.1.2 reached cargo build inside the mipsel docker this time (YAML-fold bug finally out of the way) and surfaced the real underlying problem: MIPS32 has no native 64-bit atomic instructions, so std::sync::atomic::AtomicU64 doesn't exist on mipsel-unknown-linux-musl. Three call sites (DomainFronter stats counters + the request-cache) failed to resolve the import. Fix: depend on `portable-atomic` with the `fallback` feature and import AtomicU64 from there instead of std. The API is identical (same associated methods, same Ordering accepted), so the two touched files change only the `use` line. On 64-bit targets portable-atomic compiles down to the native 64-bit atomic insns with no overhead; on MIPS32 it uses a global spinlock, which is fine for counter increments that happen a few times per relay. Cache.rs and domain_fronter.rs both updated. No other callers of AtomicU64 in non-cfg-gated code (android_jni.rs has it but is gated `#![cfg(target_os = "android")]`, so mipsel-linux-musl never sees it). `cargo test --lib` / `cargo build` still pass on host.
This commit is contained in:
committed by
GitHub
parent
383bea008e
commit
5a5139f6ea
Generated
+1
@@ -2199,6 +2199,7 @@ dependencies = [
|
||||
"httparse",
|
||||
"jni 0.21.1",
|
||||
"libc",
|
||||
"portable-atomic",
|
||||
"rand 0.8.6",
|
||||
"rcgen",
|
||||
"rustls",
|
||||
|
||||
Reference in New Issue
Block a user