We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Cross-compiling a program that depends on Go's runtime package using the following compilation flags on a amd64/Linux system:
runtime
CGO_ENABLED=0 GOOS=freebsd GOARCH=amd64
It works when just using gb build for my native platform.
gb build
To reproduce: Compile this sample program from the Go runtime example with the following directory structure:
src |__ app |__ main.go
GOROOT=/path/to/go1.9.2 CGO_ENABLED=0 GOOS=freebsd GOARCH=amd64 gb build works. GOROOT=/path/to/go1.9.4 CGO_ENABLED=0 GOOS=freebsd GOARCH=amd64 gb build fails with the error:
GOROOT=/path/to/go1.9.2 CGO_ENABLED=0 GOOS=freebsd GOARCH=amd64 gb build
GOROOT=/path/to/go1.9.4 CGO_ENABLED=0 GOOS=freebsd GOARCH=amd64 gb build
# runtime cgo.go:9:3: //go:cgo_export_static main only allowed in cgo-generated code
According to Ian Lance Taylor, this error was newly introduced in Go 1.9.4. See: https://groups.google.com/forum/#!topic/golang-nuts/52ZHzgo6u1k
Edit: This is with a freshly-built version of gb, built with go 1.9.4.
Cross-compiling a program that depends on Go's
runtimepackage using the following compilation flags on a amd64/Linux system:It works when just using
gb buildfor my native platform.To reproduce:
Compile this sample program from the Go runtime example with the following directory structure:
GOROOT=/path/to/go1.9.2 CGO_ENABLED=0 GOOS=freebsd GOARCH=amd64 gb buildworks.GOROOT=/path/to/go1.9.4 CGO_ENABLED=0 GOOS=freebsd GOARCH=amd64 gb buildfails with the error:According to Ian Lance Taylor, this error was newly introduced in Go 1.9.4. See: https://groups.google.com/forum/#!topic/golang-nuts/52ZHzgo6u1k
Edit: This is with a freshly-built version of gb, built with go 1.9.4.