精确的gccgo [英] gccgo on Precise

查看:222
本文介绍了精确的gccgo的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当试图在Precise上与gccgo链接时,我得到这个链接错误:

$ matt $ matt-1005P:〜/ src / gopath / src / meme $ gccgo cmd / meme / main.go -o meme
/ usr / bin / ld:找不到-lgcc_s
collect2:错误:ld返回1退出状态

有这个错误的报道,但没有干净的解决方案。如何修复它?


gccgo(Ubuntu / Linaro 4.7.0-0ubuntu4)4.7.0



Linux matt-1005P 3.2.0-24-generic-pae#38-Ubuntu SMP Tue May 1 16:40:26 UTC 2012 i686 i686 i386 GNU / Linux


解决方案

最近这个问题在golang-nuts组中提出:使用gccgo从打包的二进制文件编译
$ b 这是一个已知问题Ubuntu( Bug#966570 )。要解决它,可以通过在gccgoflags中指定 -static-libgcc 来链接静态libgcc。即

  go build -compiler gccgo -gccgoflags'-static-libgcc'


When trying to link with gccgo on Precise, I get this linking error:

matt@matt-1005P:~/src/gopath/src/meme$ gccgo cmd/meme/main.go -o meme
/usr/bin/ld: cannot find -lgcc_s
collect2: error: ld returned 1 exit status

There are reports of this error, but no clean solutions. How do I fix it?

gccgo (Ubuntu/Linaro 4.7.0-0ubuntu4) 4.7.0

Linux matt-1005P 3.2.0-24-generic-pae #38-Ubuntu SMP Tue May 1 16:40:26 UTC 2012 i686 i686 i386 GNU/Linux

解决方案

This was recently brought up on the golang-nuts group: compiling with gccgo from packaged binaries.

It's a known issue in Ubuntu (Bug #966570). To work around it, you can link with the static libgcc by specifying -static-libgcc in the gccgoflags. i.e.

go build -compiler gccgo -gccgoflags '-static-libgcc'

这篇关于精确的gccgo的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