You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\i\AppData\Local\go-build
set GOENV=C:\Users\i\AppData\Roaming\go\env
set GOEXE=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GONOPROXY=
set GONOSUMDB=
set GOOS=linux
set GOPATH=E:\Sync\onedrive_pluvet\OneDrive - bupt.edu.cn\Code\MemoriBackend;C:\Go;C:\Users\i\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=C:\Go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=C:\Users\i\AppData\Local\Temp\go-build664142882=/tmp/go-build -gno-record-gcc-s
witches
What did you do?
I'm trying to build for linux
mkdir bin
setGOOS=linux
setGOARCH=amd64
setCGO_ENABLED=1
go get -x
go install -x
What did you expect to see?
Success
What did you see instead?
go build
# runtime/cgo
_cgo_export.c:1:0: error: -fPIC ignored for target (all code is position independent) [-Werror]
/* Code generated by cmd/cgo; DO NOT EDIT. */
^
cc1.exe: all warnings being treated as errors
The text was updated successfully, but these errors were encountered:
Setting up your Windows system to enable cross-compilation to Linux can be tricky, and I suspect you're running into a problem due to misconfiguration there. There are some common questions and answers to this on stack overflow, for example see here.
We use this issue tracker for tracking bugs in Go, and this doesn't seem to be one, so I'll close this. If it turns out to be a bug, please provide more specific information and we can re-open.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I'm trying to build for linux
What did you expect to see?
Success
What did you see instead?
The text was updated successfully, but these errors were encountered: