简体   繁体   English

golang 1.17 构建失败 [gcc 失败:退出状态 1]

[英]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:命令:

  1. go mod vendor is working downloading all the dependencies go mod 供应商正在下载所有依赖项
  2. go install serviceName fails with the error above go 安装 serviceName 失败并出现上述错误

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.

相关问题 无法使用 SDK 运行 AzureML 实验 - 无法为 pynacl/退出状态构建轮:1 - Unable To Run AzureML Experiment with SDK - Failed to Build Wheel for pynacl / Exit status:1 错误:构建步骤 0“gcr.io/cloud-builders/docker”失败:退出状态 1 - ERROR: build step 0 "gcr.io/cloud-builders/docker" failed: exit status 1 IOS 应用构建问题:命令 CodeSign 失败,退出代码非零 - IOS App Build issue: Command CodeSign failed with a nonzero exit code unity build iOS framework add failed due to a CocoaPods 安装失败 - Unity build iOS framework addition failed due to a CocoaPods installation failure GitLab CI。 作业失败并出现错误:错误:作业失败:退出状态 9009 - GitLab CI. Job failed with error: ERROR: Job failed: exit status 9009 执行命令时出错:sam build --use-container --template ${SAM_TEMPLATE}。 原因:退出状态1 - Error while executing command: sam build --use-container --template ${SAM_TEMPLATE}. Reason: exit status 1 构建失败 - 在 AWS Amplify 中“npm 构建”后检测到非零退出代码 - Build Failed - Non-Zero Exit Code Detected after 'npm build' in AWS Amplify 当至少一个 Cypress 测试失败时,在 AWS CodeBuild 中获取“COMMAND_EXECUTION_ERROR ... 原因:退出状态 1” - Getting "COMMAND_EXECUTION_ERROR ... Reason: exit status 1" in AWS CodeBuild when at least one Cypress test has failed 错误:未能规范化链代码路径:'go list' 失败:使用 -buildvcs=false 禁用 VCS 标记。:退出状态 1 - Error: failed to normalize chaincode path: 'go list' failed with: Use -buildvcs=false to disable VCS stamping.: exit status 1 golang redis 客户端连接状态 - golang redis client connection status
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM