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/compile: "missing function body" error when using the //go:linkname compiler directive #23408

bigfg opened this issue Jan 11, 2018 · 3 comments


Copy link

@bigfg bigfg commented Jan 11, 2018

For example let's say (hypothetically) that I wanted to call the strhash function defined in the runtime package, I could do:

`package key

import "unsafe"

//go:linkname strhash runtime.strhash
func strhash(a unsafe.Pointer, h uintptr) uintptr

func hash(s string) uintptr {
return strhash(unsafe.Pointer(&s), 0)

this case came from: #15006

actually, I try to fix this with:
flag.BoolVar(&completeFlag, "complete", true, "compiling complete package")

But it doesn't seem to work.

Copy link

@davecheney davecheney commented Jan 11, 2018

Copy link

@crvv crvv commented Jan 12, 2018

This looks like a duplicate of #23311

Copy link

@davecheney davecheney commented Jan 12, 2018

Closing as answered.

@davecheney davecheney closed this Jan 12, 2018
@golang golang locked and limited conversation to collaborators Jan 12, 2019
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
4 participants