Skip to content

go build failed #13052

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

Closed
oikomi opened this issue Oct 26, 2015 · 3 comments
Closed

go build failed #13052

oikomi opened this issue Oct 26, 2015 · 3 comments

Comments

@oikomi
Copy link

oikomi commented Oct 26, 2015

hi @ALL

go build failed, what does it mean?

[miaohong]$ go build

# _/tmp/mh/php/agent

/usr/bin/ld: unrecognized option '--build-id=none'

/usr/bin/ld: use the --help option for usage information

collect2: ld returned 1 exit status



system info

[miaohong01$ go version
go version go1.5.1 linux/amd64

[miaohong]$ gcc --version
gcc (GCC) 3.4.5 20051201 (Red Hat 3.4.5-2)

Copyright (C) 2004 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.

[miaohong]$ uname -ar
Linux cp01-rdqa04-dev110.cp01 2.6.32_1-17-0-0 #1 SMP Mon Aug 24 11:14:27 CST 2015 x86_64 x86_64 x86_64 GNU/Linux
@ALTree
Copy link
Member

ALTree commented Oct 26, 2015

Old Rhel version? I suspect this is related to #9520

@ianlancetaylor
Copy link
Contributor

My reply on the mailing list:

Given that you are using a version of GCC that is more than ten years old, I would guess that the problem is that you are also using a very old version of the GNU binutils. When the go tool uses cgo on systems that use the GNU binutils, it passes --build-id=none to disable the generation of a build ID. This has worked for the GNU binutils for a long time, but it may not work for your very old version.

The choices I see would to update your GNU binutils, edit the go tool to remove the --build-id=none, or put a shell script on your PATH named ld that removes the --build=none option and then invoke the real ld.

Closing because I don't think there is anything for us to do.

@oikomi
Copy link
Author

oikomi commented Oct 27, 2015

I have remove all the cgo code, build pass. Thanks !

@golang golang locked and limited conversation to collaborators Oct 26, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants