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

laboger opened this issue Mar 29, 2017 · 3 comments

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

laboger opened this issue Mar 29, 2017 · 3 comments


Copy link

@laboger 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

What did you expect to see?

Successful build

What did you see instead?

At the link step for the build of a.out: unresolved inter-package jump to*UnOp).Type(

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
/home/boger/golang/base/go/pkg/tool/linux_ppc64le/compile -o $WORK/ -trimpath $WORK -p main -complete -buildid 4cfbc09d338fcdd7fcdcc7de9d716e0c693792f7 -D _/home/boger/gocode/src/ -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/ -L $WORK -L /home/boger/gocode/pkg/linux_ppc64le -extld=gcc -buildmode=exe -buildid=4cfbc09d338fcdd7fcdcc7de9d716e0c693792f7 $WORK/ unresolved inter-package jump to*UnOp).Type(

Copy link

@cherrymui cherrymui commented Mar 30, 2017

I'm not sure why this happens: why*UnOp).Type is considered defined in package 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
Copy link

@cherrymui cherrymui commented Mar 30, 2017

The failure starts at commit 295307a (CL It now makes a direct call to*UnOp).Type which used to be indirect call. The problem is that*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 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.

Copy link

@gopherbot gopherbot commented Mar 31, 2017

CL mentions this issue.

@gopherbot gopherbot closed this in a1cedf0 Apr 2, 2017
lparth added 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
Run-TryBot: Cherry Zhang <>
TryBot-Result: Gobot Gobot <>
Reviewed-by: Lynn Boger <>
Reviewed-by: David Chase <>
@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.
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.