Closed Rajalakshmi-Girish closed 3 years ago
@mkumatag @laboger ^^
@pmur
Looking into this. I see a relocation to the missing function in the objdump from the build cache, but the function is missing. Looking it's name, it should be also be present in the same object file?
TEXT go.etcd.io/etcd/etcdserver/api/v3client.New.func2(SB) gofile../home/murp/git/go-test/tmp-test/k8/src/k8s.io/kubernetes/vendor/go.etcd.io/etcd/clientv3/maintenance.go
maintenance.go:100 0x167c3 e86b0008 MOVD 8(R11),R3
maintenance.go:100 0x167c7 e88b0010 MOVD 16(R11),R4
maintenance.go:101 0x167cb f8610030 MOVD R3,48(R1)
maintenance.go:101 0x167cf f8810038 MOVD R4,56(R1)
maintenance.go:101 0x167d3 3fe00000 ADDIS $0,$0,R31 [0:8]R_ADDRPOWER:go.etcd.io/etcd/etcdserver/api/v3client.New.func1·f
maintenance.go:101 0x167d7 387f0000 ADD R31,$0,R3
maintenance.go:101 0x167db f8610040 MOVD R3,64(R1)
maintenance.go:101 0x167df f8010048 MOVD R0,72(R1)
maintenance.go:101 0x167e3 f8010050 MOVD R0,80(R1)
maintenance.go:101 0x167e7 4e800020 RET
maintenance.go:101 0x167eb 00000000 WORD $0
maintenance.go:101 0x167ef 00000000 WORD $0
Simple test case:
bar/b.go:
package bar
type Bar struct {
F func ()
}
func BuildBar() Bar {
ret := Bar{ F: func() {} }
return ret
}
main.go:
package main
import (
"fmt"
"example.com/local/foo"
)
func main() {
fmt.Printf("%v\n",foo.New(1))
}
foo/a.go:
package foo
import (
"example.com/local/bar"
)
type Foo struct {
b bar.Bar
}
func New(a int) Foo {
return Foo{b: bar.BuildBar() }
}
@pmur Your test case builds for me with GOARCH=ppc64le go build
. How are you building it, and what error do you see? Thanks.
@ianlancetaylor Here are the other details I should have included too go version devel +a400eb3261 Mon Mar 1 15:24:01 2021 +0000 linux/ppc64le
>go build
main.main.func1·f: relocation target main.main.func1 not defined
go.mod:
module example.com/local
go 1.17
This might be a dup of #44330, which was fixed since the revision that you are testing.
@ianlancetaylor yes, this is a duplicate. I verified my test case and kubernetes compile after cherry-picking the commit in #44330. This issue can be closed. Thank you for pointing out that issue.
What version of Go are you using (
go version
)?What operating system and processor architecture are you using (
go env
)?Operating system: Linux Architecture: ppc64le and amd64
What did you do?
Building targets for kubernetes using the latest golang in main branch
What did you expect to see?
Kubernetes binaries build without error
What did you see instead?
Below error: