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: clang error linker command failed with exit code 1 #40996

Closed
hasanAjsf opened this issue Aug 23, 2020 · 1 comment
Closed

cmd/go: clang error linker command failed with exit code 1 #40996

hasanAjsf opened this issue Aug 23, 2020 · 1 comment

Comments

@hasanAjsf
Copy link

Building up on #40988 I tried to complile the app at Mac OS, and got the below error:

cmd.Run() failed with exit status 2:

output:

# command-line-arguments
/usr/local/go/pkg/tool/darwin_amd64/link: running clang failed: exit status 1
ld: unknown option: -z
clang: error: linker command failed with exit code 1 (use -v to see invocation)

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

$ go version
go version go1.15 darwin/amd64

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/hajsf/Library/Caches/go-build"
GOENV="/Users/hajsf/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/hajsf/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/hajsf/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
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 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/_d/dz1y2j413g18v0xssf6_64x40000gn/T/go-build017554273=/tmp/go-build -gno-record-gcc-switches -fno-common"
@cagedmantis cagedmantis changed the title go/cmd: clang: error: linker command failed with exit code 1 cmd/go: clang error linker command failed with exit code 1 Aug 26, 2020
@cagedmantis
Copy link
Contributor

What are the contents of the main.go file being compiled?

As mentioned in #40933, at this point this seems like questions. You will get better and faster help using a forum. Please see https://golang.org/wiki/Questions. Please comment on the issue if you feel like it was closed in error.

@golang golang locked and limited conversation to collaborators Aug 26, 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