当前位置: 首页 > 工具软件 > go link > 使用案例 >

centos Go编译报错link: running gcc failed: exit status 1

朱锦
2023-12-01

问题 centos go编译缺少 gcc

link: running gcc failed: exit status 1

/usr/local/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/usr/bin/ld: /tmp/go-link-862797465/000020.o: unrecognized relocation (0x2a) in section `.text'
/usr/bin/ld: final link failed: 错误的值

继续报错

[root@iz2ze7 cloud-disk-go]# go run main.go 
# command-line-arguments
/usr/local/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/usr/bin/ld: /tmp/go-link-101037760/000020.o: unrecognized relocation (0x2a) in section `.text'
/usr/bin/ld: final link failed: 错误的值
collect2: 错误:ld 返回 1

解决方案

  1. 缺少gcc
yum install glibc-static
  1. 继续报错解决方案 更新一下这个软件
yum install binutils

参考链接

https://blog.csdn.net/changxiaoshen/article/details/107104713
https://blog.csdn.net/weixin_41827162/article/details/117923481

 类似资料: