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
I tried to build a project, but cgo code kept failing
code demo:
package main
import(
"fmt"
"gopkg.in/olebedev/go-duktape.v3"
)
func main() {
ctx := duktape.New()
ctx.PushGlobalGoFunction("log", func(c *duktape.Context) int {
fmt.Println(c.SafeToString(-1))
return 0
})
ctx.PevalString(`log('Go lang Go!')`)
}
What did you see happen?
In command line:
go build -o main2 main.go
# runtime/cgo
In file included from _cgo_export.c:4:
cgo-gcc-export-header-prolog:31:14: error: size of array ‘_check_for_64_bit_pointer_matching_GoInt’ is negative
What did you expect to see?
compile fine when GOARCH is set to host arch, but fail when cross compile to arm64
what can I do to fix this inconsistent behavior?
The text was updated successfully, but these errors were encountered:
Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only.
Go version
go version go1.22.1 linux/amd64
Output of
go env
in your module/workspace:What did you do?
I tried to build a project, but cgo code kept failing
code demo:
What did you see happen?
In command line:
go build -o main2 main.go
# runtime/cgo
In file included from _cgo_export.c:4:
cgo-gcc-export-header-prolog:31:14: error: size of array ‘_check_for_64_bit_pointer_matching_GoInt’ is negative
What did you expect to see?
compile fine when GOARCH is set to host arch, but fail when cross compile to arm64
what can I do to fix this inconsistent behavior?
The text was updated successfully, but these errors were encountered: