在Ubuntu 9.10 karmic中出现gccgo链接错误?

huangapple go评论81阅读模式
英文:

gccgo linking Error in Ubuntu 9.10 karmic?

问题

我正在尝试使用gccgo编译go文件,我已经在我的Ubuntu 9.10机器上安装了它。当我编译时,

 $gccgo -c hello.go

生成了hello.o文件,但在尝试链接并形成可执行文件时,

$gccgo -o hello hello.o

我得到了以下错误

 /usr/local/lib/gcc/i686-pc-linux-gnu/4.5.0/../../../libgo.so: undefined reference to `__sync_fetch_and_add_4'
/usr/local/lib/gcc/i686-pc-linux-gnu/4.5.0/../../../libgo.so: undefined reference to `__sync_bool_compare_and_swap_4'
collect2: ld returned 1 exit status

我是否漏掉了什么?我也在我的环境中设置了LD_LIBRARY_PATH。谢谢

英文:

I am trying to compile go file using gccgo , i installed on my ubuntu 9.10 machine . when i compiled

 $gccgo -c hello.go

hello.o file is generated , while trying to link and to form an executable

$gccgo -o hello hello.o

i get the following error

 /usr/local/lib/gcc/i686-pc-linux-gnu/4.5.0/../../../libgo.so: undefined reference to `__sync_fetch_and_add_4'
/usr/local/lib/gcc/i686-pc-linux-gnu/4.5.0/../../../libgo.so: undefined reference to `__sync_bool_compare_and_swap_4'
collect2: ld returned 1 exit status

Am i missing something ? , i have also set my LD_LIBRARY_PATH in my environment . Thanks

答案1

得分: 0

也许可以尝试按照<a href="http://sourceware.org/ml/libc-alpha/2007-02/msg00009.html">这篇帖子</a>中的建议,并将<code>-march=i486</code>传递给编译器?(或者<code>-march=i686</code>)

英文:

Maybe try following the advice in <a href="http://sourceware.org/ml/libc-alpha/2007-02/msg00009.html"> this post </a> and pass <code>-march=i486</code> to the compiler? (or <code>-march=i686</code>)

huangapple
  • 本文由 发表于 2009年11月20日 17:10:33
  • 转载请务必保留本文链接:https://go.coder-hub.com/1769235.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定