$ go version
go version devel +7f688d18c0 Mon Nov 30 22:14:36 2020 +0000 linux/amd64
Does this issue reproduce with the latest release?
No. It is on tip only.
$ gccgo --version
gccgo (Debian 8.3.0-6) 8.3.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE
What operating system and processor architecture are you using (go env)?
@dotaheor I wasn't able to reproduce this at the commit you listed.
Could you edit the issue to include the full go env output? It's important for debugging so please don't skip it. Please also let us know the gccgo version you're using, the Linux distribution and version, and any other information that would help us reproduce. If you can reproduce this with a minimal Dockerfile for example, that would be super helpful.
Thanks, I was able to reproduce the issue using a toolchain built with this Dockerfile:
RUN apt-get update
RUN apt-get install -y gccgo git golang
RUN git clone https://go.googlesource.com/go /goroot && \
cd /goroot/src && \
git checkout 7f688d18c0 && \
This is with: gcc version 8.3.0 (Debian 8.3.0-6)
It looks like this issue was exposed when we enabled GO111MODULE=on by default. I also reproduced it with Go 1.15.5 when that environment variable was set explicitly.
In module mode, we embed version information in linked binaries. The symbol runtime.setmodinfo is used to set that information. It looks like when a binary is linked in module mode, that symbol is missing.
The version of gccgo being used is too old. The runtime.setmodinfo function was introduced in GCC 10.
This is the kind of problem that is inevitable when using the "go" tool from the gc toolchain with gccgo. We try to make them work together, but it's hard to avoid all version mismatch problems. If you want to use gccgo, the best approach is to use the "go" tool that comes with the version of gccgo that you are using.
That said, this is a bug, although not a very important one, so leaving this issue open.