Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: loadinternal: cannot find runtime/cgo #51124

Closed
billcoding opened this issue Feb 10, 2022 · 2 comments
Closed

cmd/go: loadinternal: cannot find runtime/cgo #51124

billcoding opened this issue Feb 10, 2022 · 2 comments

Comments

@billcoding
Copy link

billcoding commented Feb 10, 2022

What version of Go are you using (go version)?

$ go version
go version go1.18beta2 windows/amd64
go env Output
$ go env
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\Administrator\AppData\Local\go-build
set GOENV=C:\Users\Administrator\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\Administrator\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\Administrator\go
set GOPRIVATE=
set GOPROXY=https://goproxy.cn,direct
set GOROOT=C:\Users\Administrator\sdk\go1.18beta2
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=C:\Users\Administrator\sdk\go1.18beta2\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.18beta2
set GCCGO=gccgo
set GOAMD64=v1
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=C:\Users\Administrator\Desktop\aaaaa\go.mod
set GOWORK=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\ADMINI~1\AppData\Local\Temp\go-build1486301158=/tmp/go-build -gno-record-gcc-switches

What did you do?

GOOS=ios GOARCH=arm64 go1.18beta2.exe build

What did you expect to see?

Build `ios/arm64` on `Windows`.

What did you see instead?

$ GOOS=ios GOARCH=arm64 go1.18beta2.exe build
# main
loadinternal: cannot find runtime/cgo
C:\Users\Administrator\sdk\go1.18beta2\pkg\tool\windows_amd64\link.exe: running gcc failed: exit status 1    
C:\Users\ADMINI~1\AppData\Local\Temp\go-link-1126134048\go.o: file not recognized: file format not recognized
collect2.exe: error: ld returned 1 exit status
@beoran
Copy link

beoran commented Feb 10, 2022

Do you have a C cross compiler for iOS and arm64 installed?

@cherrymui
Copy link
Member

See https://cs.opensource.google/go/go/+/master:misc/ios/README . You'll need an iOS C toolchain (which probably is only available on macOS), and set up the environment accordingly. Thanks.

@golang golang locked and limited conversation to collaborators Feb 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants