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: cc1: error: unrecognized command line option "-m32" during get #25665

Closed
gbitten opened this issue May 31, 2018 · 5 comments
Closed

cmd/go: cc1: error: unrecognized command line option "-m32" during get #25665

gbitten opened this issue May 31, 2018 · 5 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@gbitten
Copy link

gbitten commented May 31, 2018

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

go version go1.10.2 linux/386

Does this issue reproduce with the latest release?

Version 1.10.2 is the latest stable release, Anyway, It works normally with go version go1.9.6 linux/386.

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

GOARCH="386"
GOBIN=""
GOCACHE="/home/rds/.cache/go-build"
GOEXE=""
GOHOSTARCH="386"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/rds/go"
GORACE=""
GOROOT="/home/rds/gotest/go"
GOTMPDIR=""
GOTOOLDIR="/home/rds/gotest/go/pkg/tool/linux_386"
GCCGO="gccgo"
GO386="sse2"
CC="arm-arago-linux-gnueabi-gcc"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m32 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build804659883=/tmp/go-build"

What did you do?

wget https://dl.google.com/go/go1.10.2.linux-386.tar.gz
sudo tar -C /usr/local -xzf go1.10.2.linux-386.tar.gz
echo export PATH=\$PATH:/usr/local/go/bin >> ~/.profile
source ~/.profile
go get github.com/gorilla/mux

What did you expect to see?

No errors

What did you see instead?

# runtime/cgo
cc1: error: unrecognized command line option "-m32"
@agnivade agnivade changed the title cc1: error: unrecognized command line option "-m32" cmd/go: cc1: error: unrecognized command line option "-m32" during get May 31, 2018
@agnivade agnivade added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label May 31, 2018
@agnivade agnivade added this to the Go1.11 milestone May 31, 2018
@bradfitz
Copy link
Contributor

/cc @ianlancetaylor

@ianlancetaylor
Copy link
Contributor

You are building for 386, but your CC environment variable points to what looks like an ARM compiler. Don't set CC in the environment, or at least set it to an x86 compiler.

@gbitten
Copy link
Author

gbitten commented Jun 1, 2018

This machine is used to cross compile with GCC, I didn't know that could affect Go.

@ianlancetaylor
Copy link
Contributor

The CC environment variable sets the default C compiler to use with Go code that calls C code, as documented at https://golang.org/cmd/cgo and https://golang.org/cmd/go/#hdr-Environment_variables .

@frakman1
Copy link

I had the same error. It turns out the shell I was using was previously set up to cross compile (source environ ...) The fix was just to open a new, fresh shell so it didn't have the holdover environment variables from before.

@golang golang locked and limited conversation to collaborators Jul 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

6 participants