douyi1341 2019-03-11 08:56
浏览 77

为什么gccgo报告如此奇怪的错误消息?

It is just a simple "Hello World" program, with the source code:

package main

import "fmt"

func main() {
    fmt.Println("Hello, World")
}

I compiled it, with

go version go1.10.3 gccgo (GCC) 8.3.0 linux/amd64

and it reported the following error messages:

[victor@chroot-64:~/go]$ go build helloworld.go 
# command-line-arguments
/tmp/go-build724467564/b001/_buildid.s: Assembler messages:
/tmp/go-build724467564/b001/_buildid.s:1: Warning: entity size for SHF_MERGE not specified
/tmp/go-build724467564/b001/_buildid.s:1: Warning: group name for SHF_GROUP not specified
as: $WORK/b001/_buildid.o: warning: sh_link not set for section `.go.buildid'
# command-line-arguments
BFD: $WORK/b001/_buildid.o: warning: sh_link not set for section `.go.buildid'
# command-line-arguments
/usr/bin/ld: $WORK/b001/_pkg_.a(_buildid.o): warning: sh_link not set for section `.go.buildid'
/usr/bin/ld: unable to place orphaned sharable section .go.buildid (/tmp/go-build724467564/b001/_pkg_.a(_buildid.o))
collect2: error: ld returned 1 exit status
[victor@chroot-64:~/go]$

The go env command prints

[victor@chroot-64:~/go]$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/root/go"
GORACE=""
GOROOT="/usr/local"
GOTMPDIR=""
GOTOOLDIR="/usr/local/libexec/gcc/x86_64-pc-linux-gnu/8.3.0"
GCCGO="/usr/local/bin/gccgo8"
CC="gcc8"
CXX="g++8"
CGO_ENABLED="1"
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-build455330439=/tmp/go-build -gno-record-gcc-switches -funwind-tables"
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥60 版本过低apk如何修改可以兼容新的安卓系统
    • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
    • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
    • ¥50 有数据,怎么用matlab求全要素生产率
    • ¥15 TI的insta-spin例程
    • ¥15 完成下列问题完成下列问题
    • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
    • ¥15 YoloV5 第三方库的版本对照问题
    • ¥15 请完成下列相关问题!
    • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?