-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
cmd/go: cannot link with CGO_ENABLED=1 on mips64 #55096
Comments
This error is weird. We are building an executable, not a shared object... What C linker do you use and what version? Does setting |
This is with bfd from binutils-2.39. I can try that, but another curious thing I've discovered is that the compile time shoots up almost 10x with CGO_ENABLED=1. Time to compile (and hit this error) with CGO_ENABLED=1: ~8 hours |
@cherrymui Your comment about the linker made me curious if that might be it, and it turned out it was! Reverting to binutils-2.38 resolves the issue, so this is a regression in binutils-2.39. I will report it upstream there. Also, for reference, here are the exact compile times: CGO_ENABLED=0: 2022-09-15T15:29:59 >>> dev-lang/go-1.19.1: 43 minutes, 40 seconds That is twice as long as it takes to compile Rust from source on the same hardware. 2022-09-15T10:13:58 >>> dev-lang/rust-1.63.0-r1: 4 hours, 10 minutes, 25 seconds But since that's only incidental to the ticket and this is technically identified as a binutils issue, I will close. |
This comment was marked as duplicate.
This comment was marked as duplicate.
FYI, I bisected this to bminor/binutils-gdb@65daf5b and opened a bug in binutils upstream at https://sourceware.org/bugzilla/show_bug.cgi?id=29592. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
go is unable to bootstrap itself, nor link any binaries when
CGO_ENABLED=1
. No problems withCGO_ENABLED=0
. It errors out with thousands of errors like this, one for every single symbol:Attached are two logs, the first from trying to bootstrap itself (which is where the above series of errors comes from) and the second from attempting to build the go-sqlite tests. Building the package succeeds (because it's just a static library) but building the tests fails because they have dynamic executables that need to link.
o00p.log.gz
go-sqlite-logs.log
System toolchain being used: mips64-unknown-linux-gnu-gcc 12.2.0, binutils 2.39, kernel 5.19, big-endian n64 ABI.
Shell access to this machine can be provided on request!
The text was updated successfully, but these errors were encountered: