Skip to content

affected/package: cgo #63206

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

Closed
ImagineYao opened this issue Sep 25, 2023 · 2 comments
Closed

affected/package: cgo #63206

ImagineYao opened this issue Sep 25, 2023 · 2 comments
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@ImagineYao
Copy link

ImagineYao commented Sep 25, 2023

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

$ go version
$ go version go1.21.1 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='on'
GOARCH='arm64'
GOBIN=''
GOCACHE='/Users/user/Library/Caches/go-build'
GOENV='/Users/user/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/user/go/pkg/mod'
GONOPROXY='*.okg.com'
GONOSUMDB='*.okg.com'
GOOS='darwin'
GOPATH='/Users/user/go'
GOPROXY='https://goproxy.cn,direct'
GOROOT='/usr/local/go/bin'
GOSUMDB='off'
GOTMPDIR=''
GOTOOLCHAIN=''
GOTOOLDIR='/usr/local/go/bin/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.21.1'
GCCGO='gccgo'
AR='ar'
CC='clang'
CXX='clang++'
CGO_ENABLED='1'
GOMOD='/dev/null'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/tg/6zv0sgfd1wl_f7h6_mf1clnm0000gn/T/go-build2492287006=/tmp/go-build -gno-record-gcc-switches -fno-common'

What did you do?

My go projects use cgo. I set CGO_LDFLAGS in go test template. But when I run the test, it occurs every time.

My gcc version

$ gcc --version
$ Apple clang version 15.0.0 (clang-1500.0.40.1)
Target: arm64-apple-darwin22.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

What did you expect to see?

The output of my methods

What did you see instead?

runtime/cgo
cgo: cannot parse $WORK/b133/cgo.o as ELF, Mach-O, PE or XCOFF

@bcmills
Copy link
Contributor

bcmills commented Sep 25, 2023

My go projects use cgo. I set CGO_LDFLAGS in go test template. But when I run the test, it occurs every time.

Can you give more specific steps to reproduce this failure?
(Ideally, a reference to a public repo and exact commands to run in that repo to reproduce the problem.)

@bcmills bcmills added WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. compiler/runtime Issues related to the Go compiler and/or runtime. labels Sep 25, 2023
@ImagineYao
Copy link
Author

My go projects use cgo. I set CGO_LDFLAGS in go test template. But when I run the test, it occurs every time.

Can you give more specific steps to reproduce this failure? (Ideally, a reference to a public repo and exact commands to run in that repo to reproduce the problem.)

Translation: Thank you for the reply. This issue was caused by some configuration of my computer's environment, and it has now been resolved.

@golang golang locked and limited conversation to collaborators Sep 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

3 participants