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

runtime/cgo: build-id=none parameter passed to ld prevents building go from source on CentOS 4 and 5 #9520

Closed
alyandon opened this Issue Jan 6, 2015 · 7 comments

Comments

Projects
None yet
5 participants
@alyandon

alyandon commented Jan 6, 2015

The version of ld that ships with Centos 4/5 does not accept the build-id parameter which causes the build process to abort with the following error:

# runtime/cgo
/usr/bin/ld: unrecognized option '--build-id=none'
/usr/bin/ld: use the --help option for usage information
collect2: ld returned 1 exit status

It appears this was added by default in the following commit:

commit 7fdb029
Author: Ian Lance Taylor iant@golang.org
Date: Thu Aug 7 12:38:39 2014 -0700

cmd/go: pass --build-id=none when generating a cgo .o

Some systems, like Ubuntu, pass --build-id when linking.  The
effect is to put a note in the output file.  This is not
useful when generating an object file with the -r option, as
it eventually causes multiple build ID notes in the final
executable, all but one of which are for tiny portions of the
file and are therefore useless.

Disable that by passing an explicit --build-id=none when
linking with -r on systems that might do this.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/119460043
@davecheney

This comment has been minimized.

Show comment
Hide comment
@davecheney

davecheney Jan 6, 2015

Contributor

I'm sorry but centos/rhel versions less than 6 are not supported by Go

Contributor

davecheney commented Jan 6, 2015

I'm sorry but centos/rhel versions less than 6 are not supported by Go

@davecheney davecheney closed this Jan 6, 2015

@mikioh mikioh changed the title from build-id=none parameter passed to ld prevents building go from source on Centos 4 and 5 to runtime/cgo: build-id=none parameter passed to ld prevents building go from source on CentOS 4 and 5 Jan 6, 2015

@alyandon

This comment has been minimized.

Show comment
Hide comment
@alyandon

alyandon Jan 6, 2015

Ah, sorry for the noise then.

alyandon commented Jan 6, 2015

Ah, sorry for the noise then.

@ianlancetaylor

This comment has been minimized.

Show comment
Hide comment
@ianlancetaylor

ianlancetaylor Jan 7, 2015

Contributor

Sadly this will not be the only problem you run into.

Contributor

ianlancetaylor commented Jan 7, 2015

Sadly this will not be the only problem you run into.

@jeffallen

This comment has been minimized.

Show comment
Hide comment
@jeffallen

jeffallen Mar 19, 2015

Contributor

Here is a workaround for this problem:

http://blog.nella.org/building-go-1-4-when-the-linker-doesnt-know-about-build-id/

While RHEL 5.5 is not supported by Go, with this workaround, the Go toolchain build does complete, and you can use Go 1.4 to build Go tip, and you can use Go tip's compiler. Perhaps the binaries fail in funny ways at runtime due to RHEL 5.5?

Contributor

jeffallen commented Mar 19, 2015

Here is a workaround for this problem:

http://blog.nella.org/building-go-1-4-when-the-linker-doesnt-know-about-build-id/

While RHEL 5.5 is not supported by Go, with this workaround, the Go toolchain build does complete, and you can use Go 1.4 to build Go tip, and you can use Go tip's compiler. Perhaps the binaries fail in funny ways at runtime due to RHEL 5.5?

@ianlancetaylor

This comment has been minimized.

Show comment
Hide comment
@ianlancetaylor

ianlancetaylor Mar 19, 2015

Contributor

The Go runtime requires Linux kernel version 2.6.23--which version of the kernel does RHEL 5.5 have?

Contributor

ianlancetaylor commented Mar 19, 2015

The Go runtime requires Linux kernel version 2.6.23--which version of the kernel does RHEL 5.5 have?

@alyandon

This comment has been minimized.

Show comment
Hide comment
@alyandon

alyandon Mar 19, 2015

RHEL 5.x is supposedly 2.6.18 - but the real answer is not as simple as comparing version numbers as RedHat actively backports features from later kernels.

http://dave.cheney.net/2013/06/18/how-to-install-go-1-1-on-centos-5

I've compiled Go 1.4 on Cenos 5.x and the test suite appears to complete with no errors except for the file descriptor leak and all the code I've personally tested appears to work. However, I think realistically most simple programs would run fine but you are walking into a potential minefield if you plan on using Go in a non-trivial way on Centos/RHEL 5.

alyandon commented Mar 19, 2015

RHEL 5.x is supposedly 2.6.18 - but the real answer is not as simple as comparing version numbers as RedHat actively backports features from later kernels.

http://dave.cheney.net/2013/06/18/how-to-install-go-1-1-on-centos-5

I've compiled Go 1.4 on Cenos 5.x and the test suite appears to complete with no errors except for the file descriptor leak and all the code I've personally tested appears to work. However, I think realistically most simple programs would run fine but you are walking into a potential minefield if you plan on using Go in a non-trivial way on Centos/RHEL 5.

@davecheney

This comment has been minimized.

Show comment
Hide comment
@davecheney

davecheney Mar 19, 2015

Contributor

@alyandon @jeffallen this issue is closed. Please take the discussion elsewhere, probably golang-nuts.

Contributor

davecheney commented Mar 19, 2015

@alyandon @jeffallen this issue is closed. Please take the discussion elsewhere, probably golang-nuts.

@golang golang locked and limited conversation to collaborators Jun 25, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.