TokenPLS:Go 修复目前仅在 master,暂时使用构建期 workaround

Thanks — I had missed golang/go#80931; good to see it fixed at the source. Two notes for anyone landing here before Go 1.27: - The fix (golang/go@8058a577) is on master only. `release-branch.go1.26` still carries the old `cpu_arm64_other.go` constraint and there is no backport issue, so every `GOOS=ios` build on Go 1.26.x keeps running AES-GCM/GHASH/SHA-256 in pure Go. - Until then we ship the build-time workaround from this issue. It is public in our kernel repo at [`v1.19.30-hako.2`](https://github.com/TokenPLS/Hako/tree/v1.19.30-hako.2):(节选)

作者原文

Thanks — I had missed golang/go#80931; good to see it fixed at the source. Two notes for anyone landing here before Go 1.27:

  • The fix (golang/go@8058a577) is on master only. release-branch.go1.26 still carries the old cpu_arm64_other.go constraint and there is no backport issue, so every GOOS=ios build on Go 1.26.x keeps running AES-GCM/GHASH/SHA-256 in pure Go.
  • Until then we ship the build-time workaround from this issue. It is public in our kernel repo at v1.19.30-hako.2:
  • cmd/build_libbox/overlay/internal_cpu_arm64_ios.go.src — the -overlay replacement. It asserts only AES/PMULL/SHA1/SHA2; Go's fix additionally reads LSE/CRC32/SHA-512/SHA3/DIT through sysctl, which matter far less for tunnel traffic.
  • cmd/build_libbox/apple_cpu_overlay.go — writes the overlay against the toolchain the bind module actually builds with, refuses a GOROOT under GOMODCACHE, injects -overlay through a go shim first on PATH (because sagernet/gomobile overwrites GOFLAGS), and runs nm on every arm64 iOS-family slice for a marker symbol so a silently ignored overlay fails the build. It also refuses to apply itself once the replaced file no longer selects ios, so it retires by itself on Go 1.27.
  • Wiring in cmd/build_libbox/main.go (withAppleCPUOverlay); make lib_apple builds the xcframework with it.

Feel free to close; the upstream fix is the right long-term answer.