0

I was trying to build a go binary for centOS in a docker container, It's giving the following error:

# command-line-arguments

github.com/ugorji/go/codec.rvSetDirect: relocation target reflect.typedmemclr not defined

github.com/ugorji/go/codec.rvSetDirectZero: relocation target reflect.typedmemclr not defined

I tried go build with -x as well and don't see anything related to broken installation, still the build is unsuccessful with the above errors.

tourist
  • 506
  • 1
  • 6
  • 20

1 Answers1

1

Considering the codec/helper_unsafe.go#rvSetDirect code, you have:

So import runtime is missing in helper_unsafe.go

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • added the import, should I modify anywhere else? I've got the below error # github.com/ugorji/go/codec src/github.com/ugorji/go/codec/helper_unsafe.go:15:2: imported and not used: "runtime" – tourist Oct 26 '20 at 10:29
  • @sbk OK it is another issue then, and you probably do not need that import. The function is defined as a linked function: https://github.com/ugorji/go/blob/e6dffd531604d05d1eed9d467fd16794c0c9803c/codec/helper_unsafe.go#L941-L943 – VonC Oct 26 '20 at 10:36