Enable ARM64 cryptographic extensions in iOS library builds

Go's internal/cpu never detects ARM64 features on GOOS=ios, so AES, AES-GCM
and SHA-256 use their generic implementations on iOS and tvOS. Patch the
Go source in the Apple library build to assert the ARMv8.0 cryptographic
extensions, as Go already does for macOS.

See https://github.com/SagerNet/sing-box/issues/4486
This commit is contained in:
世界
2026-09-03 13:30:52 +08:00
parent 4bc15be97c
commit e4a19a2a7c
3 changed files with 67 additions and 0 deletions
+5
View File
@@ -1246,6 +1246,9 @@ jobs:
with:
go-version: 1.26.7
cache: false
- name: Patch Go for iOS
if: matrix.build && (matrix.platform == 'ios/arm64' || matrix.platform == 'tvos/arm64')
run: .github/patch_go_for_ios.sh
- name: Cache Go modules
if: matrix.build
uses: actions/cache@v4
@@ -1265,6 +1268,8 @@ jobs:
run: git tag v${{ needs.calculate_version.outputs.version }} -f
- name: Build library
if: matrix.build
env:
GOTOOLCHAIN: local
run: |-
make lib_install
export PATH="$PATH:$(go env GOPATH)/bin"