“预期伪寄存器;找到R13”错误

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

"expected pseudo-register; found R13" error

问题

我刚刚使用Goland运行了一个Go项目,出现了以下错误:

  1. # github.com/choleraehyq/pid
  2. ../../../.go/pkg/mod/github.com/choleraehyq/pid@v0.0.10/pid_go1.5_amd64.s:28: 预期伪寄存器;找到 R13
  3. ../../../.go/pkg/mod/github.com/choleraehyq/pid@v0.0.10/pid_go1.5_amd64.s:29: 预期伪寄存器;找到 R14
  4. asm: 编译 ../../../.go/pkg/mod/github.com/choleraehyq/pid@v0.0.10/pid_go1.5_amd64.s 失败

我对这个错误感到困惑,不知道该怎么办。这个错误信息无法进行调试,并且在谷歌上也没有找到任何有用的信息。github.com/choleraehyq/pid是被下层框架引用的。

我只想知道发生了什么以及如何修复它。请帮助我,非常感谢。

英文:

I just run a go project with goland and got error as blow:

  1. # github.com/choleraehyq/pid
  2. ../../../.go/pkg/mod/github.com/choleraehyq/pid@v0.0.10/pid_go1.5_amd64.s:28: expected pseudo-register; found R13
  3. ../../../.go/pkg/mod/github.com/choleraehyq/pid@v0.0.10/pid_go1.5_amd64.s:29: expected pseudo-register; found R14
  4. asm: assembly of ../../../.go/pkg/mod/github.com/choleraehyq/pid@v0.0.10/pid_go1.5_amd64.s failed

I'm confused about this error and I don't know what todo. I can't do some debug work by this error message and didn't get any useful informations from google. github.com/choleraehyq/pid is referred by under framework.

I just want to know what happened and how to fix it. Please help me, thank you every much.

答案1

得分: 1

我的go版本是1.17.6,也遇到了这个问题。

我通过更新包版本来解决这个问题:

  1. go get -u github.com/choleraehyq/pid
  2. go get:升级 github.com/choleraehyq/pid v0.0.10 => v0.0.13
英文:

My go version is 1.17.6, also with this problem.

I solve the problem by updating the package version:

  1. go get -u github.com/choleraehyq/pid
  2. go get: upgraded github.com/choleraehyq/pid v0.0.10 => v0.0.13

答案2

得分: 1

这是翻译好的内容:

当我将Go版本从1.13更新到1.19时发生了这个问题,我通过更新包版本来解决了这个问题:

  1. go get -u github.com/choleraehyq/pid
  2. go: 正在下载 github.com/choleraehyq/pid v0.0.15
  3. go: 升级 github.com/choleraehyq/pid v0.0.13 => v0.0.15
英文:

It happened when I update go version from 1.13 -> 1.19
and I solve the problem by updating the package version:

  1. go get -u github.com/choleraehyq/pid
  2. go: downloading github.com/choleraehyq/pid v0.0.15
  3. go: upgraded github.com/choleraehyq/pid v0.0.13 => v0.0.15

答案3

得分: 0

我只想知道发生了什么以及如何修复它。


  1. 阅读说明。

Stack Overflow: 帮助:如何创建一个最小可复现示例

  1. 按照说明进行操作。

例如,

包 goid
github.com/choleraehyq/pid@v0.0.10
以编程方式获取当前 goroutine 的 ID。

.

  1. $ cat pid.go
  2. package main
  3. import (
  4. "fmt"
  5. goid "github.com/choleraehyq/pid"
  6. )
  7. func main() {
  8. pid := goid.GetPid()
  9. fmt.Println(pid)
  10. }
  11. $

.

  1. $ cat go.mod
  2. module example/pid
  3. go 1.17
  4. require github.com/choleraehyq/pid v0.0.10
  5. $

.

  1. $ go version
  2. go version go1.17.5 linux/amd64
  3. $

