From a9eb5e6901195f10dc453dfee5a20ff145eabc5d Mon Sep 17 00:00:00 2001 From: Mxmilu666 Date: Sun, 21 Jun 2026 14:04:23 +0800 Subject: [PATCH] fix(build): disable linkname check for Android builds --- .github/workflows/build-all.yaml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-all.yaml b/.github/workflows/build-all.yaml index e5162067..25b46845 100644 --- a/.github/workflows/build-all.yaml +++ b/.github/workflows/build-all.yaml @@ -159,11 +159,13 @@ jobs: echo "CC=$CC" # 直接使用 go build 命令,不通过 Makefile,防止 CGO_ENABLED 被覆盖 + # -checklinkname=0: 关闭 Go 1.23+ 的 linkname 检查,规避 wlynxg/anet + # 在 android 下通过 //go:linkname 引用 net.zoneCache 导致的链接失败 echo "Building frps..." - go build -trimpath -ldflags "-s -w" -tags frps -o bin/frps ./cmd/frps - + go build -trimpath -ldflags "-s -w -checklinkname=0" -tags frps -o bin/frps ./cmd/frps + echo "Building frpc..." - go build -trimpath -ldflags "-s -w" -tags frpc -o bin/frpc ./cmd/frpc + go build -trimpath -ldflags "-s -w -checklinkname=0" -tags frpc -o bin/frpc ./cmd/frpc # 验证文件已生成 ls -lh ./bin/