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

Build failed for ios/amd64 and ios/arm64 #43378

Closed
enty8080 opened this issue Dec 25, 2020 · 2 comments
Closed

Build failed for ios/amd64 and ios/arm64 #43378

enty8080 opened this issue Dec 25, 2020 · 2 comments

Comments

@enty8080
Copy link

enty8080 commented Dec 25, 2020

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

$ go version
go version go1.16beta1 darwin/arm64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/enty8080/Library/Caches/go-build"
GOENV="/Users/enty8080/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/enty8080/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="ios"
GOPATH="/Users/enty8080/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.16beta1"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="0"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/mp/l216mspj1r793n3f2zhh8vg40000gn/T/go-build1094833471=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

$ export GOOS=ios
$ export GOARCH=arm64
$ go build main.go
# command-line-arguments
loadinternal: cannot find runtime/cgo
$ export GOARCH=amd64
$ go build main.go
# command-line-arguments
loadinternal: cannot find runtime/cgo
/usr/local/go/pkg/tool/darwin_arm64/link: running clang failed: exit status 1
ld: warning: ignoring file /tmp/go-link-478913935/go.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
Undefined symbols for architecture arm64:
  "_main", referenced from:
     implicit entry/start for main executable
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
@eliasnaur
Copy link
Contributor

Duplicate of #43343?

@enty8080
Copy link
Author

@eliasnaur Sorry

@golang golang locked and limited conversation to collaborators Dec 25, 2021
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

3 participants