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

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

"expected pseudo-register; found R13" error

问题

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

# github.com/choleraehyq/pid
../../../.go/pkg/mod/github.com/choleraehyq/pid@v0.0.10/pid_go1.5_amd64.s:28: 预期伪寄存器;找到 R13
../../../.go/pkg/mod/github.com/choleraehyq/pid@v0.0.10/pid_go1.5_amd64.s:29: 预期伪寄存器;找到 R14
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:

# github.com/choleraehyq/pid
../../../.go/pkg/mod/github.com/choleraehyq/pid@v0.0.10/pid_go1.5_amd64.s:28: expected pseudo-register; found R13
../../../.go/pkg/mod/github.com/choleraehyq/pid@v0.0.10/pid_go1.5_amd64.s:29: expected pseudo-register; found R14
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,也遇到了这个问题。

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

go get -u github.com/choleraehyq/pid
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:

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

答案2

得分: 1

这是翻译好的内容:

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

go get -u github.com/choleraehyq/pid
go: 正在下载 github.com/choleraehyq/pid v0.0.15
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:

go get -u github.com/choleraehyq/pid
go: downloading github.com/choleraehyq/pid v0.0.15
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。

.

$ cat pid.go
package main

import (
    "fmt"

    goid "github.com/choleraehyq/pid"
)

func main() {
    pid := goid.GetPid()
    fmt.Println(pid)
}
$

.

$ cat go.mod
module example/pid

go 1.17

require github.com/choleraehyq/pid v0.0.10
$ 

.

$ go version
go version go1.17.5 linux/amd64
$ 

.

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

升级到最新版本。

.

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

.

$ cat go.mod
module example/pid

go 1.17

require github.com/choleraehyq/pid v0.0.13
$ 

.

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

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


更新:

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.

.

$ cat pid.go
package main

import (
    "fmt"

    goid "github.com/choleraehyq/pid"
)

func main() {
    pid := goid.GetPid()
    fmt.Println(pid)
}
$

.

$ cat go.mod
module example/pid

go 1.17

require github.com/choleraehyq/pid v0.0.10
$ 

.

$ go version
go version go1.17.5 linux/amd64
$ 

.

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

Upgrade to the latest version.

.

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

.

$ cat go.mod
module example/pid

go 1.17

require github.com/choleraehyq/pid v0.0.13
$ 

.

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

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:

确定