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

Closed
bigfg opened this issue Jan 11, 2018 · 3 comments

Comments

@bigfg
Copy link

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.

@davecheney
Copy link
Contributor

davecheney commented Jan 11, 2018 via email

@crvv
Copy link
Contributor

crvv commented Jan 12, 2018

This looks like a duplicate of #23311

@davecheney
Copy link
Contributor

Closing as answered.

@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.
Projects
None yet
Development

No branches or pull requests

4 participants