I've installed Go 1.2 on a Windows machine, wrote up a dummy program and set the environment variables GOARCH
and GOOS
to "AMD64" and "linux" respectively.
When i issue the "go build
" command, i receive an error:
go build runtime: linux/amd64 must be bootstrapped using make.bat
What does this mean?
It tells you it needs all tools built before you can use them.
If your windows GOARCH is amd64, then you could "build" all required tools by running this small batch programs:
set GOARCH=amd64
set GOOS=linux
go tool dist install -v pkg/runtime
go install -v -a std
If that succeeds then you should be able to do what you've described (just use amd64, not AMD64 - it is case sensitive).
If your windows GOARCH is 386, then you would need to build your 386 tools first. You would need to download mingw gcc for that. Do what user2714852 said.
Here https://golang.org/wiki/WindowsCrossCompiling are similar instructions for linux, perhaps you find them helpful.
Alex