error: unrecognized command line option '-m32'

83 views Asked by At

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

go version go1.21.4 linux/386

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

gGO111MODULE=''
GOARCH='386'
GOBIN=''
GOCACHE='/root/.cache/go-build'
GOENV='/root/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='386'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/root/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/root/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/linux_386'
GOVCS=''
GOVERSION='go1.21.4'
GCCGO='gccgo'
GO386='sse2'
AR='ar'
CC='arm-anykav200-linux-uclibcgnueabi-gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/home/code/xfjlinux/go.mod'
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 -m32 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3061509108=/tmp/go-build -gno-record-gcc-switches'

What did you do?

go env -w CC=arm-anykav200-linux-uclibcgnueabi-gcc
go build -buildmode=c-archive -o libNode.so client.go

What did you expect to see?

No errors

What did you see instead?

error: unrecognized command line option "-m32"

I came across a similar issue on https://github.com/golang/go/issues/25665, but it seems unresolved. I want to compile using a custom GCC, but it appears that this GCC does not support the -m32 parameter. How can I solve this problem?

0

There are 0 answers