.

  1. $ go build pid.go && ./pid
  2. # github.com/choleraehyq/pid
  3. ../../gopath/pkg/mod/github.com/choleraehyq/pid@v0.0.10/pid_go1.5_amd64.s:28: expected pseudo-register; found R13
  4. ../../gopath/pkg/mod/github.com/choleraehyq/pid@v0.0.10/pid_go1.5_amd64.s:29: expected pseudo-register; found R14
  5. asm: assembly of ../../gopath/pkg/mod/github.com/choleraehyq/pid@v0.0.10/pid_go1.5_amd64.s failed
  6. $

升级到最新版本。

.

  1. $ go get -u github.com/choleraehyq/pid
  2. go: downloading github.com/choleraehyq/pid v0.0.13
  3. go: upgraded github.com/choleraehyq/pid v0.0.10 => v0.0.13
  4. $

.

  1. $ cat go.mod
  2. module example/pid
  3. go 1.17
  4. require github.com/choleraehyq/pid v0.0.13
  5. $

.

  1. $ go build pid.go && ./pid
  2. 1
  3. $

避免使用旧的、过时的和不受支持的软件版本。


更新:

OP 的评论:

谢谢。原始项目是一个大项目,有深层次的依赖关系。我发现我需要将 github.com/choleraehyq/pid v0.0.13 // indirect 添加到项目的 go.mod 中。- sh1yu

英文:

> I just want to know what happened and how to fix it.


  1. Read the instructions.

Stack Overflow: Help: How to create a Minimal, Reproducible Example

  1. Follow the instructions.

For example,

package goid
github.com/choleraehyq/pid@v0.0.10
Programatically retrieve the current goroutine's ID.

.

  1. $ cat pid.go
  2. package main
  3. import (
  4. "fmt"
  5. goid "github.com/choleraehyq/pid"
  6. )
  7. func main() {
  8. pid := goid.GetPid()
  9. fmt.Println(pid)
  10. }
  11. $

.

  1. $ cat go.mod
  2. module example/pid
  3. go 1.17
  4. require github.com/choleraehyq/pid v0.0.10
  5. $

.

  1. $ go version
  2. go version go1.17.5 linux/amd64
  3. $

.

  1. $ go build pid.go && ./pid
  2. # github.com/choleraehyq/pid
  3. ../../gopath/pkg/mod/github.com/choleraehyq/pid@v0.0.10/pid_go1.5_amd64.s:28: expected pseudo-register; found R13
  4. ../../gopath/pkg/mod/github.com/choleraehyq/pid@v0.0.10/pid_go1.5_amd64.s:29: expected pseudo-register; found R14
  5. asm: assembly of ../../gopath/pkg/mod/github.com/choleraehyq/pid@v0.0.10/pid_go1.5_amd64.s failed
  6. $

Upgrade to the latest version.

.

  1. $ go get -u github.com/choleraehyq/pid
  2. go: downloading github.com/choleraehyq/pid v0.0.13
  3. go: upgraded github.com/choleraehyq/pid v0.0.10 => v0.0.13
  4. $

.

  1. $ cat go.mod
  2. module example/pid
  3. go 1.17
  4. require github.com/choleraehyq/pid v0.0.13
  5. $

.

  1. $ go build pid.go && ./pid
  2. 1
  3. $

Avoid using old, obsolete, and unsupported versions of software.



UPDATE:

Comment from OP:

Thanks. The original project is a big project and has deep dependencies. I find that I need to add github.com/choleraehyq/pid v0.0.13 // indirect to the project's go.mod. – sh1yu

答案4

得分: 0

我也遇到了这个问题。可能与你的 Golang 版本有关;我将我的 Golang 版本从 1.17 更改为 1.14,问题得到了解决。

英文:

It happened to me too. It maybe related to your golang's version;<br>
I changed my golang's version from 1.17 to 1.14, which solved the problem.

huangapple
  • 本文由 发表于 2021年12月23日 13:23:49
  • 转载请务必保留本文链接:https://go.coder-hub.com/70457957.html
匿名

发表评论

匿名网友

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

确定