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

Closed
evanj opened this issue Jan 29, 2021 · 7 comments
Labels
Builders x/build issues (builders, bots, dashboards) Documentation FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@evanj
Copy link
Contributor

evanj commented Jan 29, 2021

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

$ go version

go1.16rc1

Does this issue reproduce with the latest release?

Yes.

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

go env Output
$ go env

GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.16rc1"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/shared/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
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/importcfg.link -buildmode=exe -buildid=dx0H7nktY5bJLfxiNI0p/uqwImzVISJS7i4MYRZEk/TLUSJTYITbUnYwoTsd1m/dx0H7nktY5bJLfxiNI0p -extld=gcc $WORK/b001/_pkg_.a
# github.com/evanj/linkexample/cgobasic
/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? https://github.com/golang/go/wiki/MinimumRequirements

@ianlancetaylor
Copy link
Contributor

For the record, the relocation is R_X86_64_REX_GOTPCRELX.

I don't think this affects https://golang.org/wiki/MinimumRequirements. 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

@dmitshur
Copy link
Contributor

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 https://wiki.debian.org/LTS). We want to start using the next stable release, Debian 9 "Stretch", which has LTS support until June 2022.

From https://wiki.ubuntu.com/Releases, 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 x/build issues (builders, bots, dashboards) label Jan 29, 2021
@gopherbot gopherbot added this to the Unreleased milestone Jan 29, 2021
@dmitshur dmitshur added the NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. label Jan 29, 2021
@dmitshur dmitshur modified the milestones: Unreleased, Go1.16 Jan 29, 2021
@evanj
Copy link
Contributor Author

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: all: announce end of support for old macOS releases #23011

  • Linux: The requirements for binaries produced by the Go tools are documented on the wiki: https://github.com/golang/go/wiki/MinimumRequirements ; 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: https://github.com/golang/go/wiki/MinimumRequirements

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: https://golang.org/doc/devel/release.html#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!

@odeke-em
Copy link
Member

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.

@adam-azarchs
Copy link
Contributor

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.

@ianlancetaylor
Copy link
Contributor

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 The path to resolution is known, but the work has not been done. and removed NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. labels Mar 24, 2021
@dmitshur
Copy link
Contributor

By now the two supported Go releases are 1.19 and 1.18, so we'll not be making 1.16-specific changes. Issue #41212 tracks general improvements to how we track and document system requirements.

@dmitshur dmitshur closed this as not planned Won't fix, can't repro, duplicate, stale Sep 23, 2022
@golang golang locked and limited conversation to collaborators Sep 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Builders x/build issues (builders, bots, dashboards) Documentation FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

6 participants