Skip to content
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

x/build: document that Ubuntu 14.04 doesn't meet minimum requirement for Go 1.16 binary release #43996

evanj opened this issue Jan 29, 2021 · 6 comments
Builders Documentation help wanted NeedsFix


Copy link

@evanj evanj commented Jan 29, 2021

What version of Go are you using (go version)?

$ go version


Does this issue reproduce with the latest release?


What operating system and processor architecture are you using (go env)?

go env Output
$ go env

GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build704623638=/tmp/go-build -gno-record-gcc-switches"

What did you do?

  1. Download Go 1.16rc1 linux amd64 release on to a Ubuntu 14.04 Trusty system
  2. Attempt to link a Go program that uses Cgo.

What did you expect to see?

A correctly linked binary.

What did you see instead?

/usr/local/go/pkg/tool/linux_amd64/link -o $WORK/b001/exe/a.out -importcfg $WORK/b001/ -buildmode=exe -buildid=dx0H7nktY5bJLfxiNI0p/uqwImzVISJS7i4MYRZEk/TLUSJTYITbUnYwoTsd1m/dx0H7nktY5bJLfxiNI0p -extld=gcc $WORK/b001/_pkg_.a
/usr/local/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/usr/bin/ld: /tmp/go-link-642826874/000006.o: unrecognized relocation (0x2a) in section `.text'
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status

This program builds correctly with Go 1.15.7, or if I run all.bash to build Go 1.16rc1 locally.

My guess at what is happening

I think this means Go 1.16rc1 was built on a version of Linux with binutils > 2.24, which seems to be what happened with a previous similar issue: #31293

It could be that this is expected: Ubuntu 14.04 Trusty is End of Life and no longer supported, and the workaround is to build your own version of the Go tools. However, if this is expected, a mention in the release notes would be nice, and maybe a mention in the minimum requirements wiki page?

Copy link

@ianlancetaylor ianlancetaylor commented Jan 29, 2021

For the record, the relocation is R_X86_64_REX_GOTPCRELX.

I don't think this affects The minimum requirements remain the same. This only applies to the binary release. I don't know what guidelines we might have for the binary releases.

CC @dmitshur @toothrot @cagedmantis

Copy link

@dmitshur dmitshur commented Jan 29, 2021

Yes, we have started using a newer distribution of Linux to build the binaries as of Go 1.16. The rationale is described in #40561 (comment). I'll copy it here:

Rationale: Debian 8 "Jessie" Long Term Support (LTS) has ended on June 30, 2020 (see We want to start using the next stable release, Debian 9 "Stretch", which has LTS support until June 2022.

From, I see that Ubuntu 14.04 LTS (first released in 2014) standard support ended on April 2019, and EOL is on April 2022.

@dmitshur dmitshur changed the title Go 1.16rc1: Cgo unrecognized relocation (0x2a) on Ubuntu 14.04 x/build: releaselet for Go 1.16 produces binary that can't link cgo on Ubuntu 14.04 Jan 29, 2021
@gopherbot gopherbot added the Builders label Jan 29, 2021
@gopherbot gopherbot added this to the Unreleased milestone Jan 29, 2021
@dmitshur dmitshur added the NeedsDecision label Jan 29, 2021
@dmitshur dmitshur removed this from the Unreleased milestone Jan 29, 2021
@dmitshur dmitshur added this to the Go1.16 milestone Jan 29, 2021
Copy link
Contributor Author

@evanj evanj commented Jan 29, 2021

Thank you! Then from my perspective, this issue could be closed, although I would love it if this were documented this somewhere? This information is not easy to find. Some information that seems to be the current policy:

  • Mac OS X: The release notes will describe the minimum version of Mac OS X that are supported both by binary releases of Go tools, and by binaries produced by those tools. This will include all Mac OS X releases still receiving security updates at the time of the release, and may include older versions. This is paraphrased from this issue: #23011

  • Linux: The requirements for binaries produced by the Go tools are documented on the wiki: ; The requirements for binary releases are undocumented. This issues suggests that binary releases will support the oldest supported Debian LTS release at the time of the Go release. This means binary releases should also work on newer Debian distributions, and other distributions with compatible tool chains and libraries. To support other distribution, you should build the Go tools from source.

  • Windows: The requirements for both binary releases and binaries produced by the Go tools are documented on the wiki:

My suggestion would be to update the wiki page with some additional detail about the Linux binary release requirements, and link to the wiki page from the Release Policy: ; but honestly any place other than the Go issue tracker would be appreciated! I will be happy to submit some change somewhere, but given that I don't know where it should go, nor what it should say, it might be easier for someone else to do it. Thanks for the rapid clarification!

Copy link

@odeke-em odeke-em commented Feb 11, 2021

Thank you for the report @evanj, and for answering questions Ian, and Dmitri!

@evanj, thanks for the suggestions and conclusion in #43996 (comment), this then frees up this issue from holding up Go1.16. In regards to sending a change, I am not sure where else this could go, but for a start, please send a change to the Wiki and as Go1.17 and others progress, perhaps we can raise this with the @golang/release team to help decide where else to document these requirements.

@odeke-em odeke-em removed this from the Go1.16 milestone Feb 11, 2021
@odeke-em odeke-em added this to the Unplanned milestone Feb 11, 2021
Copy link

@adam-azarchs adam-azarchs commented Feb 19, 2021

For what it's worth, this is also breaking linkage on Ubuntu 14 (trusty). That's also out of support of course, but more recently so. That's binutils 2.24. While I haven't tested on CentOS 6 (which is of course also out of support but still in widespread use by sysadmins who are still procrastinating on the whole systemd thing), CentOS6 uses binutils 2.23. Ubuntu 16 (xenial), with binutils 2.26, does seem to work.

Unfortunately too many of our customers still use CentOS6 to allow us to drop support, so we have to continue building there, which makes this problematic for us. We can probably get by with updating binutils, or if this is really just a problem with the binaries we can build our own go binaries.

Copy link

@ianlancetaylor ianlancetaylor commented Feb 20, 2021

It's really just a problem with the binaries. If you build your own binaries on the systems in question you will not see this problem.

@dmitshur dmitshur changed the title x/build: releaselet for Go 1.16 produces binary that can't link cgo on Ubuntu 14.04 x/build: document that Ubuntu 14.04 doesn't meet minimum requirement for Go 1.16 binary release Mar 24, 2021
@dmitshur dmitshur added NeedsFix and removed NeedsDecision labels Mar 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Builders Documentation help wanted NeedsFix
None yet

No branches or pull requests

6 participants