Closed hammerfunctor closed 3 years ago
% go version 21-01-13 - 2:31:12 go version go1.15.6 linux/arm64
% go env :( 1 21-01-13 - 2:31:03 GO111MODULE="" GOARCH="arm64" GOBIN="" GOCACHE="/home/huzf/.cache/go-build" GOENV="/home/huzf/.config/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="arm64" GOHOSTOS="linux" GOINSECURE="" GOMODCACHE="/home/huzf/go/pkg/mod" GONOPROXY="" GONOSUMDB="" GOOS="linux" GOPATH="/home/huzf/go" GOPRIVATE="" GOPROXY="https://goproxy.cn,direct" GOROOT="/usr/local/go" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/linux_arm64" GCCGO="gccgo" AR="ar" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="/home/huzf/tools/Go-CQHttp/go-cqhttp.src/go.mod" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build226931164=/tmp/go-build -gno-record-gcc-switches"
编译不能通过
% go build -ldflags "-s -w -extldflags '-static'" :( 1 21-01-13 - 2:34:14 package github.com/Mrs4s/go-cqhttp imports github.com/Mrs4s/go-cqhttp/coolq imports github.com/Mrs4s/go-cqhttp/global imports github.com/Mrs4s/go-cqhttp/global/codec: build constraints exclude all Go files in /home/huzf/tools/Go-CQHttp/go-cqhttp.src/global/codec
改为% CGO_ENABLED=1 CC=/usr/bin/gcc go build -ldflags "-s -w -extldflags '-static'"仍有相同的结果
% CGO_ENABLED=1 CC=/usr/bin/gcc go build -ldflags "-s -w -extldflags '-static'"
...不知道要怎么复现,只是把 repo clone下来然后按照执行了doc里的命令
我这边尝试复现下
后来怎么解决的呢?
环境信息:
版本
环境变量
问题描述
编译不能通过
改为
% CGO_ENABLED=1 CC=/usr/bin/gcc go build -ldflags "-s -w -extldflags '-static'"
仍有相同的结果复现方式
...不知道要怎么复现,只是把 repo clone下来然后按照执行了doc里的命令