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
math/bits: divideError is not a function; //go:linkname divideError runtime.divideError #30771
Comments
/cc @ianlancetaylor; I presume this needs some sort of fix to be backported into 1.12.x. |
In general I don't think we want to guarantee that the standard library can be built with gccgo. Certainly the runtime package cannot. While we should avoid introducing gratuitous differences it's hard to have no differences at all. In this case the gccgo copy of math/bits is patched to avoid the problem. In general we should probably fix gccgo to permit using |
If you can point us to how to patch either gccgo or go, we'd be happy to apply the patch to our local build and report back. I am curious how the prebuilt packages are built and how it's different from how we're trying to build go, also. |
I'm sorry, I'm not quite sure what you are asking. gccgo comes with its own copy of the Go standard library. It can be found in the gccgo sources in the libgo subdirectory. That copy of the standard library is built using gccgo during the normal gccgo build and install. There are docs on how to do that at https://golang.org/doc/install/gccgo. |
I think it could be useful that the gc toolchain can be bootstrapped with gccgo. Since this is in bootstrap code, maybe we want to consider to work around it. Otherwise people who want to bootstrap gc from gccgo would have to bootstrap an older version of gc then bootstrap gc tip from the older gc. |
@cherrymui summarizes our situation -- we would like to avoid having to drag along older versions of gc just to bootstrap the latest release tarball using gccgo. |
Change https://golang.org/cl/170737 mentions this issue: |
When building as part of the bootstrap process, avoid use of "go:linkname" applied to variables, since this feature is ill-defined/unsupported for gccgo. Updates #30771. Change-Id: Id44d01b5c98d292702e5075674117518cb59e2d0 Reviewed-on: https://go-review.googlesource.com/c/go/+/170737 Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
@apaprocki This should be fixed now on tip (bootstrap with gccgo now works for me). Please reopen if you run into other issues. |
Thanks! |
fails on 1.12.7 with gcc-9.1.0 compiled with the gcc-go. I guess the changes must be after this release?
|
Correct. The changes to the math/bits package will be in the upcoming 1.13 release. |
What version of Go are you using (
go version
)?Compiling 1.12.0 release source code using GCC 8.2 gccgo
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?linux amd64
What did you do?
Attempting to build the 1.12 release using GCC 8.2 gccgo fails with:
What did you expect to see?
Successful build
What did you see instead?
Failed build
The text was updated successfully, but these errors were encountered: