Shadowsocksx-ng: Binary for arm architecture macOS

Created on 14 Jul 2020  ·  10Comments  ·  Source: shadowsocks/ShadowsocksX-NG

Since Apple has released an arm architecture macOS, ShadowsocksX-NG should also release a binary for those users. (Even though x86 apps are still supported on those machines.)

Problems

The repo contains a x86 binary of shadowsocks-libev. It’s even copied from HomeBrew a long time ago!

Possible solutions

  1. Build shadowsocks from source. (RECOMMEND, by embedding a build script.)
  2. Include another arm binary.

Most helpful comment

Oh nvm. After a long debugging it turns out to be a long-standing wrinkle of macOS that caches code sign of mach-o files.
My build works pretty well and should be able to submit a PR soon.

All 10 comments

Building shadowsocks-libev from source is probably not feasible, as the readme says

It's hard to maintain the original implementation as there is too much unused code in it. It also embeds the ss-local source code. It's crazy to maintain dependencies of ss-local. So it's hard to update the ss-local version.

I am not sure if maintainers have a plan to add universal binary support. I am currently experimenting options

@XIAZY How about embed both x86 and arm binary?

@xiaoyu2006 That's what I'm looking into. According to this article, it's not hard to compile a fat binary.

@XIAZY Also we can start a sort of web service to let the client automatically grab the latest compiled binary.

As for the fat binary, I hadn't compiled an arm port of ss-libev yet.

@xiaoyu2006 I've had luck compiling shadowsocks-libev, but had some linking problems embedding them to the this project. I am experimenting options but unfortunately I'm not an expert on Apple's toolchain

@XIAZY How about following the CI file from it? https://github.com/shadowsocks/shadowsocks-libev/blob/master/.travis.yml

We just need to follow it on both architectures and merge them.

@xiaoyu2006 Thanks for reminding me - I didn't know there was a CI system. Will look into it

@XIAZY THe question is the CI process Homebrewed everything, while the deps' binary may be unavailable in arm64.

I tried replacing my own ss-local binary and dynamic libraries with the original one, unfortunately it doesn't work. I can execute the binary outside ~/Library/Application Support/ShadowsocksX-NG/ss-local-lastest, but got a Killed: 9 executing it inside that folder.
I am not an expert in Mac App development so maybe someone can takeover the work or kindly provide some hints.

Oh nvm. After a long debugging it turns out to be a long-standing wrinkle of macOS that caches code sign of mach-o files.
My build works pretty well and should be able to submit a PR soon.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

qingping209 picture qingping209  ·  4Comments

nil
aofei picture aofei  ·  4Comments

Sharnodra picture Sharnodra  ·  6Comments

qinyuhang picture qinyuhang  ·  5Comments

czhu08 picture czhu08  ·  3Comments