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

Projects
None yet
4 participants
@bigfg
Copy link

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

This comment has been minimized.

Copy link
Contributor

commented Jan 11, 2018

@crvv

This comment has been minimized.

Copy link
Contributor

commented Jan 12, 2018

This looks like a duplicate of #23311

@davecheney

This comment has been minimized.

Copy link
Contributor

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.
You can’t perform that action at this time.