Skip to content

Error on crosscompile (win to lin) #34529

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
prospero78 opened this issue Sep 25, 2019 · 2 comments
Closed

Error on crosscompile (win to lin) #34529

prospero78 opened this issue Sep 25, 2019 · 2 comments

Comments

@prospero78
Copy link

prospero78 commented Sep 25, 2019

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

$ go version
1.13

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=d:\coding\golang\_home\bin
set GOCACHE=C:\Users\User\AppData\Local\go-build
set GOENV=C:\Users\User\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=d:\coding\golang\_home
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=D:\coding\golang
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=D:\coding\golang\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=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=d:\temp\go-build369796638=/tmp/go-build -gno-record-gcc-switches

What did you do?

What did you expect to see?

go build main.go

runtime/cgo

gcc_linux_amd64.c: In function '_cgo_sys_thread_start':
gcc_linux_amd64.c:61:2: error: unknown type name 'sigset_t'; did you mean '_sigset_t'?
sigset_t ign, oset;
^~~~~~~~
_sigset_t
gcc_linux_amd64.c:66:2: error: implicit declaration of function 'sigfillset' [-Werror=implicit-function-declaration]
sigfillset(&ign);
^~~~~~~~~~
gcc_linux_amd64.c:61:16: error: unused variable 'oset' [-Werror=unused-variable]
sigset_t ign, oset;
^~~~
cc1.exe: all warnings being treated as errors

What did you see instead?

Its raise on cross compile win -> lin. Please!! Its not good!!
for compile:

set GOOS=linux

@cherrymui
Copy link
Member

You need to set CC to a C cross compiler.

@mdempsky
Copy link
Contributor

Please see https://github.com/golang/go/wiki/Questions for where to ask questions. Thanks.

@golang golang locked and limited conversation to collaborators Sep 24, 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

4 participants