-
Notifications
You must be signed in to change notification settings - Fork 18k
build: bootstrap build of go fails on windows amd64 #36691
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
Comments
This is caused by the the gcc toolchain you are using. What is it? |
Anyone know if |
Win docs say <process.h> |
Hmmm, we already |
I don't know if this is useful, but I've seen that error in the past when trying to build from source on windows with a cygwin gcc (which anyway is not officially supported for bootstrapping Go on windows) |
See also all the related conversation in #35006. This might even be a dup. |
I agree #35006 (comment) might help. @lovettchris download http://musl.cc/x86_64-w64-mingw32-native.zip, unzip it anywhere, add bin subdirectory to your PATH, and try again. You can also set CGO_ENABLED=0 and that will build Go without any gcc installed. You won't be able to do Cgo, if you do that. Thank you. Alex |
Timed out in state WaitingForInfo. Closing. (I am just a bot, though. Please speak up if this is a mistake or you have the requested information.) |
Go has never supported Cygwin as a C compiler, but users get the following cryptic error message when they try to use it: implicit declaration of function '_beginthread' This is because Cygwin doesn't implement _beginthread. Note that this is not the only problem with Cygwin, but it's the one that users are most likely to run into first. This CL improves the error message to make it clear that Cygwin is not supported, and suggests using MinGW instead. Fixes #59490 Fixes #36691 Change-Id: Ifeec7a2cb38d7c5f50d6362c95504f72818c6a76 Reviewed-on: https://go-review.googlesource.com/c/go/+/627935 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Reviewed-by: Cherry Mui <[email protected]>
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
trying to use the go bootstrap version 1.4 (as per https://golang.org/doc/install/source) to build the latest go sources. But it fails.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Downloaded and unpacked go1.4.windows-amd64.zip to c:\go
set GOROOT_BOOTSTRAP=c:\go
set GOROOT_FINAL=d:\go
cloned the latest github.com/golang/go
cd src
all.bat
What did you expect to see?
Successful build of the new version of go.
What did you see instead?
d:\git\golang\go\src>all.bat
Building Go cmd/dist using c:\go
Building Go toolchain1 using c:\go.
Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.
Building Go toolchain2 using go_bootstrap and Go toolchain1.
Building Go toolchain3 using go_bootstrap and Go toolchain2.
Building packages and commands for windows/amd64.
// runtime/cgo
gcc_libinit_windows.c: In function 'x_cgo_sys_thread_create':
gcc_libinit_windows.c:57:12: error: implicit declaration of function '_beginthread'; did you mean 'OpenThread'? [-Werror=implicit-function-declaration]
thandle = _beginthread(func, 0, arg);
^~~~~~~~~~~~
OpenThread
cc1: all warnings being treated as errors
go: failed to remove work dir: GetFileInformationByHandle C:\Users\Chris\AppData\Local\Temp\go-build549624342\NUL: Incorrect function.
go tool dist: FAILED: d:\git\golang\go\pkg\tool\windows_amd64\go_bootstrap install -gcflags=all= -ldflags=all= std cmd: exit status 2
The system cannot find the batch label specified - fail
go: failed to remove work dir: GetFileInformationByHandle C:\Users\Chris\AppData\Local\Temp\go-build900619142\NUL: Incorrect function.
The text was updated successfully, but these errors were encountered: