FAQ
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






------------------

With kind regards,




Hong Miao

E-mail: miaohong@miaohong.org

Home: github.com/oikomi

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Ian Lance Taylor at Oct 26, 2015 at 3:45 pm

    On Mon, Oct 26, 2015 at 4:03 AM, Harold wrote:
    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
    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.

    Ian

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Harold at Oct 27, 2015 at 2:33 am
    I have remove all the cgo code, build pass. Thanks !


    ------------------

    With kind regards,




    Hong Miao

    E-mail: miaohong@miaohong.org

    Home: github.com/oikomi










    ------------------ Original ------------------
    From: "Ian Lance Taylor";<iant@golang.org>;
    Date: Mon, Oct 26, 2015 11:45 PM
    To: "Harold"<miaohong@miaohong.org>;
    Cc: "golang-nuts"<golang-nuts@googlegroups.com>;
    Subject: Re: [go-nuts] go build failed


    On Mon, Oct 26, 2015 at 4:03 AM, Harold wrote:

    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
    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.

    Ian

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedOct 26, '15 at 2:14p
activeOct 27, '15 at 2:33a
posts3
users2
websitegolang.org

2 users in discussion

Harold: 2 posts Ian Lance Taylor: 1 post

People

Translate

site design / logo © 2021 Grokbase