I'm trying to cross compile my Go project on windows/amd64 for linux/386, but get a "nosplit stack overflow" error. I followed the instructions that are outlined here. With GOOS=linux
and GOARCH=386
, my go env
looks as follows:
set GOARCH=386
set GOBIN=
set GOEXE=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=linux
set GOPATH=C:\dev\gopath
set GORACE=
set GOROOT=C:\Go
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GO15VENDOREXPERIMENT=0
set CC=gcc
set GOGCCFLAGS=-fPIC -m32 -fmessage-length=0
set CXX=g++
set CGO_ENABLED=0
The complete error I get when running go build
is:
runtime.cgocall: nosplit stack overflow
508 assumed on entry to runtime.cgocall (nosplit)
464 after runtime.cgocall (nosplit) uses 44
460 on entry to runtime.exitsyscall (nosplit)
272 after runtime.exitsyscall (nosplit) uses 188
268 on entry to runtime.exitsyscallfast (nosplit)
108 after runtime.exitsyscallfast (nosplit) uses 160
104 on entry to runtime.writebarrierptr (nosplit)
64 after runtime.writebarrierptr (nosplit) uses 40
60 on entry to runtime.writebarrierptr_nostore1 (nosplit)
8 after runtime.writebarrierptr_nostore1 (nosplit) uses 52
4 on entry to runtime.acquirem (nosplit)
-12 after runtime.acquirem (nosplit) uses 16 runtime.cgocallbackg: nosplit stack overflow
508 assumed on entry to runtime.cgocallbackg (nosplit)
460 after runtime.cgocallbackg (nosplit) uses 48
456 on entry to runtime.exitsyscall (nosplit)
268 after runtime.exitsyscall (nosplit) uses 188
264 on entry to runtime.exitsyscallfast (nosplit)
104 after runtime.exitsyscallfast (nosplit) uses 160
100 on entry to runtime.writebarrierptr (nosplit)
60 after runtime.writebarrierptr (nosplit) uses 40
56 on entry to runtime.writebarrierptr_nostore1 (nosplit)
4 after runtime.writebarrierptr_nostore1 (nosplit) uses 52
0 on entry to runtime.acquirem (nosplit)
-16 after runtime.acquirem (nosplit) uses 16 runtime.cgocallback_gofunc: nosplit stack overflow
508 assumed on entry to runtime.cgocallback_gofunc (nosplit)
496 after runtime.cgocallback_gofunc (nosplit) uses 12
492 on entry to runtime.cgocallbackg (nosplit)
444 after runtime.cgocallbackg (nosplit) uses 48
440 on entry to runtime.exitsyscall (nosplit)
252 after runtime.exitsyscall (nosplit) uses 188
248 on entry to runtime.exitsyscallfast (nosplit)
88 after runtime.exitsyscallfast (nosplit) uses 160
84 on entry to runtime.writebarrierptr (nosplit)
44 after runtime.writebarrierptr (nosplit) uses 40
40 on entry to runtime.writebarrierptr_nostore1 (nosplit)
-12 after runtime.writebarrierptr_nostore1 (nosplit) uses 52
Other target configurations that do work are GOOS=windows GOARCH=386
and GOOS=linux GOARCH=amd64
, but GOOS=linux GOARCH=386
does not work. Any ideas?