Home > Enterprise >  "expected pseudo-register; found R13" error
"expected pseudo-register; found R13" error

Time:12-24

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

# github.com/choleraehyq/pid
../../../.go/pkg/mod/github.com/choleraehyq/[email protected]/pid_go1.5_amd64.s:28: expected pseudo-register; found R13
../../../.go/pkg/mod/github.com/choleraehyq/[email protected]/pid_go1.5_amd64.s:29: expected pseudo-register; found R14
asm: assembly of ../../../.go/pkg/mod/github.com/choleraehyq/[email protected]/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.

CodePudding user response:

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/[email protected]
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/[email protected]/pid_go1.5_amd64.s:28: expected pseudo-register; found R13
../../gopath/pkg/mod/github.com/choleraehyq/[email protected]/pid_go1.5_amd64.s:29: expected pseudo-register; found R14
asm: assembly of ../../gopath/pkg/mod/github.com/choleraehyq/[email protected]/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.

  •  Tags:  
  • go
  • Related