Skip to content

Is gcc_android.c being used? #30423

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
ashishb opened this issue Feb 27, 2019 · 1 comment
Closed

Is gcc_android.c being used? #30423

ashishb opened this issue Feb 27, 2019 · 1 comment

Comments

@ashishb
Copy link

ashishb commented Feb 27, 2019

I am trying to see how src/runtime/cgo/gcc_android.c is being used by golang while digging into #25035

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

$ go version
1.11.5

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

GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/ashishb/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/ashishb/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.11.5/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.11.5/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
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/0g/jlcvgtb123s_f9rlml8w_3x80000gn/T/go-build829902418=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Delete src/runtime/cgo/gcc_android.c and build goland using src/all.bash.

What did you expect to see?

If gcc_android.c is being used, I would have expected that with a high likelihood some compilation would have failed.

What did you see instead?

Compilation of golang succeeded without any issues.

@ianlancetaylor
Copy link
Contributor

We don't usually use the issue tracker for questions. You will get better answers on a forum such as golang-nuts; see https://golang.org/wiki/Questions. Thanks.

The file runtime/cgo/gcc_android.c is only used when building for Android systems, so deleting it will not cause a problem if you are not building for an Android system. If you have an Android cross-compiler installed, try running something like GOARCH=arm GOOS=android go build x.go where x.go is a program that uses cgo. I would expect that to fail if runtime/cgo/gcc_android.c is deleted.

@golang golang locked and limited conversation to collaborators Feb 27, 2020
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