[英]golang 1.17 build failure [gcc failed: exit status 1]
ERROR: /var/lib/jenkins/tools/org.jenkinsci.plugins.golang.GolangInstallation/go1.17/pkg/tool/linux_amd64/link: running gcc failed: exit status 1 /usr/bin/ld: /tmp/go-link-350634742/000048.o: unrecognized relocation (0x2a) in section `.text' /usr/bin/ld: final link failed: Bad value collect2: error: ld returned 1 exit status错误:/var/lib/jenkins/tools/org.jenkinsci.plugins.golang.GolangInstallation/go1.17/pkg/tool/linux_amd64/link:运行 gcc 失败:退出状态 1 /usr/bin/ld:/tmp/ go-link-350634742/000048.o:“.text”/usr/bin/ld 部分中无法识别的重定位(0x2a):最终链接失败:错误值 collect2:错误:ld 返回 1 退出状态
FLAGS: GO111MODULE = on标志:GO111MODULE = on
Command:命令:
GCC VERSION: gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44) GCC 版本:gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)
Far as I see you are trying to use CGO for your build Try Command This Command will tell the compiler to use CGO据我所知,您正在尝试使用 CGO 进行构建尝试命令此命令将告诉编译器使用 CGO
CGO_ENABLED=1 go build
if you have custom compiler or if GO couldn't find the binary you can specify如果您有自定义编译器,或者 GO 找不到您可以指定的二进制文件
CGO_ENABLED=1 CXX=g++ CC=gcc go build
if it is not worked out for you can customize the path or binary name of the compiler如果没有解决,您可以自定义编译器的路径或二进制名称
CXX=x86_64-w64-mingw32-g++ CC=x86_64-w64-mingw32-gcc go build -x
if this answer still didn't work out a reply we could look into it again.如果这个答案仍然没有得到答复,我们可以再次调查。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.