vpncloud icon indicating copy to clipboard operation
vpncloud copied to clipboard

Add support for mips

Open mprasil opened this issue 4 years ago • 1 comments

Hi, I figured I'll submit an placeholder issue. Once https://github.com/briansmith/ring/issues/562 is resolved it would be great to also build mips-unknown-linux-musl binaries as these CPUs are frequently used on cheap devices capable of running OpenWRT.

Right now cargo build --target mips-unknown-linux-musl fails with:

error: failed to run custom build command for `ring v0.16.20`

Caused by:
  process didn't exit successfully: `/build/vpncloud/target/debug/build/ring-9c254ad8380a7887/build-script-build` (exit code: 101)
  --- stderr
  thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.16.20/build.rs:358:10
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: build failed

mprasil avatar Mar 26 '21 10:03 mprasil

https://github.com/briansmith/ring/issues/562 is fixed! Now it's time to work with vpncloud.

Coincidentally, this is the exact use case that I have at hand. I have this router with the most recent OpenWrt installed and I'd like to use vpncloud in it.

  • First I had to figure out how to compile for mips-unknown-linux-musl (a Tier 3 platform for Rust link, link). Then I found that actually in mips there's little endian and big endian variants, and additionally a soft float variant for the musl C standard library (called muslsf). My router is mipsel with soft float musl
  • I managed to compile vpncloud from source for the mipsel-unknown-linux-musl target
  • Now I can execute this binary in my router
  • The binary have some runtime issues. Looks like it is related to the musl usage, instead of the architecture specifics.
  • Currently: As I suspect that the issues are related to musl, I'll try to run it in an alpine container because it's tooooooooo boring to compile it and scp to the router just to test a small tweak.

I'll keep this comment updated.

arthursimas1 avatar Sep 16 '25 00:09 arthursimas1