Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/link: unresolved inter-package jump message on ppc64le building godoc #19764

Closed
laboger opened this issue Mar 29, 2017 · 3 comments
Closed
Milestone

Comments

@laboger
Copy link
Contributor

laboger commented Mar 29, 2017

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go tip

What operating system and processor architecture are you using (go env)?

Ubuntu 16.04 ppc64le

What did you do?

Built golang from master, then tried to build the latest from golang.org/x/tools/cmd/godoc

What did you expect to see?

Successful build

What did you see instead?

At the link step for the build of a.out:

golang.org/x/tools/go/ssa.makeWrapper: unresolved inter-package jump to golang.org/x/tools/go/ssa.(*UnOp).Type(golang.org/x/tools/godoc/analysis)

I tried the following to see if it was related to the recent change to plt stubs:

  • Built go 1.8 commit c955eb1 (including change to location of plt stubs) and it did not fail.
  • Built from master commit 43afcb5 (before change to plt stubs), and it still failed:
    go version devel +43afcb5 Wed Mar 15 04:27:49 2017 +0000 linux/ppc64le

The error message is generated in the trampoline function in data.go. @cherrymui could you look at this because I'm not sure of the reason for this error message or why it could fail in this situation.

go get -u -a -x -work golang.org/x/tools/cmd/godoc
.....
/home/boger/golang/base/go/pkg/tool/linux_ppc64le/compile -o $WORK/golang.org/x/tools/cmd/godoc.a -trimpath $WORK -p main -complete -buildid 4cfbc09d338fcdd7fcdcc7de9d716e0c693792f7 -D _/home/boger/gocode/src/golang.org/x/tools/cmd/godoc -I $WORK -I /home/boger/gocode/pkg/linux_ppc64le -pack ./blog.go ./codewalk.go ./dl.go ./doc.go ./handlers.go ./index.go ./main.go ./play.go ./remotesearch.go ./x.go
cd .
/home/boger/golang/base/go/pkg/tool/linux_ppc64le/link -o $WORK/golang.org/x/tools/cmd/godoc/_obj/exe/a.out -L $WORK -L /home/boger/gocode/pkg/linux_ppc64le -extld=gcc -buildmode=exe -buildid=4cfbc09d338fcdd7fcdcc7de9d716e0c693792f7 $WORK/golang.org/x/tools/cmd/godoc.a

golang.org/x/tools/cmd/godoc

golang.org/x/tools/go/ssa.makeWrapper: unresolved inter-package jump to golang.org/x/tools/go/ssa.(*UnOp).Type(golang.org/x/tools/godoc/analysis)

@cherrymui
Copy link
Member

I'm not sure why this happens: why golang.org/x/tools/go/ssa.(*UnOp).Type is considered defined in package golang.org/x/tools/godoc/analysis? I'll look into how this went wrong.

@cherrymui cherrymui added this to the Go1.9 milestone Mar 30, 2017
@cherrymui cherrymui self-assigned this Mar 30, 2017
@cherrymui
Copy link
Member

The failure starts at commit 295307a (CL https://go-review.googlesource.com/c/38139/). It now makes a direct call to golang.org/x/tools/go/ssa.(*UnOp).Type which used to be indirect call. The problem is that golang.org/x/tools/go/ssa.(*UnOp).Type is an auto-generated method wrapper, which is dupok and generated in multiple packages. The linker happens to pick one that is not defined in golang.org/x/tools/go/ssa package. It was ok because the wrappers were not called directly.

We probably need to special-case wrappers in the trampoline pass. I'll make a fix.

@gopherbot
Copy link

CL https://golang.org/cl/39150 mentions this issue.

lparth pushed a commit to lparth/go that referenced this issue Apr 13, 2017
Dupok symbols may be defined in multiple packages. Its associated
package is chosen sort of arbitrarily (the first containing package
that the linker loads). Canonicalize its package to the package
with which it will be laid down in text, which is the first package
in dependency order that defines the symbol. So later passes (for
example, trampoline insertion pass) know that the dupok symbol
is laid down along with the package.

Fixes golang#19764.

Change-Id: I7cbc7474ff3016d5069c8b7be04af934abab8bc3
Reviewed-on: https://go-review.googlesource.com/39150
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
Reviewed-by: David Chase <drchase@google.com>
@golang golang locked and limited conversation to collaborators Apr 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants